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?

OpenMetadata: The Open Context Layer for Data and AI

https://github.com/open-metadata/OpenMetadata
1•saikatsg•32s ago•0 comments

The Danish Concept

https://ninjasandrobots.com/the-danish-concept
1•nate•43s ago•0 comments

Show HN: An audit log for what our open-source agent memory learns offline

https://honcho.dev/blog/dream-histories
1•vvoruganti•1m ago•0 comments

Show HN: Reflektor – Turn AI PRs into something a human can review

https://github.com/bashovski/reflektor
1•anurbasic•1m ago•0 comments

More load is faster: Tuning Postgres read replicas

https://clickhouse.com/blog/tuning-postgres-read-replicas
1•tudorg•2m ago•0 comments

Padit – Local-first personal finance app without accounts or cross-selling

https://padit.app
1•trollr•2m ago•0 comments

Should I keep building Publio or let it go?

https://cauenapier.com/blog/should-i-keep-building-publio-or-let-it-go/
1•speckx•2m ago•0 comments

Show HN: ServerDog – Deploy to your own servers from a Mac, no vendor holds keys

https://serverdog.app/
1•fulanw•3m ago•0 comments

Show HN: Indexed_bzip2 2.0 – I used AI to make bzip2 decompression 4x faster

https://github.com/mxmlnkn/librapidarchive/releases/tag/v2.0.0
1•mxmlnkn•3m ago•0 comments

The Public Launch of SolveIt

https://www.fast.ai/posts/2026-11-16-solveit-launch/
1•simonpure•3m ago•0 comments

Bytebase: Open-source database governance platform

https://github.com/bytebase/bytebase
1•saikatsg•5m ago•0 comments

Exponential Behavior in Magic: The Gathering

https://levineuwirth.org/essays/exponential-magic/
1•neuwirth•5m ago•0 comments

Show HN: Brisvox – a Rust engine for real-time voice agents, phone and browser

https://github.com/bilal07karadeniz/brisvox
1•BilalK•6m ago•0 comments

One missing, 11 injured after ADNOC vessel attacked in Strait of Hormuz

https://english.alarabiya.net/News/middle-east/2026/11/18/one-missing-11-injured-after-adnoc-vess...
1•speckx•6m ago•0 comments

Ask HN: Are you sick of buying domains

1•8by3•6m ago•0 comments

Show HN: CrucibleFish

https://github.com/alexisvalentino/CrucibleFish
1•alexisvalentino•7m ago•0 comments

Conventional Commit rules everything around me

https://daverupert.com/2026/11/conventional-commit-rules-everything-around-me/
1•roosgit•7m ago•0 comments

3Dvibe64: Gouraud, Textures and Raycasting in Commodore's 8-Bit World

https://www.retromind.it/blog/3dvibe64-gouraud-textures-and-raycasting-in-commodores-8-bit-world/
1•jjbinx007•8m ago•1 comments

Energy drinks linked to 11 times more reports of cardiac arrest

https://www.sciencedaily.com/releases/2026/11/261110042543.htm
3•wjSgoWPm5bWAhXB•8m ago•0 comments

Show HN: HookChecker – a pre-publish check for short vertical video hooks

https://hookchecker.com/
1•michaelt_rs•10m ago•0 comments

Show HN: Globebug – A calm, conflict-safe travel OS for multi-city itineraries

https://globebug.com/demo-trip/italy-by-train
1•GlobebugLLC•10m ago•0 comments

Show HN: Margeux, an indentation based Lisp with WASM runtime

https://margeux.com/studio.html
2•vegnus•10m ago•3 comments

Two Apple Watch numbers I stopped trusting

https://www.thisandthat.chat/blog/garbage-in-dressed-up-in-tech/
1•jreynar•11m ago•0 comments

Grand theft auto 6 review

https://www.ign.com/articles/grand-theft-auto-vi-review
1•andsoitis•12m ago•0 comments

Tencent releases weights of Hy4 Flash (220B size)

https://huggingface.co/tencent/Hy4-flash
1•lyra1337•12m ago•0 comments

Grand theft auto VI is an astonishing by American epic

https://www.washingtonpost.com/entertainment/video-games/2026/11/18/grand-theft-auto-vi-is-an-ast...
1•andsoitis•13m ago•0 comments

Show HN: MailScope – Catch and lint your app's dev emails locally on a Mac

https://mailscope.app/
1•imknight•13m ago•0 comments

A modern FPS starves wallhacks and radar cheats

https://deaddropgame.com/devlog/how-a-modern-fps-starves-wallhacks-and-radar-cheats/
1•mrgalaxy•13m ago•0 comments

Show HN: TaroBird – An Open-Source IM for Codex, Claude Code and Other CLIs

https://github.com/cloveric/tarobird
1•cloveric•14m ago•0 comments

Dar-E-Nijaat: A look into the psychology of a generation

https://images.dawn.com/news/1196170
1•PaulHoule•14m ago•0 comments