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?

Bootleggers and Baptists

https://en.wikipedia.org/wiki/Bootleggers_and_Baptists
1•Teever•45s ago•0 comments

How does GPU recovery work with AMD GPUs on Linux?

https://timur.hu/blog/2026/how-does-gpu-recovery-work-on-amd-gpus-on-linux
1•speckx•2m ago•0 comments

A Crash Course in Predicate Logic

https://www.hillelwayne.com/post/predicate-logic/
1•tmseidman•2m ago•0 comments

Outbid for Nepal Flood Relief

1•prastik•4m ago•0 comments

We built a local first screenshot app for Mac and would love feedback

https://seal-shot.com/
1•MQChen211•7m ago•0 comments

Mutating every DNA letter of a genome shows the limits of AI

https://www.nature.com/articles/d41586-026-02609-y
1•sbulaev•7m ago•0 comments

Forgejo Might Be the Easiest Self-Hosted Git Server I've Used

https://www.virtualizationhowto.com/2026/09/i-tried-forgejo-in-my-home-lab-it-might-be-the-easies...
1•bleevht•12m ago•1 comments

The Largest Electric Aircraft Just Flew [video]

https://www.youtube.com/watch?v=nM86DBOqgPM
2•feb•12m ago•1 comments

A prompt is a probability, a gate is a guarantee

https://www.songbrain.ai/guides/prompt-probability-gate-guarantee
1•leonulicnik•13m ago•0 comments

Building a software factory for AI SDK

https://vercel.com/blog/building-a-software-factory-for-ai-sdk
1•shenli3514•14m ago•0 comments

Jensen Huang and Lisa Su Snubbed by TIME's 2026 List of Top AI Leaders

https://www.tomshardware.com/tech-industry/artificial-intelligence/jensen-huang-and-lisa-su-snubb...
1•m463•15m ago•1 comments

A Serious Look at GPT-5.6 Sol Translations

https://www.reddit.com/r/visualnovels/comments/1w1ok84/a_serious_look_at_gpt56_sol_translations/
1•Artgor•17m ago•0 comments

When the Small Web Gets an AI Door

https://sava.rocks/blog/when-the-small-web-gets-an-ai-door/
1•speckx•18m ago•0 comments

Nine Rules for Compile-Time Work with Rust Const Fn (Part 1)

https://medium.com/@carlmkadie/nine-rules-for-compile-time-work-with-rust-const-fn-part-1-a29f7dd...
1•syumei•19m ago•0 comments

X suspended 6 of our 7 openly-labeled AI accounts for "inauthentic behaviors"

https://areyto.media/x-suspensions
4•rendonroman•21m ago•1 comments

Building Scalable Control Planes

https://www.allthingsdistributed.com/2026/08/on-building-scalable-control-planes.html
1•saikatsg•21m ago•0 comments

Tiki-Taka – Football

https://en.wikipedia.org/wiki/Tiki-taka
1•manlymuppet•22m ago•2 comments

The longer version is sometimes easier to read

https://www.plainfinance.net/break-up-long-sentences-2/
2•speckx•22m ago•0 comments

Morphcpu, a 14 yr olds attempt to build a custom silicon processor from scratch

https://github.com/ranveerlabs/morphcpu
1•ranveergill•22m ago•0 comments

API Delta Manifest: Structured API Changelog for AI Agents and Devs

https://github.com/hassan-jahan/api-delta-manifest
2•mehraban•23m ago•0 comments

Scientists Hunting Dark Matter Found Something Strange

https://www.nytimes.com/2026/09/01/science/dark-matter.html
3•marcusverus•23m ago•1 comments

codex-remote-control – Use Claude's Remote Control with Codex Sessions

https://github.com/sahrizvi/codex-remote-control
1•sahrizv•23m ago•0 comments

Gemini Agentic Video Understanding

https://ai.google.dev/gemini-api/docs/video-understanding
3•thisisauserid•23m ago•1 comments

Independent researcher: AI shouldn't be judged by human standards (paper)

https://zenodo.org/records/22117566
1•KitCrowCo•24m ago•0 comments

Xanadu Was Waiting for Agents

https://zed.dev/blog/agentic-xanadu
2•nsm•24m ago•0 comments

We got to drive the Aptera solar electric car

https://electrek.co/2026/06/17/we-finally-got-to-drive-the-aptera-solar-electric-car/
1•debo_•25m ago•0 comments

Industry Standard Tools

https://industrystandard.tools/
1•greedo•26m ago•0 comments

100% local chat with a model in the browser using WebAssembly written in TinyGo

https://hybridgroup.github.io/yzma-wasm-example/
1•deadprogram•26m ago•0 comments

The point of a system is fewer decisions

https://www.antonsten.com/articles/the-building-was-never-the-hard-part/
2•meetpateltech•26m ago•0 comments

James Dyson Sold Us on a $400 Hair Dryer. Now He's Trying a $499 Toothbrush

https://www.wsj.com/cmo-today/james-dyson-sold-us-on-a-400-hair-dryer-now-hes-trying-a-499-toothb...
3•fortran77•27m ago•2 comments