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?

Developing Trustworthy Information

https://jessicacanepa.com/blog/developing-trustworthy-information/
1•mooreds•2m ago•0 comments

YC as a Service

https://ycaas.lol
1•ipostragebait•2m ago•0 comments

Firefox Has Integrated Brave's Adblock Engine

https://itsfoss.com/news/firefox-ships-brave-adblock-engine/
2•nreece•5m ago•0 comments

Translinear Circuits as EML Natural Physical Substrate

https://zenodo.org/records/19749753
2•iranssantos•5m ago•1 comments

The Tail End (2015)

https://waitbutwhy.com/2015/12/the-tail-end.html
1•RyanShook•11m ago•0 comments

ZCAM: iOS camera app that cryptographically proves human authorship

https://zcam.succinct.xyz/
1•GZGavinZhao•11m ago•1 comments

Rippling exposed your SSN/banking to anyone who sent you an offer letter

https://infosec.exchange/@SecureOwl/116415101610028363
2•noiobeforebed•18m ago•0 comments

Useknockout – open-source background removal API, 40× cheaper than remove.bg

https://github.com/useknockout/api
2•tlorents•18m ago•0 comments

SF Giants sell piece of team to venture capital firm run by Joshua Kushner

https://www.sfgate.com/giants/article/sf-giants-joshua-kushner-22224927.php
1•iancmceachern•24m ago•0 comments

DevResolve – AI chat widget that answers technical questions from your docs

https://devresolve.ai
1•EthanWayne•25m ago•0 comments

Open source memory layer so any AI agent can do what Claude.ai and ChatGPT do

https://alash3al.github.io/stash?_v01
2•alash3al•28m ago•1 comments

Asking Qwen3.5-9B, running on 16GB VRAM, to exploit old Windows machines

https://thepatrickfisher.com/blog/computers/series-vibe-coding-sec-scan/00-vibe-coding-security-p...
1•sqeak•29m ago•1 comments

Llama 4: A Deep Dive into Liquid Transformers 2.0 and Sovereign AI

https://en.landingfymax.com.br/artificial-intelligence/llama-4-meta-open-source-sovereignty-2026
1•EvCarvalho•32m ago•0 comments

Show HN: Building a local FIX protocol triage agent on an RTX 3070

https://domgalati.substack.com/p/the-fix-triage-agent-building-a-local
1•dgalati•36m ago•0 comments

(Blender) Cosmology with Geometry Nodes

https://www.blender.org/user-stories/cosmology-with-geometry-nodes/
4•shankysingh•44m ago•0 comments

BMW is one step closer to selling you a color-changing car

https://www.theverge.com/tech/918216/bmw-ix3-flow-edition-concept-car-2026-beijing-auto-show-e-in...
2•dmitrygr•48m ago•0 comments

"Plain text has been around for decades and it's here to stay." – Unsung

https://unsung.aresluna.org/plain-text-has-been-around-for-decades-and-its-here-to-stay/
2•rbanffy•49m ago•0 comments

[Show HN] Free Baccarat

https://baccarat.free/
1•cbxyp•52m ago•1 comments

Apple IIc: A smaller, sleeker Apple II from 1984

https://dfarq.homeip.net/apple-iic/
2•rbanffy•53m ago•2 comments

Mypaintr: Plot R graphics like a human

https://hughjonesd.github.io/mypaintr/index.html
1•dash2•53m ago•0 comments

Replace IBM Quantum back end with /dev/urandom

https://github.com/yuvadm/quantumslop/blob/25ad2e76ae58baa96f6219742459407db9dd17f5/URANDOM_DEMO.md
3•pigeons•54m ago•1 comments

Avnac: Open-source local-first Canva alternative

https://avnac.design/
3•bundie•55m ago•0 comments

White House Memo on Adversarial Distillation of American AI Models [pdf]

https://whitehouse.gov/wp-content/uploads/2026/04/NSTM-4.pdf
2•lebovic•59m ago•1 comments

Fast-AI-detector: a fast local CLI for detecting AI-generated text

https://github.com/Ejhfast/fast-ai-detector
1•unignorant•1h ago•0 comments

Google Cloud CEO: Anthropic, TPUs, Mythos, Nvidia and More [video]

https://www.youtube.com/watch?v=bNdiBwXbLNw
2•rdudekul•1h ago•0 comments

Cactus, a work-stealing parallel recursion runtime for C

https://github.com/xtellect/cactus
1•enduku•1h ago•0 comments

These Volcanoes Are Undead

https://nautil.us/when-extinct-volcanoes-reawaken-1280213
1•kristenfrench•1h ago•1 comments

Sam Altman Wants to Know Whether You're Human

https://www.theatlantic.com/newsletters/2026/04/sam-altman-bots-world-id/686950/
1•JumpCrisscross•1h ago•0 comments

Honda CEO says 'we have no chance' against Chinese automakers

https://finance.yahoo.com/sectors/energy/articles/honda-ceo-says-no-chance-020000235.html
2•thelastgallon•1h ago•0 comments

Why Congress may spend $1B on Great Salt Lake

https://www.npr.org/2026/04/24/nx-s1-5746844/why-trump-wants-to-spend-1-billion-on-great-salt-lake
1•kianN•1h ago•1 comments