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?

Two Mac apps, 69 sales, $530 in 23 days: where the buyers came from

https://shedi.app
2•otabekabdiraimo•10m ago•0 comments

Show HN: MyBox, Personal Digital Box

https://mybox.id
2•sonyarianto•10m ago•1 comments

Nvidia RTX Spark N1X Launch Overview: Nvidia Arms Windows

https://www.servethehome.com/nvidia-rtx-spark-n1x-launch-overview-nvidia-arms-windows/
2•ksec•12m ago•0 comments

Diego Poncelet sets downhill skateboarding world record at 151.83 km/h

https://www.redbull.com/ca-en/diego-poncelet-downhill-skateboard-world-record
2•cisc•13m ago•0 comments

UI-Te-Rangiora

https://en.wikipedia.org/wiki/Ui-te-Rangiora
2•benbreen•25m ago•0 comments

Dear Mathematicians

https://kennymouse.github.io/posts/dear-mathematicians.html
3•kennyslimber•27m ago•1 comments

One [Nix] store, two front ends

https://fzakaria.com/2026/10/17/one-store-two-frontends
2•ghuntley•28m ago•0 comments

Sorting Polar policies by pattern before choosing an Oso alternative

https://www.permit.io/blog/migrate-from-oso-to-permit
3•bitweis•29m ago•0 comments

ChessLit – free chess review companion

https://chromewebstore.google.com/detail/chesslit-free-chess-revie/molebigmaedodcdbopaeoelpepmjajmh
3•NubPlayz•30m ago•0 comments

OpenCode has a security breach last that impacted 1.4% of console users

https://twitter.com/opencode/status/2111519637049319818
4•notmine1337•32m ago•0 comments

Web Proxy

https://mozprox.io/
2•mozzinator•33m ago•0 comments

Abolish AI Manifesto (under construction)

https://abolish-ai.net/abolish-ai-a-manifesto/
3•classified•34m ago•0 comments

Parser Combinators

https://t3.at/blog/2026-10-17-parser-combinators/
1•schindlabua•34m ago•0 comments

Cinemas have been getting away with lies. Films should begin on time

https://www.theguardian.com/commentisfree/2026/oct/17/the-hill-i-will-die-on-cinemas-have-been-ge...
2•thunderbong•39m ago•0 comments

Show HN: Alley Cat Band – An Android rhythm game starring a punk band of cats

https://play.google.com/store/apps/details?id=net.mrlatte.alleycatband&hl=en
1•jongha•52m ago•0 comments

Librepaper – Free Collaborative Platform for HTML, LaTeX, Typst, MD, Quarto

https://github.com/LibrePaper/librepaper
2•the-mitr•52m ago•1 comments

Tech Journalist Robert X Cringely Has Died

https://www.hillandwood.com/obituaries/Mark-Stephens?obId=49806651
3•jnord•57m ago•0 comments

Show HN: A bored button with a timer that only runs while your phone lies still

https://atitb.com/en/bored
1•azure_raven•57m ago•0 comments

World of Warcraft, but it's Isometric 2D [video]

https://www.youtube.com/watch?v=MRD4Yi_bqJs
2•skibz•1h ago•0 comments

Florida woman uses Claude as her diary. The diary tipped off the FBI

https://maccus.fr/en/claude-diary-police-arrest/
3•MarcellusDrum•1h ago•0 comments

CVE-2026-111391 PoC?

https://www.patchcve.com/reference/cve/CVE-2026-111391
1•PatchCVE•1h ago•1 comments

Vibecession: More Than You Wanted to Know

https://www.astralcodexten.com/p/vibecession-much-more-than-you-wanted
1•harporoeder•1h ago•0 comments

Show HN: Connecting Captions Local Private AI Interpreter

https://local-host.ai/connectingCaptions/
1•chrisswimlee•1h ago•0 comments

Show HN: PG Manager – A free Android app for rooms, residents, and rent

https://play.google.com/store/apps/details?id=com.herhaven.women_pg&hl=en_US
1•bhattattreya•1h ago•0 comments

Negotiating Post-Quantum TLS Handshakes

https://amongbytes.com/posts/rfc-10024-negotiating-pq-tls-handshakes/
2•hdc•1h ago•0 comments

Dsaenf

1•RevisePulseAI•1h ago•0 comments

Can't bear to say goodbye to your pet? Biotech's got you covered

https://www.technologyreview.com/2026/10/16/1146766/pet-biotech-longevity-cloning-cryonics/
1•joozio•1h ago•0 comments

AgentBlackBox – a policy gate and tamper-evident audit log for AI agents

https://agent-blackbox-five.vercel.app/demo
1•sontoshbhn•1h ago•0 comments

Show HN: Fast, secure JSON Formatter with side-by-side JSON diffing

https://instantjsonformatter.com
4•UmangPawar•1h ago•2 comments

Single Propeller Drone

https://github.com/jyjblrd/single-propeller-drone
1•_kb•1h ago•2 comments