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?

Legibility of Effort

https://eieio.games/blog/legibility-of-effort/
1•bobbiechen•2m ago•0 comments

Raspberry Pi Pico W as USB Wi-Fi Adapter

https://gitlab.com/baiyibai/pico-usb-wifi
1•byb•4m ago•1 comments

Ions, a distributed reasoning graph built from evidence backed claims

https://github.com/nomad505050/ions-genesis
2•nomad55•14m ago•0 comments

I built an open source VAD that beats Silero, Pyannote, and WebRTC

https://github.com/monishmal3375/nova-vad
2•hellothisismm•15m ago•0 comments

Technology-Driven Moral Panics

https://techlashed.org/
2•gjvc•19m ago•0 comments

Mythos model found vulnerabilities in classified US Government systems

https://apnews.com/article/anthropic-mythos-ai-classified-systems-vulnerabilities-testing-3e8762c...
2•josephwegner•19m ago•0 comments

Ten years on, Brexit's economic impact is becoming clearer

https://www.bbc.co.uk/news/articles/cyv0m164m84o
6•mellosouls•20m ago•0 comments

RRB-Trees: Efficient Immutable Vectors

https://infoscience.epfl.ch/server/api/core/bitstreams/e5d662ea-1e8d-4dda-b917-8cbb8bb40bf9/content
2•azhenley•26m ago•0 comments

2026: The year of the node based editor

https://medium.com/@fadimantium/2026-the-year-of-the-node-based-editor-941f0f15d467
3•soupspaces•39m ago•1 comments

Congress Clears Housing Bill, Cementing a Rare Bipartisan Feat

https://www.nytimes.com/2026/06/23/us/politics/congress-housing-bill.html
8•mikhael•42m ago•3 comments

"Fix" MacBook Neo Cursor Lag: Record 1 Pixel of the Screen Every 10 Seconds

https://gist.github.com/retroplasma/ec21767d0a8380c7ea9c2fbee1c7d6bf
4•retroplasma•43m ago•0 comments

InSight: Self-Guided Skill Acquisition via Steerable VLAs

https://insight-vla.github.io/
2•ilreb•44m ago•0 comments

Kevin Warsh's Press Conference Collides into 30 Years of Michael Woodford

https://newsletter.mikekonczal.com/p/kevin-warshs-press-conference-collides
3•NomNew•50m ago•2 comments

The Teensy Executable Revisited

https://www.muppetlabs.com/~breadbox/software/tiny/revisit.html
3•ankitg12•51m ago•0 comments

How Quake Ruined Id Software

https://twitter.com/SandyofCthulhu/status/2069592209645785294
3•boredemployee•51m ago•0 comments

Bash Line Editor: a command line editor written in pure Bash

https://github.com/akinomyoga/ble.sh
2•thunderbong•54m ago•0 comments

How the war on terror primed America for autocracy

https://www.economist.com/by-invitation/2026/06/02/how-the-war-on-terror-primed-america-for-autoc...
46•andsoitis•58m ago•16 comments

Show HN: Procman, a TUI for run Procfile based app locally

https://github.com/a-chacon/procman
2•achayala•59m ago•0 comments

Qwen-AgentWorld: Language World Models for General Agents

https://arxiv.org/abs/2606.24597
3•ilreb•1h ago•0 comments

Child care is becoming more affordable

https://www.economist.com/graphic-detail/2026/06/23/child-care-is-becoming-more-affordable
2•andsoitis•1h ago•0 comments

Dataland, an intense new AI art museum

https://www.economist.com/culture/2026/06/23/are-you-having-fun-yet-dataland-an-intense-new-ai-ar...
2•andsoitis•1h ago•0 comments

You may be taking the wrong painkiller

https://dynomight.net/painkillers/
3•colinprince•1h ago•2 comments

DiffusionBench: Towards Holistic Evaluation of Generative Diffusion Transformers

https://github.com/End2End-Diffusion/diffusion-bench
4•ilreb•1h ago•0 comments

Woman with Alzheimer's starts conversing again after taking psilocybin

https://www.newscientist.com/article/2531319-woman-with-alzheimers-starts-conversing-again-after-...
10•nazgul17•1h ago•2 comments

I Read the Palantir Manifesto

https://corbettreport.com/i-read-the-palantir-manifesto/
5•paulnpace•1h ago•0 comments

Find FA's in your local area

https://www.falists.co/
2•mattmerrick•1h ago•0 comments

UK tribunal gives go ahead for $4B lawsuit against Apple over iCloud services

https://www.msn.com/en-gb/money/technology/uk-tribunal-gives-go-ahead-for-4-billion-lawsuit-again...
2•geoffbp•1h ago•1 comments

Show HN: Interactive and realistic water ripple physics

https://github.com/Whynotmetoo/water-ripples
1•carsonye•1h ago•0 comments

Design Kits for iOS, iPadOS, and macOS 27

https://developer.apple.com/news/?id=e2lxw9l1
2•soheilpro•1h ago•0 comments

China Minerals Threatens EU; AI Warfare Dominates Japan, WeChat

https://asiaai.fyi/wp-login.php?redirect_to=https%3A%2F%2Fasiaai.fyi%2Fwp-admin%2Fpost.php%3Fpost...
2•dweisinger•1h ago•0 comments