frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

1•LawZiL•8mo 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•8mo 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•8mo 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•8mo 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•8mo ago
Load test against a clone instead of a DB whose contents you care about?

Sparse Mixture of Experts for Game AI: An Accidental Architecture

https://github.com/streamlineddesigns/Sparse-Mixture-of-Experts
1•ColorSwitchDev•4m ago•1 comments

Your Files Are Safe and Secure

https://changelog.koofr.net/important-notice-your-files-are-safe-and-secure-330734
1•shaunpud•5m ago•0 comments

US administration to require app, social media, possibly DNA for travelers

https://infosec.exchange/@briankrebs/115962508398912420
1•stochastician•10m ago•0 comments

Ramiro de Lorca [Passage 4, The Prince] (1516)

https://history.hanover.edu/courses/excerpts/161mach.html
1•sklargh•15m ago•0 comments

Show HN: Pikai – Making Cursor/Claude Code work better across multiple repos

https://pikai.ai/
1•LuqmaanKhan•17m ago•0 comments

US ownership of TikTok off to a rocky start as outage continues into second day

https://www.theregister.com/2026/01/26/tiktok_outage_datacenter_power/
3•Bender•19m ago•0 comments

Vibe coding may be hazardous to open source

https://www.theregister.com/2026/01/26/vibe_coding_hazardous_open_source/
1•raybb•21m ago•0 comments

Interesting blogs that you've read / recent posts?

https://www.benkuhn.net/blogroll/
1•nicklaustran•23m ago•0 comments

iPhone 5s Gets New Software Update 13 Years After Launch

https://www.macrumors.com/2026/01/26/iphone-5s-software-update/
6•angott•23m ago•0 comments

Why Intelligence Is a Terrible Proxy for Wisdom

https://www.joanwestenberg.com/why-intelligence-is-a-terrible-proxy-for-wisdom/
2•zdw•25m ago•1 comments

Show HN: Runo – A metronome app that helps you hold any running pace

https://www.runoapp.com
2•pipeabello•26m ago•0 comments

As lawyer rates surge, US firm charges $4k an hour for top partners

https://www.reuters.com/legal/litigation/lawyer-rates-surge-us-firm-charges-4000-an-hour-top-part...
1•petethomas•26m ago•1 comments

How bad is Delhi's air? Like smoking half a pack of cigarettes a day

https://www.washingtonpost.com/world/2026/01/25/india-pollution-winter-toxic-air/
1•bookofjoe•30m ago•2 comments

AI Motion Control

https://aimotioncontrol.net
2•BruceWok•31m ago•1 comments

Ω-Kernel: Phase-Stabilization Framework for Blackwell B200 Clusters

https://github.com/dielukasz-cyber/Omega-Kernel-Protocol
1•OmegaArchitekt•34m ago•3 comments

Why 'Hello World' Fails Safety-Critical Engineers

https://speytech.com/insights/hello-world-fails-safety-critical/
1•william1872•36m ago•1 comments

Homeless Beggar Turns Out to Own Several Homes, Cars and Side-Businesses

https://www.odditycentral.com/news/homeless-beggar-turns-out-to-own-several-homes-cars-and-side-b...
2•Gaishan•38m ago•0 comments

TikTok reports 'major infrastructure issue' causing app glitches, bugs

https://www.zdnet.com/article/is-tiktok-down-feed-glitchy-broken/
3•Gaishan•39m ago•0 comments

Valve's Proton 10.0-4 Released with More Windows Games Now Running on Linux

https://www.phoronix.com/news/Steam-Play-Proton-10.0-4
6•Bender•42m ago•0 comments

Cinnamon: Group Windows by Application (macOS-Style Alt+Tab for Linux Mint)

https://github.com/b3rs3rk1ng/cinnamon-group-windows-by-app
1•b3rs3rk•42m ago•0 comments

TidesDB and RocksDB on NVMe and SSD

https://tidesdb.com/articles/tidesdb-and-rocksdb-on-nvme-and-ssd/
1•alexpadula•42m ago•0 comments

Tom Homan Pushes Border Patrol Out of Minneapolis

https://www.dailymail.co.uk/news/article-15499857/All-Border-Patrol-agents-ordered-LEAVE-Minneapo...
2•Bender•45m ago•0 comments

The Nobility of the Composing Stick

1•ArchieScrivener•45m ago•0 comments

Why has Microsoft been routing example.com traffic to a company in Japan?

https://arstechnica.com/information-technology/2026/01/odd-anomaly-caused-microsofts-network-to-m...
3•zdw•46m ago•0 comments

Swarm Coordinators Are the Next Big Thing

https://www.alecskriloff.com/blog/swarm-coordinators-are-the-next-big-thing
3•AlecSkriloff•46m ago•0 comments

2026 Public Domain Film Remix Contest Winners, Honorable Mentions and Finalists

https://blog.archive.org/2026/01/21/2026-public-domain-film-remix-contest/
4•gnabgib•48m ago•0 comments

Show HN: Aden A self-healing agent framework that refactors its own logic

https://github.com/adenhq/hive
1•AdelAden•49m ago•0 comments

Alexander Grothendieck: A Country Known Only by Name (2014)

https://inference-review.com/article/a-country-known-only-by-name
2•mellosouls•50m ago•0 comments

Turned A

https://en.wikipedia.org/wiki/Turned_A
1•barrister•54m ago•1 comments

The Entropy of Sovereign AI: Why the Map Is Not the Territory

https://ure.us/articles/the-entropy-of-sovereign-ai-why-the-map-is-not-the-territory/
1•sschotten•54m ago•0 comments