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?

The Redundancy of English (1951) [pdf]

http://medientheorie.com/doc/shannon_redundancy.pdf
1•aragonite•3m ago•0 comments

UK's rudest chalk figure gets a glow-up to stop it fading in the rain

https://www.bbc.com/news/articles/cpvppe84lnvo
1•gnabgib•5m ago•0 comments

The UI problem of AI coding agents

https://cate.cero-ai.com/blog/ui-problem-ai-coding-agents
2•Imbiss•5m ago•0 comments

Silenced Words

https://www.silencedwords.com/
1•Towaway69•6m ago•1 comments

China's Robotics Dream Began in 1972

https://www.chinatalk.media/p/chinas-father-of-robotics
1•momentmaker•7m ago•0 comments

Show HN: Find YC startups relevant to you

https://platoseed.com/
1•nerdlogic•9m ago•0 comments

Police in China Sure Love Smart Glasses

https://gizmodo.com/police-in-china-sure-love-smart-glasses-2000763598
3•gnabgib•9m ago•0 comments

Building Rust Procedural Macros from the Grounds Up

https://www.learnix-os.com/ch02-03-implementing-the-bitfields-proc-macro.html
1•Sagi21805•10m ago•1 comments

'Backrooms' Stuns with $81M Debut

https://variety.com/2026/film/box-office/backrooms-box-office-record-opening-weekend-obsession-ju...
3•mindcrime•11m ago•0 comments

Show HN: Fluiq – detect prompt injection, PII, Crescendo attack 2 line of Python

https://getfluiq.com/
1•SaurabhKumbhar•12m ago•0 comments

Show HN: CakeML-based self-verifying, self-improving system

https://emberian.github.io/svenvs/
2•cmrx64•14m ago•0 comments

Most Products Don't Need That Much Engineering

https://comuniq.xyz/post?t=1183
1•01-_-•16m ago•0 comments

Is that song AI-generated? UChicago scientists create tool to check

https://news.uchicago.edu/story/song-ai-generated-uchicago-scientists-create-browser-extension-check
4•paulpauper•16m ago•1 comments

I Tried to Sell My House with a Chatbot

https://www.nytimes.com/2026/05/28/technology/sell-house-with-ai-no-realtor.html
2•paulpauper•18m ago•0 comments

The Cost of More

https://jasperinsweden.substack.com/p/the-cost-of-more
1•imartin2k•19m ago•0 comments

Thiel's move signals billionaires seeking a 'plan B' abroad

https://www.businessinsider.com/peter-thiel-argentina-billionaire-moving-abroad-2026-5
3•e2e4•19m ago•2 comments

Show HN: Sports Regime Lab – NBA regime analytics

https://sports.kezelon.com/
1•optimalutopia•20m ago•0 comments

AI Slop Is a Choice

https://building138.com/ai-slop-is-a-choice
2•usernamed7•21m ago•0 comments

Atomdrift is open-source malware detection for the software supply chain

https://atomdrift.org/
1•campuscodi•22m ago•0 comments

The History of "Prisencolinensinainciusol"

https://dirkdeklein.net/2026/02/03/the-fascinating-history-of-prisencolinensinainciusol-the-nonse...
2•NaOH•25m ago•0 comments

There's Something Else We Should Be Worrying About

https://www.nytimes.com/2026/05/31/opinion/artificial-intelligence-public-good.html
2•paulpauper•25m ago•0 comments

Steam Deck sells out in North America within 24 hours of price hike

https://arstechnica.com/gaming/2026/05/despite-price-hike-steam-deck-is-already-sold-out-in-north...
14•frutiger•27m ago•2 comments

Recto: Open-source internal-linking and orphan-page auditor (Cloudflare)

https://github.com/eikiyo/recto
2•Eikiyo•28m ago•2 comments

Government Relations (2020)

https://about.usps.com/postal-bulletin/2020/pb22539/html/info_004.htm
2•Tomte•29m ago•0 comments

Netflix Wiz creates app to slash AI bills, then open sources it

https://www.theregister.com/ai-ml/2026/05/31/netflix-wiz-creates-app-to-slash-ai-bills-then-open-...
6•joebuckwilliams•30m ago•1 comments

The Authorization Paradox: Who Has the Keys to Your AI? [video]

https://www.youtube.com/watch?v=5UUpxgcGKXk
1•mooreds•32m ago•0 comments

San Francisco home accepts OpenAI, Anthropic stock as payment for $2.9M sale

https://cryptobriefing.com/san-francisco-home-accepts-ai-stock-payment/
1•petethomas•33m ago•0 comments

Phrases that need to die before I do

https://jerodsanto.net/2026/02/normalize-not-saying-this-stuff/
2•mooreds•33m ago•0 comments

Scaling Infrastructure as Code: 5 to 1k workspaces

https://www.ordisi.us/posts/2026_1_scaling/
2•mooreds•34m ago•0 comments

Rust Coreutils 0.9 Released with Additional Security Hardening, Zero-Copy I/O

https://www.phoronix.com/news/Rust-Coreutils-0.9
2•Bender•36m ago•0 comments