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?

Open Source Drone Simulator

https://github.com/vishwagw/Sky-Sim-drone-simulator-3.0
1•vishwagw98•1m ago•0 comments

Candy Box

https://candybox2.github.io/candybox/
1•OsrsNeedsf2P•3m ago•0 comments

Rogue Pilots Are a Growing Safety Threat–and No One Knows How to Stop Them

https://www.wsj.com/business/airlines/rogue-pilots-have-become-one-of-the-biggest-threats-to-airl...
1•littlexsparkee•5m ago•0 comments

Mastodon-compatible ActivityPub server in Python/Django

https://github.com/avaraline/incarnator
1•henrid•8m ago•0 comments

Beyond n log n: Integer multiplication

https://beyond-n-log-n.netlify.app
1•at1as•13m ago•0 comments

"A Node.js project template that will not install Node with curl – sh

https://github.com/fulldecent/node.js-template
1•fulldecent2•15m ago•0 comments

AI Economist, an installable agent skill for macro nowcasting

https://github.com/garroshub/ai-economist-skill
2•garrosgong•25m ago•0 comments

Automating Java API Integrations with Gemini CLI

https://discuss.google.dev/t/trusted-automation-with-google-antigravity-scaling-secure-finance-in...
1•thetechnogman•26m ago•0 comments

Twitee: A Nitter Alternative

https://twitee.co/
3•nohuman-labs•27m ago•0 comments

QuakePy: Set of tools for statistical analyses of earthquake catalogs

https://quake.ethz.ch/quakepy/
1•teleforce•30m ago•0 comments

Faster Python startup with lazy imports

https://lemire.me/blog/2026/10/09/faster-python-startup-with-lazy-imports/
3•smilelamp•35m ago•0 comments

ICE detainees used facility's video calling software to expose conditions inside

https://www.theverge.com/report/1008342/folkston-georgia-ice-detention-hunger-strike-video
3•HotGarbage•43m ago•0 comments

Show HN: Sibuna an open source web application firewall with proof of work

https://github.com/insanai/sibuna
1•vikrantrathore•43m ago•0 comments

Keyboard differences between Windows and Macs

https://unsung.aresluna.org/deeper-dive-keyboard-differences-between-windows-and-macs/
14•sohkamyung•44m ago•6 comments

Robium – Physical AI harness for coding agents

https://github.com/robium-ai/robium
5•enesakar•45m ago•0 comments

Who are we Now? – Jessitron

https://jessitron.com/2026/08/30/who-are-we-now/
2•pavel_lishin•46m ago•1 comments

Show HN: Rename Super Intelligence Back to Artificial Intelligence

https://chromewebstore.google.com/detail/si-→-ai/cfpagmhjlhnbjabgaoeobkciklolaekn
3•freakynit•47m ago•2 comments

Anger as man sentenced to death for Facebook comment

https://www.themirror.com/news/world-news/anger-man-sentenced-death-facebook-2060304
8•bcaulfield•48m ago•2 comments

Can Reading Make You Happier? (2015)

https://www.newyorker.com/culture/cultural-comment/can-reading-make-you-happier
3•the-mitr•59m ago•0 comments

U.N. Warns Against Technology Used to Read Citizens' Minds

https://www.nytimes.com/2026/10/08/world/europe/united-nations-technology-warning.html
3•reaperducer•1h ago•1 comments

Thinking Will Become a Hobby

https://www.spinellis.gr/blog/20261008/?li261008
5•vinhnx•1h ago•0 comments

Gentoo loses several sponsorships, seeking replacement infrastructure sponsors

https://itsfoss.com/news/gentoo-infrastructure-sponsors-call/
4•iamnothere•1h ago•1 comments

The Hetzner Cloud network stack

https://www.hetzner.com/blog/the-hetzner-cloud-network-stack-history-and-technical-overview/
2•vinhnx•1h ago•0 comments

A Family Video Game as a Hands-On Lesson in Creating with AI

https://stook-runner-family-game.paolo564466.chatgpt.site/
3•chefpaolofontan•1h ago•1 comments

Read to Your Children

https://jamespember.substack.com/p/read-to-your-children
6•jep888•1h ago•0 comments

What Should You Make of Gravity Linux?

https://boxed.news/2026/09/30/gravity-linux-m4-mac-mini-support
3•colinprince•1h ago•0 comments

A website designed to outlive its web host

https://ultimatedotcom.com/
3•JohnWayne_SV•1h ago•1 comments

I predict Apple will open their platforms within the next five years

https://jarbus.net/blog/apple-prediction/
4•jarbus•1h ago•3 comments

What should we tell our students?

https://terrytao.wordpress.com/2026/10/08/what-should-we-tell-our-students/
49•sajid•1h ago•48 comments

Instagram is sorry it gave users too much Creed

https://www.cnn.com/2026/10/08/entertainment/creed-instagram-suggested-music-cec
3•1659447091•1h ago•0 comments