frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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?

Kinetic typography: the what, why, and how

https://www.linearity.io/blog/kinetic-typography/
1•argee•1m ago•0 comments

Symposia AI

https://www.trysymposiaai.com/landing
1•CarlosEdu•2m ago•1 comments

Solving CartPole in 8 Weights

https://cartpole.neocities.org/
1•georgehotz•3m ago•0 comments

Magical Realism: "Northern Exposure" 25 Years Later (2015)

https://www.rogerebert.com/streaming/magical-realism-nothern-exposure-25-years-later
1•walterbell•4m ago•0 comments

Show HN: Wyndup – share a live countdown with your podcast guest

https://wyndup.net
1•ardwino•8m ago•0 comments

Elastic Cloud on Kubernetes, simplified: zone awareness, restarts, and mTLS

https://www.elastic.co/search-labs/blog/elasticsearch-kubernetes-zone-awareness-restarts-mtls
1•eigenBasis•8m ago•0 comments

Jane Street's approach to AI adoption throughout their SDLC [video]

https://www.youtube.com/watch?v=rUYP4C29yCw
2•devdoshi•10m ago•1 comments

Brovan: Binary user-mode emulator for x86_64

https://github.com/AdvDebug/Brovan
1•AdvDebugy•11m ago•0 comments

WikiProject Editor Retention

https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Editor_Retention
1•sshh12•12m ago•0 comments

A Compression Tool for LLM Reads. Est. 60-95% Fewer Tokens

https://github.com/chopratejas/headroom
1•botacode•13m ago•0 comments

North America's largest commuter rail system faces a potential shutdown

https://apnews.com/article/lirr-new-york-commuter-rail-strike-union-eefab0d1f91470934fb89bd1809d0a94
2•petethomas•15m ago•1 comments

Random.website

https://random.website
2•npilk•16m ago•0 comments

Humanoid robots won't surprise us when they arrive

https://philipotoole.com/humanoid-robots-wont-surprise-us-when-they-appear/
2•otoolep•20m ago•0 comments

Thorchain halts trading after $10M cross-chain exploitRUNE token drops 12%

https://www.coindesk.com/tech/2026/05/15/thorchain-halts-trading-after-usd10-million-cross-chain-...
1•LUZUVYY•24m ago•0 comments

Engineer creates starwars inspired air bike

https://volonaut.com
1•nirkalimi•25m ago•0 comments

How to bypass Anti-Bots in 2026

https://roundproxies.com/blog/how-to-bypass-anti-bots/
2•majorchord•27m ago•0 comments

Python by Example Using Cloudflare Dynamic Workers

https://www.pythonbyexample.dev/
2•adewale•27m ago•1 comments

Lost in Translation: Text Message Spoofing via Email [pdf]

https://sumanthvrao.github.io/papers/rao-oakland-2026.pdf
3•yechs•28m ago•1 comments

New quantum algorithm solves "impossible" materials problem in seconds

https://www.sciencedaily.com/releases/2026/05/260512202355.htm
2•maxloh•28m ago•0 comments

What Is Rails-Way?

https://paweldabrowski.com/farewell-to-rails-way/what-is-rails-way
2•thunderbong•31m ago•0 comments

SpaceX targets June 11 IPO pricing, picks Nasdaq for historic market debut

https://www.coindesk.com/markets/2026/05/15/spacex-targets-june-11-ipo-pricing-picks-nasdaq-for-h...
1•LUZUVYY•31m ago•0 comments

Auto Rebaser v2 – browser-side GitHub PR housekeeping, now multi-account

https://github.com/bradygrapentine/auto-rebaser
1•bgrapentine•35m ago•0 comments

Legacy Update for Windows 8.1 for x64-based Systems

https://legacyupdate.net/download-center/download/51025/update-for-windows-8.1-x64-kb3132080
1•kristianp•36m ago•0 comments

NextEra and Dominion in talks over tie-up to create $400B US utility giant

https://giftarticle.ft.com/giftarticle/actions/redeem/7f0f2008-4160-45f9-8c93-80f8b4318669
3•alephnerd•39m ago•0 comments

Is China using fentanyl as a weapon against the United States?

https://en.unav.edu/web/global-affairs/esta-china-usando-el-fentanilo-como-arma-contra-estados-un...
5•Stevvo•44m ago•5 comments

China's unfinished buildings have created stranded assets with substantial costs

https://www.cell.com/one-earth/fulltext/S2590-3322(26)00050-3
2•littlexsparkee•45m ago•0 comments

Gaps in AI Development Closing 2.1B in Pain

https://news.novonavis.com/builders
1•capagg•49m ago•1 comments

Volkswagen Detects CI Server Tests and Ensures They Pass (2015)

https://github.com/auchenberg/volkswagen
3•birdculture•50m ago•0 comments

'No Way to Prevent This,' Says Only Package Manager Where This Regularly Happens

https://kevinpatel.xyz/posts/no-way-to-prevent-this/
15•alligatorplum•53m ago•1 comments

Picollo: Modern HDR histogram and PMU counters for .NET

https://hotforknowledge.com/2026/05/15/introducing-picollo/
1•buybackoff•53m ago•1 comments