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?

Show HN: CallFirst – blocks socials until you've made a call to someone

https://callfirst.app/
1•fribble•2m ago•0 comments

iFixit Teardown: iPhone 18 Pro and Pro Max

https://www.ifixit.com/News/119329/inside-the-tiny-unfixable-eye-iphone-18-pro-and-pro-max-teardown
1•tosh•4m ago•0 comments

Jev 1.13 Jaggedness

https://docs.typesafe.ai/model-jaggedness/jev-1.13
1•Bluestein•4m ago•0 comments

TPM-Attest: Hardware-Rooted Anti-Cheat Alternative for Linux

https://arxiv.org/abs/2609.20909
1•sbulaev•9m ago•0 comments

Nimble takes some text and a schema, and makes typed decisions about the text

https://github.com/bespokelabsai/nimble
1•Bluestein•11m ago•0 comments

Show HN: Bitcoin-rs – An AI-assisted Bitcoin full node in Rust

https://github.com/gosuda/bitcoin-rs
5•dreamcacao02183•13m ago•1 comments

A Dangerous Castle

https://chloemashitermakesthings.wordpress.com/2026/09/14/a-dangerous-castle/
1•rdmuser•15m ago•0 comments

Generating Artist-Like 3D Mesh Topology via Nearest-Vertex Vector Fields

https://derkleineli.github.io/triflow/
1•ibobev•15m ago•0 comments

I'm afraid of spiders. So I made AI look at 2k of them

https://labqoat.com/blog/how-well-can-ai-identify-spiders
2•michalwarda•16m ago•0 comments

Sparse resources helped my GPU-driven renderer memory usage

https://zino2201.substack.com/p/how-sparse-resources-helped-my-gpu
1•ibobev•16m ago•0 comments

Gabor Fields: Orientation-Selective Level-of-Detail for Volume Rendering

https://arcanous98.github.io/projectPages/gaborVolumes.html
1•ibobev•17m ago•0 comments

OpenXLR – A Linux Variant of Elgato Wave Link

https://github.com/emaspa/openxlr
1•michaelbrooks•17m ago•0 comments

Show HN: A GeoJSON viewer that checks the bbox you declared

https://9revolution9.com/tools/geo/geojson-viewer
2•glassonion999•17m ago•0 comments

Thomson-1.0-Small LLM Developed by Thomson Reuters

https://featherless.ai/models/thomsonreuters/Thomson-1.0-Small
1•Bluestein•17m ago•0 comments

FSD Supervised now approved in Czech Republic

https://twitter.com/teslaeurope/status/2101947798933385410
1•tosh•18m ago•0 comments

WhatsApp Business Paid Support Is a Scam

1•MarcellusDrum•18m ago•1 comments

NILM to recover the energy consumption of individual appliances

https://github.com/goruck/nilm
1•gitowiec•19m ago•1 comments

Show HN: Grade text from the CLI with custom rulesets and Jev

https://github.com/lukstei/slop-grader
2•lukstei•19m ago•0 comments

Show HN: Gleamit – dental health tracker for Android/iOS

https://gleamit.app/
1•Uaitt•20m ago•0 comments

BicDB – a PostgreSQL-compatible database for local-first apps

https://github.com/nikoma/bicdb
2•nikoma777•21m ago•0 comments

AlternativeTo – Crowdsourced Software Recommendations

https://alternativeto.net
1•elliot_a•21m ago•0 comments

AI Data Center Basics: What Is Linear Pluggable Optics (LPO)?

https://blog.semtech.fr/ai-data-center-basics-what-is-linear-pluggable-optics-lpo
1•peter_d_sherman•21m ago•0 comments

Don't Use AI to Write

https://paulbakker.io/writing/no-ai-for-writing/
2•eigenBasis•21m ago•0 comments

DBClient: A native Mac database client for 12 engines (I'm the dev)

https://dbclient.net/
1•elgs•24m ago•0 comments

I found a better React color picker

https://www.npmjs.com/package/chroma-panel
1•itssohailkhan•24m ago•1 comments

The easiest-to-understand article I've read about Jev

https://inlevel9.com/en/issues/jev-judgment-not-writing
1•haebom•26m ago•0 comments

Calibre v9.15's "Create your own adventure" writing game

https://calibre-ebook.com/whats-new
1•tapanjk•27m ago•0 comments

Chinese CXMT to Match Micron's DRAM Manufacturing Capacity This Year

https://www.techpowerup.com/350726/chinese-cxmt-to-match-microns-dram-manufacturing-capacity-this...
1•tosh•30m ago•0 comments

Sonnex – A DAW for macOS

https://apps.apple.com/us/app/sonnex/id6757343055?mt=12
1•vali1•31m ago•1 comments

The Economic Incentives Behind the Push to Pause AI

https://www.vincentschmalbach.com/economic-incentives-behind-the-push-to-pause-ai/
2•vincent_s•35m ago•0 comments