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?

American Express launches NFTs in 2026

https://www.americanexpress.com/en-us/web3/passport/
1•runamuck•57s ago•0 comments

Kids (With Phones) Are Alright

https://heatherburns.tech/2026/07/08/the-kids-with-phones-are-alright/
1•speckx•3m ago•0 comments

Show HN: Abralo – Manage several Claude Code agents in one window

https://abralo.com/
1•cwbuilds•3m ago•1 comments

Venus Aerospace raises $91M to advance its revolutionary rocket engine design

https://www.space.com/technology/revolutionary-rocket-engine-company-venus-aerospace-raises-usd91...
1•rbanffy•6m ago•0 comments

ArticleOne – a daily tech briefing app

https://articleone.news/
1•ethanjamesfox•7m ago•0 comments

Measuring and improving AI-generated UI design

https://softlight.com/blog/measuring-and-improving-ai-generated-ui-design
2•ashwin153•7m ago•0 comments

BrAIn, reactive AI agent nodes on a NATS bus instead of a chat loop

https://github.com/tibzejoker/brAIn
1•tibzejoker•8m ago•0 comments

Start with A – Open-source, self-hosted investment research platform (BYOK AI)

https://github.com/warlock20/StartWithA
1•warlock_20•8m ago•0 comments

OpenAI/YC, Netflix, Michaels and Apollo

https://www.marginpoints.com/issues/2026-07-07-openai-yc-netflix-michaels-apollo
1•historian1066•8m ago•0 comments

A free Claude skill that turns one blog post into 3 ready-to-publish posts

https://github.com/alexmendo25703-hub/content-repurposer-lite
1•Creator_Forge•10m ago•0 comments

Show HN: RepoFleet – A CLI to manage Git workflows across multiple repositories

https://github.com/mehranzand/repofleet
1•mehranzand•10m ago•0 comments

LLM-wiki-tags: LLM-readable codebase docs with grep-friendly tags

https://github.com/mpashka/llm-wiki-tags
1•m_pashka•14m ago•0 comments

Anyone here with an "in" with eBay?

3•ColinWright•14m ago•0 comments

Are all evils caused by insufficient knowledge?

https://www.bretthall.org/blog/are-all-evils-are-caused-by-insufficient-knowledge
3•jxmorris12•15m ago•1 comments

Waterfall CAD Playground: Haskell-Powered Programmable CAD in Browser with WASM

https://doscienceto.it/waterpark/
1•birdculture•15m ago•0 comments

German Exit Tax: What to Do Before Your First Funding Round

https://eidel.io/posts/german-exit-tax-what-to-do-before-your-first-funding-round
2•olieidel•16m ago•0 comments

Digital show and tell: how digital audio signals behave in the real world

https://wiki.xiph.org/Videos/Digital_Show_and_Tell
1•fanf2•16m ago•0 comments

Quilt: Run many AI coding agents in one Git checkout

https://github.com/wkoverfield/quilt
1•wkoverfield•17m ago•0 comments

Cayley graph search with Claude Code: what puzzle competitions look like in 2026

https://andlukyane.com/blog/cayleypy-kaggle-with-claude
2•Artgor•18m ago•0 comments

Introducing My Apple Franken-Lisa Project · Rhyme

https://rhyme.com/post/6xb7vxx/introducing-my-apple-franken-lisa-project
1•rbanffy•18m ago•0 comments

Show HN: Boards.md – A project board that writes itself while you build

https://boards.reindent.com/
3•reindent•19m ago•1 comments

Spit – On-device voice dictation for Mac, free and open source

https://github.com/Draxo-io/spit
1•rafamail•20m ago•0 comments

Ask HN: What features do you want in a free online timer?

1•CleanStopwatch•21m ago•0 comments

America's Greatest Hot Dog

https://www.theringer.com/2026/07/02/food/costco-hot-dog-history-explained-cheap
1•speckx•21m ago•0 comments

Running Kubernetes without C in Rust-based Asterinas kernel

https://github.com/upbound/asterkube
1•boeroboy•22m ago•1 comments

IBM Expands Z17 and LinuxONE 5 Mainframe Lineups with Single Frame and Rackmount

https://www.servethehome.com/ibm-expands-z17-and-linuxone-5-mainframe-lineups-with-single-frame-a...
1•rbanffy•23m ago•0 comments

The Lolcow-ification of Politics in the Attention Economy

https://www.dontbeasucker.blog/p/attention-tastes-good-like-a-politik
1•betterthanever•24m ago•0 comments

Razer Certifying Their First Laptop for Linux: Razer Blade 18 RZ09-0582 Review

https://www.phoronix.com/review/razer-blade-18-linux
1•rbanffy•24m ago•0 comments

I RE'd (and reimplemented) the ICSee camera app. The security is atrocious

https://github.com/voidnullvalue/Icsee-android
2•voidnullvalue•25m ago•0 comments

America Talked Itself into Chinese Open Source AI

https://www.resilientcyber.io/p/how-america-talked-itself-into-chinese
2•smurda•25m ago•0 comments