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?

Chip Can Hear What Key You Pressed

https://www.youtube.com/watch?v=dbXCghmnyEs
1•hasheddan•1m ago•0 comments

Awe Radio, free 24/7 internet radio stations for anyone

https://aweradio.app/
1•vbst•3m ago•0 comments

How A Private Equity Group Drove an Apartment Complex into the Ground

https://www.nytimes.com/2026/08/28/nyregion/nob-hill-private-equity-fire.html
3•ceejayoz•6m ago•0 comments

A Great Rebalancing Is Coming

https://www.foreignaffairs.com/united-states/great-rebalancing-coming
2•toomuchtodo•9m ago•0 comments

I built a headless browser for AI agents in Rust. no Chromium, no V8

https://www.reddit.com/r/codex/comments/1w0trw7/i_built_a_headless_browser_for_ai_agents_entirely/
2•syumei•9m ago•0 comments

Claude Status – Degraded Performance for Claude Opus 5 and Claude Haiku 4.5

https://status.claude.com/incidents/hkcw95k7r0f4
2•kyisaiah47•10m ago•0 comments

Quanta.Ai.Code.Editor

https://github.com/ContegoCode/Quanta-Code-Editor
1•Quantaai•26m ago•3 comments

Show HN: NodeAkt – Zero-dependency distributed actor framework for TypeScript

https://tochemey.github.io/nodeakt/
1•Tochemey•34m ago•0 comments

Long March 6C rocket stage fragments in orbit, creating cloud of debris

https://spacenews.com/long-march-6c-rocket-stage-fragments-in-orbit-creating-cloud-of-debris/
2•bookmtn•35m ago•0 comments

Does the Sumerian King List Align with Paleoclimate Events?

https://www.vectorian.be/articles/2026-06-07/sumerian-king-list-paleoclimate-alignment-explorer/
12•dev_l1x_be•36m ago•2 comments

I spent years running prod-like homelabs. Here's what I learned about securing

https://www.amazon.ca/Homelab-Security-Blueprint-Building-Production-Grade-ebook/dp/B0GX2WLP51
1•sargetun•39m ago•0 comments

Does Computer Science Need Computers?

https://www.quantamagazine.org/does-computer-science-need-computers-20260828/
2•pykello•40m ago•0 comments

PPWR lands another blow to an precarious tabletop industry

https://www.rascal.news/ppwr-lands-another-blow-to-an-already-precarious-tabletop-industry/
2•healsdata•41m ago•0 comments

9th Circuit sides with states in Kalshi gambling fight

https://azmirror.com/2026/08/28/9th-circuit-sides-with-states-in-kalshi-gambling-fight-potentiall...
2•hungryhobbit•50m ago•1 comments

Anthropic Just Beat The Pentagon in Court

https://www.ibtimes.com/anthropic-just-beat-pentagon-court-judge-said-national-security-was-used-...
10•01-_-•50m ago•0 comments

Young adults under 21 traded $5B on Kalshi this year

https://www.cnn.com/2026/08/28/business/young-adults-trading-kalshi
4•01-_-•52m ago•2 comments

Steps Towards an Ecology of the Internet

https://anil.recoil.org/slides/2025-internet-ecology.html
1•luispa•52m ago•1 comments

X reveals foreign adversary behind fake accounts disseminating anti-data center

https://www.foxbusiness.com/fox-news-tech/x-reveals-foreign-adversary-behind-fake-accounts-dissem...
3•newsomix9xl•53m ago•2 comments

Roundup of September 2026 Bootstrapper Events

https://bootstrappersbreakfast.com/2026/08/27/roundup-of-september-2026-bootstrapper-events/
1•skmurphy•54m ago•1 comments

I accidentally turned LLM memory into program analysis

https://pwning.systems/posts/llm-memory-program-analysis/
3•matt_d•54m ago•1 comments

Zero-Cost 'Tagless Final' in Rust with GADT-Style Enums

https://inferara.com/blog/rust-tagless-final-gadt/
1•birdculture•55m ago•0 comments

PostgreSQL system catalog changes across versions

https://richyen.com/pg-catalog-almanac/
1•qianli_cs•1h ago•0 comments

LuaDB – A pure Lua RDBMS engine with B+Trees, WAL, and Postgres wire proto

https://github.com/jncastilho/luadb
1•COLD_WAR•1h ago•0 comments

Show HN: Substack and X and Reddit and Crypto = POW

https://www.proofofwriting.com/
1•caincurrency•1h ago•0 comments

The invisible labour behind 'intelligent' machines

https://theloop.ecpr.eu/the-invisible-labour-behind-intelligent-machines/
1•cdrnsf•1h ago•0 comments

Prop trading firms – the alternative and the reality

https://forexmechanics.com/choosing-broker/prop-trading/
1•wazka•1h ago•1 comments

Shortlinks

https://cailinpitt.com/blog/2026/8/28/shortlinks
1•classictraffic•1h ago•0 comments

Bigscreen Beyond 2 – the smallest VR headset

https://bigscreenvr.com/
1•bpierre•1h ago•0 comments

Now Hiring: Senior Open Source Maintainer

https://nesbitt.io/2026/08/28/now-hiring-senior-open-source-maintainer.html
1•metrofun•1h ago•0 comments

Cassius Marcellus Coolidge Gallery

https://www.dogsplayingpoker.org/gallery/coolidge/
2•billwirn•1h ago•0 comments