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?

Code Review Agent Should Run in CI, Not on Your Computer

https://epho.io/blog/code-review-agent-in-ci/
1•terzioglub•1m ago•0 comments

Show HN: I built a phone app to gamify fitness with friends

https://pactpals.com
1•rephus•1m ago•0 comments

Zxc 0.15.0 – decompression 2x faster than Zstandard

https://libzxc.org/
1•birdculture•1m ago•0 comments

Tell HN: Wise holds my company's $22,954 for 27 days, then goes silent

2•piotrreich•2m ago•0 comments

Show HN: An Algol 60 compiler with a LuaJIT runtime

https://github.com/rochus-keller/Algol60/releases/tag/2026-10-09
1•Rochus•4m ago•0 comments

War Games of Dimming the Sun

https://www.wired.com/story/they-war-gamed-dimming-the-sun-it-went-even-worse-than-you-think/
1•elo2000•4m ago•0 comments

I'm Not a Robot: The Internet's Human Test

https://foundinthemachine.com/episodes/8-i-m-not-a-robot-the-internet-s-human-test/
1•surprisetalk•5m ago•0 comments

WHO report on Russian lab worker death highlights "key uncertainty"

https://arstechnica.com/health/2026/10/who-report-on-russian-lab-worker-death-highlights-key-unce...
1•rbanffy•6m ago•0 comments

OnlyOffice 10.0 Released with AI Features, 1k Bug Fixes

https://www.phoronix.com/news/ONLYOFFICE-10.0
1•rbanffy•6m ago•1 comments

Gaming on Linux Without Cheating

https://onlineservices.epicgames.com/news/introducing-easy-anti-cheat-linux-v2
1•water-drummer•6m ago•0 comments

Asterinas 0.19.0

https://asterinas.github.io/2026/10/13/announcing-asterinas-0.19.0.html
2•pjmlp•7m ago•0 comments

Show HN: MLX Direct Decider, Mac local decider without fine-tuning

https://github.com/ItsOdeLeo/MLX-Direct-Decider
1•LeoisNotAI•7m ago•0 comments

Netflix is laying off roughly 6% of its workforce

https://www.cnbc.com/2026/10/14/netflix-layoffs.html
5•nabbed•7m ago•1 comments

Ported2Browser

https://ported2browser.com/
1•luispa•8m ago•0 comments

ESA targets Anbernic emulation handhelds as "superfake" piracy enablers

https://arstechnica.com/gaming/2026/10/esa-targets-anbernic-emulation-handhelds-as-superfake-pira...
2•rbanffy•9m ago•0 comments

Hash-consing MMDB search trees: 31% smaller files, identical lookups

https://ipinfo.io/blog/how-made-mmdb-files-smaller
2•mmaia•9m ago•0 comments

Flashcards in ChatGPT

https://help.openai.com/en/articles/20001533-flashcards-in-chatgpt
1•joshdavham•9m ago•0 comments

Bitwise-identical training and inference across GPU vendors – Nvidia, AMD, Apple

https://github.com/mojolearn/mojolearn
1•andrewhendel•10m ago•0 comments

Show HN: BScaff – A CLI tool for project scaffolding and snippets

https://github.com/akashnag/bscaff
1•akashnagcs•11m ago•0 comments

Domain Aware Software Factory

https://sohit.substack.com/p/domain-aware-software-factories
1•sohitkeshri•11m ago•0 comments

Show HN: Merlin, Run Your Claude Code and Codex from Slack, Linear and GitHub

https://usemerlin.ai
1•dottchen•12m ago•0 comments

Apply as a team and earn €50M in Mollie equity

https://www.mollie.com/nightshift
1•koenvanham•12m ago•0 comments

Show HN: Open-source DFM checks for manufacturing and MCP

https://openmrp.ai/dfm
2•dalbaugh•13m ago•1 comments

Man, SF is downright gloomy these days

https://12gramsofcarbon.com/p/notes-from-the-sf-safety-scene
2•theahura•14m ago•0 comments

GitHub Actions has added lock files

https://github.blog/changelog/2026-10-14-github-actions-workflow-lockfiles-in-public-preview/
3•bengotch•15m ago•0 comments

Cancellation of this year's Grace Hopper Celebration

https://ghc.anitab.org
1•bobbiechen•16m ago•0 comments

Mathematical proof in the age of AI

https://rutar.org/writing/mathematical-proof-ai/
1•arutar•16m ago•0 comments

The Silicon Compiler Comes Back as an AI Agent Factory

https://brianroemmele.substack.com/p/the-silicon-compiler-comes-back-as
1•MaysonL•17m ago•0 comments

Pumbkin – Roll your own custom voxel jack-O-lantern

https://pumbkin.xyz/
1•internetguy•18m ago•0 comments

Machine, Assemble, Repair: How We Build Atlas [video]

https://www.youtube.com/watch?v=dP_i7hRvGpE
1•Klaster_1•18m ago•0 comments