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?

Why Companies Are Quietly Rehiring Software Engineers [video]

https://www.youtube.com/watch?v=JkHXyd652k8
3•gisbird•3m ago•0 comments

Behind AI's call for independent reviews, a fight over what gets made public

https://www.reuters.com/world/behind-ai-industrys-call-independent-reviews-fight-over-what-gets-m...
2•thm•3m ago•0 comments

How to Investigate an Agent Incident End to End with ZizkaDB

https://medium.com/@MirArshadTalpur/how-to-investigate-an-agent-incident-end-to-end-with-zizkadb-...
2•Arshad-Talpur•4m ago•0 comments

Show HN: Pure State Compile – one requirement sentence to C, C++ or Ada source

https://compile.purestatelabs.com/#try
2•purestatelabs•4m ago•0 comments

Marc Andreessen reveals why housing, health care, and edu getting more expensive

https://twitter.com/jaynitx/status/2109957970591412722
2•bilsbie•4m ago•0 comments

BB(10) > Graham's Number

https://github.com/jeff87654/busy-beaver/blob/main/BB10/1RB0RA_1LC1LF_1RD0LB_1RA1LE_1LI0LC_0RG1LD...
3•surprisetalk•7m ago•0 comments

Who lost my lap infant?

https://jtibs.substack.com/p/who-lost-my-lap-infant
2•sanj•7m ago•0 comments

Fine-tuned Llama 3.1 8B vs. Claude Sonnet 5 on 437 legal clauses

https://reopenly.com/blog/small-model-specific-job/
1•dayoff•7m ago•0 comments

Show HN: MemorySync – Memory for AI Agents

https://memorysync.io/try
1•mohd_rafay•11m ago•0 comments

Show HN: Link and visualise places in your notes with Markdown and wikilinks

https://blog.etherpk.com/etherpk-maps-in-your-notes-visualise-the-places-that-matter
1•gb2d_hn•12m ago•0 comments

It took me nine years to hack my Xbox 360

https://kennedn.com/blog/posts/glitching/
1•kennedn•13m ago•0 comments

SubQ Snap – First Long-Context Decision Model for Real Enterprise Work

https://subq.ai
1•epaga•14m ago•0 comments

Show HN: A Simple Programming Language in the Spirit of Old Home Computer Basic

https://easylang.online/ide/
1•chrka•14m ago•0 comments

Apple Unveils Immersive Horror Film Coming Exclusively to Vision Pro

https://www.macrumors.com/2026/10/13/apple-unveils-vision-pro-immersive-horror-film/
2•ndr42•14m ago•0 comments

Who killed people on Kyiv's Maidan on February 20, 2014 – Claude's analysis

https://maidan-2014.github.io
2•uchum_t•15m ago•0 comments

Show HN: Replaced files and shift+Deleted files recovered while monitoring

https://github.com/greatPHPer/AlgoLassi-FileRecovery-Releases/releases/tag/v1.0.0
1•noobplus•16m ago•1 comments

Wanted to download an ISO, ended up writing a kernel exploit

https://blog.dfb.sh/blog/eap770-root-for-two-zeros/
2•0xdeafbeef•17m ago•0 comments

What's on That Access Port?

https://danielmangum.com/posts/whats-on-that-access-port/
1•hasheddan•19m ago•0 comments

R and Python and the Holy Grail

https://miketalbot.io/blog/posts/2026-10-04-r-and-python-with-positron/
1•speckx•19m ago•0 comments

Apple's Minions: A virtual GPU cloud built from idle Apple Silicon Macs

https://machinelearning.apple.com/research/distributed-gpu-cloud
2•acossta•20m ago•0 comments

Elissa AI

https://github.com/inginddie/elissa
1•inginddie•21m ago•0 comments

The Lord's Prayer in Coptic (final stage of Egyptian language pre-Arabic)

https://www.youtube.com/watch?v=aoHxMxXXKyI
1•KoftaBob•21m ago•0 comments

Qwen3.8-Omni: Towards Native Omni-Modal Agents

https://arxiv.org/abs/2609.25611
3•teleforce•22m ago•0 comments

Did Anthropic Just Lose Its Biggest Customer?

https://www.vincentschmalbach.com/did-anthropic-just-lose-its-biggest-customer/
1•vincent_s•22m ago•0 comments

Worlds More Habitable Than Earth? They're Out There

https://www.nytimes.com/2026/10/13/science/inhabitable-planets-solar-system.html
2•cainxinth•23m ago•0 comments

Curated YouTube Playlists for Search Fundamentals and Technical SEO

https://developers.google.com/search/blog/2026/10/seo-learning-paths
2•digitalmayurbha•23m ago•0 comments

Why AI companies are paying a premium to go off the grid and what this costs us

https://energyathaas.wordpress.com/2026/10/05/buying-time-burning-gas/
2•ck2•24m ago•1 comments

Show HN: I built a 100% declarative WAF. Try to hack it for research

https://prologwaf.site/
1•lokinpendawa•25m ago•1 comments

Legacy Carmakers Seen Losing Mass Market to Chinese Rivals

https://www.bloomberg.com/news/articles/2026-10-13/legacy-carmakers-seen-losing-mass-market-to-ch...
2•toomuchtodo•25m ago•2 comments

Formula 1 returns to Africa with 10-year agreement to race in Rwanda

https://www.formula1.com/en/latest/article/formula-1-returns-to-africa-with-10-year-agreement-to-...
1•tosh•25m ago•0 comments