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?

How accurately did science fiction stories predict AI?

https://jamesyu.org/science-fiction-predictions-of-ai/
1•jamesjyu•56s ago•0 comments

Dynamic force sensing by bone delays aging and extends lifespan in mice

https://www.cell.com/cell-metabolism/fulltext/S1550-4131(26)00433-X
1•geox•3m ago•0 comments

Codetations: Rich, Granular, and Maintainable Annotations for Evolving Code

https://ztatlock.net/pubs/2026-uist-codetations/
1•matt_d•8m ago•0 comments

Stop Dirty Data Centres

https://stopdirtydatacentres.eu/
1•jruohonen•9m ago•0 comments

From Linux to Wikipedia: How Volunteers Build the Internet

https://thereader.mitpress.mit.edu/from-linux-to-wikipedia-how-volunteers-build-the-internet/
4•jonbaer•19m ago•0 comments

Servo Browser Engine Continues Broadening Web Compatibility, New Features

https://www.phoronix.com/news/Servo-0.7-Changes
1•qtqtqt•22m ago•1 comments

Personality traits are less stable than people think

https://www.nature.com/articles/s44271-026-00515-7
1•rohanm93•22m ago•0 comments

OpenSSH flaw lets attackers log into password-disabled Linux accounts

https://www.bleepingcomputer.com/news/security/openssh-flaw-lets-attackers-log-into-password-disa...
1•Skyfall106•25m ago•1 comments

Lilithbrown

1•HackerNewslilit•28m ago•0 comments

Lab-grown meat was supposed to save the world. What happened?

https://www.theguardian.com/news/ng-interactive/2026/nov/05/lab-grown-meat-save-the-world-food-re...
2•andsoitis•30m ago•0 comments

18 Years of GOG – Anniversary Showcase

https://www.gog.com/en/anniversary
2•SockThief•30m ago•0 comments

Bomb threats disrupt at least 25 flights across Europe, raising hybrid war fears

https://www.theguardian.com/world/2026/nov/05/bomb-threats-disrupt-flights-across-europe-and-rene...
3•andsoitis•35m ago•0 comments

US FAA says it will phase out floppy disks from air traffic control by 2028

https://www.reuters.com/world/us/us-faa-says-it-will-phase-out-floppy-disks-air-traffic-control-b...
1•ChrisArchitect•36m ago•1 comments

Apple Watch Live Rewind and Siri Recap: Features and Limitations

https://memova.ai/journal/apple-watch-live-rewind-siri-recap/
1•ViolaWang•41m ago•0 comments

Running MicroPython on the Allwinner T527's XuanTie E906 RISC-V Core

http://allthingsembedded.blogspot.com/2026/10/micropython-on-e906.html
1•tcmichals•41m ago•0 comments

Silicon Valley's Bad Night

https://www.theatlantic.com/technology/2026/11/americans-really-dont-like-data-centers-elections/...
16•ent101•42m ago•10 comments

AI and the Future of the Product Role

https://www.svpg.com/ai-and-the-future-of-the-product-role/
1•swolpers•43m ago•0 comments

Are We Cooked? CMU Faculty on AI, Careers and Learning [video]

https://www.youtube.com/watch?v=U2DDKdUvq6k
1•lmc•43m ago•0 comments

Meta Warns Midterm Backlash Threatens AI Data Centers

https://epyhia.com/meta-warns-midterm-backlash-threatens-ai-data-centers-goldman-sees-45
3•arbuge•45m ago•0 comments

Letterboxd in Negotiations to Be Acquired by New York Times Company

https://variety.com/2026/digital/news/letterboxd-negotiations-new-york-times-1236940881/
2•cdrnsf•46m ago•0 comments

Move fast and don't break (safety critical) things

https://bscholl.substack.com/p/move-fast-and-dont-break-safety-critical
3•gmays•53m ago•1 comments

Claude Code, but for SEO

https://twitter.com/brodieseo/status/2118299596292305356
11•brodieclark•54m ago•2 comments

Queen's University Belfast students find Neptune's elusive Trojan asteroids

https://phys.org/news/2026-11-queen-university-belfast-students-neptune.html
1•Skyfall106•55m ago•0 comments

Native macOS storage monitor with an interactive disk explorer

https://github.com/nglippa/storage-checker
1•busterbuilds•56m ago•0 comments

DApp's Numbers, with the Working Shown

https://github.com/globalmpc/rwa-kit-js
4•A_Jblessing•1h ago•0 comments

Nvidia CEO called in by lawmakers over ties to alleged Chinese spy

https://www.axios.com/2026/11/05/jensen-huang-nvidia-congress-china
1•DGAP•1h ago•1 comments

What does LoRA specialized Muon optimizer even mean?

https://zrt.wtf/do-lora-optimizers-matter/
1•polymorph1sm•1h ago•0 comments

Vaucanson's Digesting Duck

https://www.atlasobscura.com/places/canard-digerateur-de-vaucanson-vaucansons-digesting-duck
4•gregsadetsky•1h ago•0 comments

Pwn.college

https://pwn.college/
18•tripdout•1h ago•1 comments

Show HN: NextGen WAF – Native Prolog Server and Rule System

https://prologwaf.site/
2•lokinpendawa•1h ago•0 comments