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

Securing AI Agents and MCP interactions at the network layer with Tailscale

https://www.businesswire.com/news/home/20260403439638/en/Highflame-and-Tailscale-Partner-to-Secur...
1•grumblemumble•42s ago•1 comments

LogMeIn – Instant Login Links, No Password Sharing

https://logmein.today
1•imkost•2m ago•0 comments

Corporate America Is Minting Money–and Not Just in Tech and Finance

https://www.wsj.com/business/earnings/corporate-america-is-minting-moneyand-not-just-in-tech-and-...
1•JumpCrisscross•6m ago•0 comments

Ketamine, psychedelics, GHB: is the US falling out of love with cocaine?

https://www.theguardian.com/us-news/2026/apr/21/cocaine-ketamine-psychedelics-ghb
1•JumpCrisscross•6m ago•0 comments

Chatting with myself about AI

https://2earth.github.io/website/20260426.html
1•2earth•8m ago•1 comments

Ask HN: Is anyone building/selling VT220-type terminals?

1•vrypan•8m ago•1 comments

Taiwan's stock market surpasses the UK's, thanks to AI

https://www.tomshardware.com/tech-industry/taiwan-stock-market-overtakes-the-uk
1•giuliomagnifico•8m ago•0 comments

TopCarPlay Wireless CarPlay

https://www.facebook.com/TopCarPlayWirelessCarPlay.Get
1•jerrycazer•8m ago•0 comments

China blocks Meta's acquisition of AI startup Manus

https://www.cnbc.com/2026/04/27/meta-manus-china-blocks-acquisition-ai-startup.html
1•yakkomajuri•9m ago•0 comments

LFM2.5-VL-450M: Structured Visual Intelligence, Edge to Cloud

https://www.liquid.ai/blog/lfm2-5-vl-450m
1•exploraz•10m ago•0 comments

Choo Choo Words: Spell words to make train tracks, stop the train from crashing

https://choochoowords.chyuang.com/
1•yongyongyong•11m ago•0 comments

Show HN: Webhook API – inbound email –> webhook

https://www.echovalue.dev/webhook-api/
2•emiliano•12m ago•0 comments

Show HN: A terminal spreadsheet editor with Vim keybindings

https://github.com/garritfra/cell
4•garritfra•13m ago•0 comments

Carbon nanotube wiring gets closer to competing with copper

https://arstechnica.com/science/2026/04/researchers-get-carbon-nanotube-wiring-to-conduct-more-li...
2•rbanffy•14m ago•0 comments

Gatekeeping: A Partial History of Cold Fusion

https://arxiv.org/abs/2601.09996
1•derrida•14m ago•0 comments

Show HN: I built a reference site for the recurring hard problems in software

https://thehardparts.dev/
2•ludovicianul•17m ago•0 comments

Show HN: Slerp.audio – VDJ with WebGL2 and real-time DSP

https://slerp.audio/
1•poshmosh•18m ago•0 comments

Show HN: TermToMD past in choppy terminal output get clean Markdown

https://termtomd.com/
1•dbuckman•21m ago•0 comments

Gallium oxide electronics withstand extreme cold

https://discovery.kaust.edu.sa/en/article/26858/gallium-oxide-electronics-withstand-extreme-cold/
1•giuliomagnifico•21m ago•0 comments

In which Lisp generates music

https://abhirag.com/fennel-pattrns-renoise
2•abhirag•22m ago•1 comments

Entire NSF science advisory board fired by Trump administration

https://www.nature.com/articles/d41586-026-01361-7
2•beardyw•24m ago•0 comments

Isaac-Flath/Agentkb

https://github.com/isaac-flath/agentkb
1•ankitg12•24m ago•0 comments

Kinetic Displays

https://theartistbreakfast.com/
1•dsalzman•24m ago•0 comments

OpenVPN 2.7 security audit: 18 findings, one critical bug

https://srlabs.de/blog/openvpn-audit
1•MaKey•27m ago•0 comments

"48 agents thinking in one window"

https://www.threads.com/@zane___chen/post/DXndj0NAWgC
1•zane__chen•27m ago•0 comments

Carl Sagan on Military Spending and Climate Change [video]

https://www.youtube.com/watch?v=4C6co5qXEE4
1•thelastgallon•28m ago•0 comments

Electricity Provider Comparison Tool

https://elemetric.comtom.engineering/
1•comtom•31m ago•0 comments

PAuth – Precise Task-Scoped Authorization for Agents

https://arxiv.org/abs/2603.17170
1•reshabh•32m ago•0 comments

Qdrant Cluster Dashboard – Chrome Extension

https://chromewebstore.google.com/detail/qdrant-cluster-dashboard/fjhpmielkipfghonlmpjogabpfompahp
1•kulekci•32m ago•0 comments

Robinhood mass phishing incident – April 2026

https://www.reddit.com/r/RobinhoodApp/s/0c2qJaAJbW
2•yesimahuman•33m ago•0 comments