frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

1•LawZiL•1y ago
I'm running a load test on my Node.js application and want to simulate realistic write-heavy scenarios to stress test the system — especially the PostgreSQL database.

There's a part of the code that performs UPDATE queries, but during load testing, I don't want these updates to actually change the state of the database. However, I still want the database to experience the full impact of the update — query planning, locking, I/O, WAL writes, etc. — so I can measure how it affects performance under peak load.

Is there a best-practice approach to achieve this?

So far, the most viable option I’ve found is to wrap the UPDATE queries in a transaction and then roll it back — that way, the queries still execute, but the state doesn’t change. Is this the right way to go? Does rollback introduce any performance overhead that would skew my results? Are there better or more realistic alternatives that simulate the full write path without persisting changes?

Thanks in advance!

Comments

sargstuff•1y ago
pgbench[2] / pgreplay-go[0] / python locust[1]

very old school approach:

Misuse sql VIEW[3][4] to generate a temporary parallel table setup. Testing database separate from production database would be 'better', IMHO.

-----

[0] pgreplay-go : https://github.com/gocardless/pgreplay-go

[1] python locust : https://miguel-codes.medium.com/unconventional-load-testing-...

[2] pgbench load testing :

   a) https://medium.com/@c.ucanefe/pgbench-load-test-166bdfb5c75a

   b) https://neon.tech/blog/autoscaling-in-action-postgres-load-testing-with-pgbench

   c) https://hackernoon.com/how-to-create-and-load-test-data-in-postgresql-i41e353m
----------------------------

[3] : a) https://hashrocket.com/blog/posts/materialized-view-strategi...

      b) https://tech.jonathangardner.net/wiki/PostgreSQL/Materialized_Views

      c) https://stackoverflow.com/questions/77603705/what-is-the-use-of-materialized-view-in-postgresql
[4] : https://en.wikipedia.org/wiki/View_(SQL)
LawZiL•1y ago
but again, how can i perform the query, but not actually change the state, i really need the state to keep untouched, but be able to perform the query itself.
MatthiasPortzel•1y ago
> Does rollback introduce any performance overhead that would skew my results?

I would expect it to be the other way around—since the transactions are rolled back and not committed, they would have significantly less performance impact. But I’m working from an academic model of the database.

apothegm•1y ago
Load test against a clone instead of a DB whose contents you care about?

Show HN: Universal 3.6 Pro – streaming speech-to-text tuned for voice agents

https://www.assemblyai.com/dashboard/login
1•iharnoor•1m ago•0 comments

WSL 3.0.1

https://github.com/microsoft/WSL/releases/tag/3.0.1
1•conductor•3m ago•0 comments

Beyond the Prompt Loop: Architecting AI Agent State Machines: Architecture, Late

1•dusynblog•3m ago•0 comments

What Is a Container, Really? Five Years of GPU Infrastructure

https://www.beam.cloud/blog/what-is-a-container-really
1•Mernit•3m ago•0 comments

AMD Boosting AI/LLM Performance for Radeon iGPUs as Much as 18~23% with Linux7.4

https://www.phoronix.com/review/amd-perfopt
1•pella•6m ago•0 comments

Modern Web Types

https://philipwalton.com/articles/modern-web-types/
1•ibobev•7m ago•0 comments

Upload and Submit ChatGPT Plugins

https://developers.openai.com/plugins/deploy/submission
1•gmays•7m ago•0 comments

Discovery of a Molecular "Memory" That Could Make Lost Weight Come Back

https://scitechdaily.com/scientists-discover-a-molecular-memory-that-could-make-lost-weight-come-...
1•janandonly•10m ago•0 comments

TreasuryDirect provides more guidance on ID.me transition

https://tipswatch.com/2026/09/09/treasurydirect-provides-more-guidance-on-id-me-transition/
1•bariumbitmap•11m ago•1 comments

Show HN: A tool site with zero back end – everything runs client-side

https://www.vantorkit.com/
1•hajjamixcv2012•11m ago•0 comments

Syncing Rust GCC back end or how to test Murphy's law

https://blog.guillaume-gomez.fr/articles/2026-09-22+Syncing+Rust+GCC+backend+or+how+to+test+Murph...
1•birdculture•11m ago•0 comments

Show HN: Web server that lets you build iOS & Android offline apps like BitChat

https://github.com/Qbix/webserver/tree/main
2•EGreg•12m ago•0 comments

Ask HN: Are you working less? By how much?

1•haute_cuisine•12m ago•1 comments

The Tech Industry: An Autopsy

https://monroelab.com/2026/09/29/the-tech-industry-an-autopsy/
1•cdrnsf•12m ago•0 comments

Artifical Analysis - GPT-6.1 Sol Replaces 6 Sol After 7 Days

https://artificialanalysis.ai/articles/gpt-6-1-sol-replaces-gpt-6-sol-after-just-7-days-with-near...
1•Fe2O3•13m ago•0 comments

TeXmacs Vue – GNU TeXmacs in the Browser

https://github.com/mgubi/texmacs/tree/wip_wasm_vue
1•amichail•14m ago•0 comments

AI data centres in N.L.? The door is 'open for business,' says energy minister

https://www.cbc.ca/news/canada/newfoundland-labrador/ai-data-centres-nl-9.7361381
1•cdrnsf•14m ago•0 comments

Ask HN: If a few labs keep the frontier models internal, is that the end of YC?

1•consumer451•14m ago•0 comments

Why Independent Developer Blogs Are Going Offline

https://shramko.dev/blog/blogs-going-offline
1•almanname•15m ago•0 comments

Show HN: Kursal, a decentralized E2E encrypted messenger

https://github.com/KursalChat/Kursal
1•Kodeur_Kubik•15m ago•0 comments

Hordes.io Journal Part 1: Alpha

https://dek.engineer/blog/hordes-io-journal-alpha
1•jpgleeson•17m ago•0 comments

Hate Beets? Science May Have the Answer Why

https://www.justbeetit.com/beet-blog-index/hate-beets-that-taste-like-dirt-science-has-the-answer
1•altern8•19m ago•0 comments

Individual locomotor bias drives counterclockwise motion in pedestrian crowds

https://www.nature.com/articles/s41467-026-73713-w
3•hunajakettu•20m ago•0 comments

A New Documentary Wrestles with the Legacy of Designer Eliot Noyes

https://www.architecturalrecord.com/articles/17007-a-new-documentary-wrestles-with-the-legacy-of-...
1•rbanffy•21m ago•0 comments

The decompilation of Super Mario Galaxy 1 is complete

https://github.com/SMGCommunity/Petari
1•luispa•22m ago•0 comments

Looking for beta testers – companion app for musicians' followers

https://stanislawfoxpopuk.com/
1•stasvip•24m ago•0 comments

From System F to typed assembly language

https://dl.acm.org/doi/10.1145/319301.319345
2•fanf2•24m ago•0 comments

I'm So Confused: Are We Going Faster, or Slower, or Just Faking Everyone Out

https://feld.com/archives/2026/09/im-so-confused-faster-slower-or-faking/
1•rmason•25m ago•0 comments

Sign in with ChatGPT

https://help.openai.com/en/articles/20001410-sign-in-with-chatgpt
2•vmg12•25m ago•0 comments

Tuning a Server for Benchmarking

https://david.alvarezrosa.com/posts/tuning-a-server-for-benchmarking/
1•ibobev•26m ago•0 comments