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•6mo 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•6mo 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•6mo 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•6mo 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•6mo ago
Load test against a clone instead of a DB whose contents you care about?

Civic Nationalism

https://en.wikipedia.org/wiki/Civic_nationalism
1•CGMthrowaway•6m ago•0 comments

The economics of Pantone and its colours

https://finshots.in/archive/the-economics-of-pantone-color-of-the-year-cloud-dancer/
1•vismit2000•9m ago•0 comments

November CVEs Fell 25% YoY, Driven by Slowdowns at Major CNAs

https://socket.dev/blog/november-cves-fell-25-yoy-driven-by-slowdowns-at-major-cnas
1•feross•10m ago•0 comments

Reverse Benchmarking

https://www.dominiknitsch.com/reverse-benchmarking/
1•wseqyrku•18m ago•0 comments

On the trail of Borneo's bay cat, one of the most mysterious felines

https://news.mongabay.com/2024/04/on-the-trail-of-borneos-bay-cat-one-of-the-worlds-most-mysterio...
1•thunderbong•23m ago•0 comments

Intellivision Sprint by Atari

https://atari.com/products/intellivision-sprint
2•evo_9•24m ago•0 comments

QtkTest: Go-To Human Benchmark Tool

https://qtktest.com/
1•yimiqidage001•30m ago•0 comments

Patents and Open Source: Understanding the Risks and Available Solutions

https://opensource.org/blog/patents-and-open-source-understanding-the-risks-and-available-solutio...
1•gslin•39m ago•0 comments

How to speed up the Rust compiler in December 2025

https://nnethercote.github.io/2025/12/05/how-to-speed-up-the-rust-compiler-in-december-2025.html
2•todsacerdoti•42m ago•0 comments

What I Learned from Vibe-Coding Auth with AI

https://fusionauth.io/blog/vibe-coding-authentication
1•mooreds•45m ago•0 comments

Trustworthy software through non-profits?

https://www.more-magic.net/posts/trustworthy-software-through-non-profits.html
1•sjamaan•45m ago•0 comments

Show HN: Who is hiring" search tool with chat / other features

https://nthesis.ai/public/hn-who-is-hiring
2•osigurdson•46m ago•0 comments

Speed vs. Safety: Building developer experience in a MedTech startup

https://bradleybeddoes.com/posts/building-developer-experience-in-medtech
1•vedlin•50m ago•0 comments

Walks in Rotation Spaces Return Home When Doubled and Scaled

https://arxiv.org/abs/2502.14367
1•nomilk•52m ago•1 comments

Craft Food Recipes

https://craftfoodrecipes.com/recipes
1•fastshort•54m ago•1 comments

LLM inference is nearly deterministic. We use this to audit providers

https://adamkarvonen.github.io/machine_learning/2025/11/28/difr.html
1•seraine•54m ago•0 comments

A space program can only move as swiftly as its rockets

https://jatan.space/indian-space-issue-33/
1•Brajeshwar•54m ago•0 comments

State Department to deny visas to fact checkers and others, citing 'censorship'

https://www.npr.org/2025/12/04/nx-s1-5633444/trump-content-moderation-visas-censorship
22•seattle_spring•57m ago•5 comments

Show HN: A Self-Evolving Agentic App Builder (Seeking 300 Beta Testers)

https://howone.ai/?invite=CD0AP6
2•EvoAgentX•58m ago•0 comments

Tim Pool on a Possible Magnetic Pole Shift Citing Multiple Signs [video]

https://www.youtube.com/watch?v=1lnwSEdxlhI
1•keepamovin•1h ago•3 comments

Starlink Mobile? SpaceX Trademark Filing Hints at Cellular Carrier Ambitions

https://www.pcmag.com/news/starlink-mobile-spacex-trademark-filing-hints-at-cellular-carrier-ambi...
1•TMWNN•1h ago•0 comments

Show HN: Personalized wine recommendations from a wine list

https://apps.apple.com/us/app/sip-savvy/id6747541871
1•zyncl19•1h ago•0 comments

Build Systems Are Spreadsheets

https://functional.computer/blog/build-systems-are-spreadsheets
1•judicious•1h ago•0 comments

Why Sourcegraph and Amp Are Becoming Independent Companies

https://sourcegraph.com/blog/why-sourcegraph-and-amp-are-becoming-independent-companies
2•amirathi•1h ago•0 comments

Nvidia CEO Jensen Huang admits he works 7 days a week, in a constant anxiety

https://fortune.com/2025/12/04/nvidia-ceo-admits-he-works-7-days-a-week-including-holidays-in-a-c...
2•wslh•1h ago•0 comments

T-17 Carbon Telephone Transmitter Button Mod and HodgePodge

http://k4che.com/T-17/T-17.htm
1•brudgers•1h ago•0 comments

Show HN: Driving Android app via LLM. Looking for feedback

1•philippb•1h ago•0 comments

What do you think of my landing Page designed in Canva

https://createamarketplace.com/
1•cladian•1h ago•3 comments

Netflix in exclusive talks to buy HBO

https://www.cnn.com/2025/12/04/media/netflix-paramount-wbd-bidding-war-warner-bros-discovery
17•mikeweiss•1h ago•9 comments

A Golden Year (2025): Gold's Price Surge – The Signal in the Noise

https://aswathdamodaran.blogspot.com/2025/11/a-golden-year-2025-golds-price-surge.html
1•kamaraju•1h ago•0 comments