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?

I failed every LeetCode interview

https://write.as/m5g5r26qo5wt7
1•garn810•3m ago•1 comments

Veritas Villages – libertarian intentional communities in Latin America

https://gst.artofliberty.org/veritas-villages-libertarian-intentional-communities-in-latin-america/
1•mateusfreira•3m ago•1 comments

OpenAI found a critical flaw in Brotli (used by Node.js, Bun and Envoy)

https://twitter.com/OpenAI/status/2113766354386084338
1•shenli3514•8m ago•0 comments

Blue Planet III features cloudier footage to prove authenticity amid AI boom

https://www.theguardian.com/media/2026/oct/24/blue-planet-iii-cloudier-footage-prove-authenticity...
1•rdmuser•9m ago•0 comments

Roadie: Classic WinAmp on macOS with Music Assistant

https://roadie.sstools.co/
1•smallsharptools•11m ago•1 comments

Why AIs Can't Read?

https://blog.vladi.dev/en/articles/por-que-ias-nao-podem-ler.html
1•vdietrich•13m ago•0 comments

Show HN: OpenZPL. Render Zebra ZPL Labels to PNG/PDF, Drop-In for Labelary

https://openzpl.com/
1•lou_alcala•17m ago•0 comments

If Intelligence Is Getting Cheap, What Remains Expensive?

https://twitter.com/prathiknaidu/status/2112928049935118493
1•gmays•18m ago•0 comments

Claude Code will refuse to fill in passwords or use a password manager

https://github.com/anthropics/claude-code/issues/65358
2•txomon•22m ago•0 comments

NASA updates lander plans for Moon landings

https://arstechnica.com/space/2026/10/nasa-updates-lander-plans-for-moon-landings-finally-solves-...
1•sandyarmstrong•23m ago•1 comments

Soma – memory and proofs for AI agents, measured not asserted

https://github.com/mrpkk/soma-protocol
1•vnutrivas•24m ago•0 comments

Evolving Threat: http2shell is an RCE in node, Python, and more

https://nitter.click/AikidoSecurity/status/2113759110625906950?__galadriel=lPmlGl9id4oAd5UeBwMhlY...
3•cowlevel•25m ago•1 comments

Netomi

https://www.netomi.com/
1•handfuloflight•25m ago•0 comments

I built an alternative to Raindrop and Pocket

https://github.com/bookmarkforge/bookmarkforge-core
1•bookmarkforge•26m ago•0 comments

Show HN: Gasfree.app a Rack of Synthetizers in the Browser

https://gasfree.app/
1•tamat•27m ago•0 comments

Peregrine Fil-C: Actually Portable Memory Safe Executables

https://fil-c.org/peregrine
3•davikr•31m ago•0 comments

Expose only share links of a private service with caddy

https://dataswamp.org/~solene/2026-10-21-caddy-forward-auth-public-share-links.html
1•birdculture•31m ago•0 comments

UK "Be Ready" Campaign: Prepare for Emergencies (and Cyber Attack)

https://beready.campaign.gov.uk/
3•edferoci•31m ago•1 comments

iPhone Duo Owners Report Screens Breaking Along the Hinge

https://www.macrumors.com/2026/10/23/iphone-duo-screen-cracks/
5•dabinat•32m ago•2 comments

Using AI to clean your smart TV

https://github.com/Gathin23/cleanyourtv
1•jiggawatts•38m ago•0 comments

Show HN: AI Crash Debugging Gauntlet

https://www.forensicdbg.com/post/forensicdbg-s-ai-crash-debugging-gauntlet
1•blobdole•44m ago•0 comments

New playground to track your Azure Cloud Consumption

https://contextpilot.org/
1•msousa202•44m ago•1 comments

AgentProbe – test AI agents by making the systems around them fail

https://sampact.com/
1•SamvidK•45m ago•1 comments

Calibration, accuracy, variation across forecasts from prediction platforms

https://www.pnas.org/doi/10.1073/pnas.2615627123
1•7777777phil•48m ago•0 comments

Kurt Vonnegut envelope quote fact check

https://www.snopes.com/fact-check/kurt-vonnegut-envelope-quote/
2•inatreecrown2•50m ago•1 comments

Pg_stat_ch: Postgres extension to export query telemetry to open telemetry

https://github.com/ClickHouse/pg_stat_ch
1•saisrirampur•57m ago•0 comments

I paired seven months of coding-agent transcripts with a token inventory

https://morkeeth.substack.com/p/where-the-tokens-go-the-end-of-maxxing
1•Oscalemor•57m ago•0 comments

Multi-booting Windows 1.01 to Windows 10 on a non-Intel/AMD laptop

https://reddit.com/comments/1xdld4n/
1•thunderbong•1h ago•0 comments

I built a harness so I can watch Claude edit my videos live

https://agentcut.synteq.app
1•vlachomir•1h ago•0 comments

Show HN: I gamified my daily GitHub commits with a growing garden

https://commitgarden.app
1•kornelhal•1h ago•1 comments