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?

Making Neurons by Hand

https://vgel.me/notebook/making-neurons-by-hand/
1•pr337h4m•7m ago•0 comments

Oxford and MIT Didn't Bite. So Ken Griffin Took His Miami Campus Elsewhere

https://www.wsj.com/business/ken-griffin-citadel-miami-carnegie-mellon-338bcd20
2•ryan_j_naughton•10m ago•0 comments

I Tracked Down All 60 Birds in GTA 6: A Birder's Guide to Vice City's Wildlife

https://www.audubon.org/magazine/birds-of-gta-6-field-guide-vice-city-wildlife
1•Brajeshwar•14m ago•0 comments

Explore Riemann

https://exploreriemann.com/
1•judegomila•15m ago•0 comments

HTTP/1.1 Must Die

https://http1mustdie.com/
2•doodlesdev•15m ago•1 comments

Aletheia Aegis: Deterministic sub-millisecond output guard for AI agents

https://github.com/vikasny30/aletheia-aegis
1•vikasny30•17m ago•0 comments

Who's making all of the money in the porn industry? [video]

https://www.youtube.com/watch?v=3IsgwsuV_nE
1•cisc•24m ago•0 comments

Turn a Bambu Lab P1S 3D printer into a pen plotter

https://github.com/gtls64/p1s-pen-plotter
1•gtls64•26m ago•1 comments

I'm building GURU, a framework for a personal AI that lives alongside you

https://github.com/GuruProduction/GURUbyUnusLumen
1•introducingGURU•26m ago•0 comments

Federal Revenue When AI Replaces Labor

https://www.rand.org/pubs/research_reports/RRA4980-1.html
2•littlexsparkee•26m ago•0 comments

Bell says it's investigating cyberattack that led to potential theft of data

https://www.cbc.ca/news/business/bell-agentic-cyber-attack-9.7430468
1•MadrasThorn•30m ago•0 comments

Scaling horizontally: how we moved beyond Multi-Raft

https://enroute.sh/blog/scaling-horizontally-how-we-moved-beyond-multi-raft
1•Brajeshwar•31m ago•0 comments

Show HN: Sniffy – a free AI detector and Chrome extension

https://getsniffy.com/
1•vood•51m ago•0 comments

Ask HN: Has the quality of HN content/discussions gone down?

1•sandeepkd•52m ago•1 comments

Testing Gemini 4 Hydrogen and Argon vs. Gen 3 over 1,474 Multi-Turn Queries

https://zenodo.org/records/24412128
2•IndependentRese•56m ago•0 comments

Show HN: Musset, open-source Scrivener alternative with an AI that never writes

https://github.com/Musset-App/musset
2•julienmarie•56m ago•0 comments

Manage Kubernetes Clusters for GPU Infrastructure with Nvidia Kubernetes Engine

https://developer.nvidia.com/blog/manage-kubernetes-clusters-for-gpu-infrastructure-with-nvidia-k...
2•teleforce•58m ago•0 comments

Broadcom open-sources its Kubernetes VM manager

https://siliconangle.com/2026/11/09/broadcom-open-sources-its-kubernetes-vm-manager/
1•teleforce•59m ago•0 comments

ClawDOS – An AI coding agent for DOS

http://ricapar.net/ClawDOS/
4•Ricapar•1h ago•1 comments

Dutch Court Bars Chinese SUV in Europe over Resemblance to Land Rover Defender

https://www.reuters.com/world/china/chinas-byd-has-suv-that-infringes-jlr-defender-design-dutch-c...
1•teleforce•1h ago•0 comments

Splice-Core: Low-Order-Bit-Splicing GEMM for Energy-Efficient AI Accelerators

https://arxiv.org/abs/2611.25617
1•matt_d•1h ago•0 comments

Make America Function Again

https://www.thenation.com/article/politics/make-america-function-again/
3•worik•1h ago•0 comments

The logic of Buddhist philosophy (2014)

https://aeon.co/essays/the-logic-of-buddhist-philosophy-goes-beyond-simple-truth
2•sammatilda•1h ago•0 comments

Don't Play Anthropic's Game

https://www.nytimes.com/2026/11/19/opinion/anthropic-ipo-ai-regulation.html
8•rreyes1979•1h ago•3 comments

Show HN: Riemann Hypothesis Proof for Learners

https://riemann.tamnd.com/learn/
1•tamnd•1h ago•0 comments

Cover Your Tracks (2020)

https://www.eff.org/deeplinks/2020/11/introducing-cover-your-tracks
2•zenincognito•1h ago•0 comments

Amgi: Open-source, offline-first Anki-compatible iOS flashcard app

https://github.com/antigluten/amgi
2•rahimnathwani•1h ago•0 comments

iPhone Air Feedback

https://www.rubenerd.au/iphone-air-feedback/
1•meetpateltech•1h ago•0 comments

The Other Road

https://borretti.me/article/the-other-road
2•ianrahman•2h ago•0 comments

AMD dives on short seller report of alleged China exposure

https://www.cnbc.com/2026/11/19/amd-falls-on-short-seller-report-of-alleged-china-exposure.html
3•mgh2•2h ago•0 comments