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?

Amazon Vinyl, a TypeScript streaming engine for HTML5 media

https://amazonmusic.github.io/vinyl/
1•nbilyk•5m ago•0 comments

Pre-Modern Armies for Worldbuilders, Part I: Why They Fight

https://acoup.blog/2026/06/05/collections-pre-modern-armies-for-worldbuilders-part-i-why-they-fight/
1•gostsamo•11m ago•0 comments

Claude-tinderbox: Search your Claude.ai conversation history locally via MCP

https://github.com/luckyrmp/tinderbox-archive
1•songwavepst•13m ago•0 comments

Bitcoin's star fades, as investors flock to lustre of AI and megacap IPOs

https://www.reuters.com/business/finance/bitcoins-star-fades-investors-flock-lustre-ai-megacap-ip...
2•1vuio0pswjnm7•15m ago•0 comments

Central Ohio Becomes Hub for Tech and Manufacturing

https://www.nytimes.com/2026/06/05/business/ohio-tech-manufacturing-hub.html
1•saikatsg•15m ago•0 comments

Language models transmit behavioural traits through hidden signals in data

https://www.nature.com/articles/s41586-026-10319-8
1•bushwart•16m ago•0 comments

Lockdown Mode

https://help.openai.com/en/articles/20001061-lockdown-mode
8•berlianta•17m ago•3 comments

Ubuntu 26.10 to Begin Laying Foundation for Context-Aware Desktop

https://www.phoronix.com/news/Ubuntu-26.10-Desktop-Features
2•dabinat•18m ago•0 comments

Show HN: Nimbril – 12 file tools that never upload (airplane-mode test)

https://nimbril.com
1•yapancha•18m ago•0 comments

Bitcoin cracks $60k, sinking to lowest level since October 2024

https://www.cnbc.com/2026/06/05/bitcoin-dismal-week-price-below-all-time-high-crypto-investors.html
2•1vuio0pswjnm7•21m ago•0 comments

MIT's Dr Fink got Sakharov Prize for defending human rights of scientists in US

https://www.aps.org/funding-recognition/prize/andrei-sakharov
1•osnium123•21m ago•1 comments

Costco sells such cheap gas

https://www.cnn.com/2026/05/31/business/costco-cheap-gas
3•Bender•24m ago•0 comments

Yet another Cisco SD-WAN 0-day under attack, and no patch in sight

https://www.theregister.com/security/2026/06/05/yet-another-cisco-sd-wan-0-day-under-attack-and-n...
2•Bender•25m ago•0 comments

C++: The Programming Language back cover raises questions not answered by front

https://devblogs.microsoft.com/oldnewthing/20260605-01/?p=112391
2•paulmooreparks•29m ago•0 comments

Quest 3 Accessory Turns Brain Activity into VR Avatar Control

https://roadtovr.com/quest-accessory-bci-brain-activity-avatar-control/
2•LorenDB•32m ago•0 comments

I turned a $59 Android phone into a self-healing cloud engine (Axiom SDK)

https://github.com/liberatedai-ui/axiom-sdk-wrapper
1•liberatedai•33m ago•0 comments

Scarcity is driving AI innovation outside Silicon Valley

https://restofworld.org/2026/scarcity-is-driving-ai-innovation-outside-silicon-valley/
2•i7l•38m ago•0 comments

The Fix for AI's Spending Problem Is Not Good for OpenAI and Anthropic [video]

https://www.youtube.com/watch?v=w1yB7ck36JA
1•mgh2•41m ago•0 comments

Starling – Managed-first .NET web browser engine, built from primitives

https://starlingbrowser.com
2•bj-rn•46m ago•0 comments

Show HN: NEP – Ethereum JSON-RPC transform that beats ZSTD by 12%

https://github.com/Louw115/nep-ethereum-compression
1•LBWasserman•52m ago•1 comments

The Future of Film May Just Be Old Movies (2024)

https://www.theringer.com/2024/10/23/movies/repertory-revival-cinema-old-movie-screenings-vidiots...
1•cocacola1•56m ago•0 comments

Thinking more about Netscape Time

https://thehistoryoftheweb.com/thinking-more-about-netscape-time/
1•Brajeshwar•59m ago•0 comments

The Stochastically K Shaped Job Market

https://www.williamangel.net/blog/2026/06/05/the-stochastically-k-shaped-engineering-job-market.html
1•datadrivenangel•1h ago•1 comments

Silicon Valley's Secretive, Orgiastic Dark Side (2018)

https://www.vanityfair.com/news/2018/01/brotopia-silicon-valley-secretive-orgiastic-inner-sanctum
2•mgh2•1h ago•0 comments

Getting silly with C, part and((int*)1)[-1]

https://lcamtuf.substack.com/p/getting-silly-with-c-part-and-int1
3•surprisetalk•1h ago•0 comments

Show HN: Backup Your Perplexity Research to Markdown and Obsidian

https://chatgpt2notion.com/products/perplexity-to-obsidian/
1•chatgpt2notion•1h ago•0 comments

Show HN: Zedra – Mobile control plane for AI coding agents

1•tanlethanh•1h ago•1 comments

Ask HN: Why is the HN crowd so anti-AI?

18•Ekami•1h ago•30 comments

Definitive guide for creating skill.md for your tools

https://docsalot.dev/blog/what-is-skill-md
1•fazkan•1h ago•0 comments

Agent-ML-skills – Teach Codex/Claude/Cursor to stop making ML mistakes

https://github.com/param087/agent-ml-skills
1•param087•1h ago•0 comments