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?

LLM Model-Swapping Trick Can Expose AI Reasoning Traces

https://ai-updates.net/model-swapping-exposes-ai-reasoning-traces/
1•ashurandi•1m ago•0 comments

Plug and Pwn: physical zero-click chain

https://plugandpwn.com/
1•882542F3884314B•6m ago•0 comments

TSMC Sales Jump 45% YoY on Strong AI Chip Demand but Investors Shrug

https://www.investors.com/news/technology/tsm-stock-tsmc-july-sales-sox-index/
2•Jimmc414•7m ago•0 comments

University of Michigan to switch to pass/fail grades for first-semester students

https://www.theguardian.com/us-news/2026/aug/11/university-of-michigan-pass-fail-grading-system
2•bookofjoe•8m ago•3 comments

Show HN: I made an MCP server that checks 172 cloud and SaaS status feeds

https://outagedeck.com/developers/mcp
1•koko3tallah•8m ago•0 comments

Unauthenticated Root Access to the Enphase IQ Gateway

https://j027.net/enphase-rce/
2•j027•8m ago•0 comments

My retrieval can't tell a question it can answer from one it can't

https://github.com/asanabrial/leteo/blob/main/docs/nothing-worth-tuning.md
1•asanabrial•9m ago•0 comments

Coinbase stopped using trading volume as a key metric after 38%/48% decrease

https://hachyderm.io/@molly0xfff/117079279583581292
3•u1hcw9nx•12m ago•1 comments

How to Self-Host n8n on a VPS in 2026

https://veerhost.com/how-to-self-host-n8n-on-a-vps/
5•betterornotss•12m ago•0 comments

Is 99.9x% cache hit always better?

1•ozer_23•12m ago•0 comments

Tales of the Autistic Developer – Bringing It into Focus

https://baweaver.com/writing/2026/08/10/tales-of-the-autistic-developer-bringing-it-into-focus/
3•mooreds•14m ago•0 comments

LLM Inference lecture series [video]

https://www.youtube.com/watch?v=Yf51-__QeN8&list=PL5vCjAyS9QP_Pze76CYAlidc0hpdTXFLV
1•bobrenjc93•15m ago•0 comments

Auger load test, scan and inspect HTTP from one rust binary

https://github.com/user123cy/auger
1•user123cy•19m ago•0 comments

SEC exempts certain data center bonds from key securitization rules

https://www.reuters.com/legal/government/us-sec-exempts-certain-data-center-bonds-key-securitizat...
5•vinyl7•20m ago•0 comments

The renter-owner wealth gap is wider than ever, as many are priced out of buying

https://text.npr.org/nx-s1-5910711
4•mooreds•22m ago•1 comments

AI vibe coded game projects suck

https://asecretarea.com/2026/08/10/ai-vibe-coded-game-projects-suck/
2•spicyjpeg•22m ago•0 comments

Predictions for the Era of Continual Learning

https://www.dwarkesh.com/p/era-of-continual-learning
1•in-silico•23m ago•0 comments

A Simple Answer to AI Job Loss: Tax Capital, Not Labor

https://www.wsj.com/tech/ai/a-simple-answer-to-ai-job-loss-tax-capital-not-labor-cb900e62
2•mooreds•23m ago•1 comments

Flight Is Canceled After a Child Refuses to Be Seated

https://www.nytimes.com/2026/08/09/travel/flight-canceled-child-seatbelt-porter-canada.html
4•whack•25m ago•0 comments

Threads Is Now Available as a Native VR App on Meta Quest

https://www.meta.com/blog/threads-is-now-available-as-a-native-vr-app-on-meta-quest/
1•allenc•25m ago•0 comments

Show HN: Quantum Foosball

https://polkerty.github.io/quantumfoosball/
1•tibbar•28m ago•0 comments

Anthropic Posts 'How Claude Marks AI-Generated Content' Without Explaining How

https://daringfireball.net/linked/2026/08/11/anthropic-claude-watermarks
2•nozzlegear•28m ago•0 comments

Is A.I. A Massive Lie?

https://www.youtube.com/watch?v=4xztOygLnNk
1•root-parent•29m ago•0 comments

Help me build a better bot blocker

1•nerdralph•34m ago•0 comments

People and Clothes

https://www.autodidacts.io/people-and-clothes/
1•Curiositry•34m ago•0 comments

Claudish to English

https://github.com/gvzdv/claudish-to-english
2•bryan0•35m ago•1 comments

The Oval Office: ET's, UAP's and Disclosure – Bigelow Podcast Ep. 1 [video]

https://www.youtube.com/watch?v=TNRb0GJXmS8
1•avonmach•36m ago•0 comments

Aristotle's Physics: A Physicist's Look

https://arxiv.org/abs/1312.4057
1•lordleft•36m ago•0 comments

The Last Generation of Mathematicians

https://www.youtube.com/watch?v=6uIJdXmB4vE
1•root-parent•38m ago•0 comments

Issue Has Been Resolved

https://robss2020.github.io/sol-vnc-elapsed/
1•logicallee•39m ago•3 comments