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

Copyright Can Survive in the Age of AI

https://www.ip.mpg.de/en/research/research-news/copyright-in-the-age-of-ai.html
1•JeanKage•2m ago•0 comments

Stick Hero controlled by trackpad pressure (Mac Force Touch, Safari playable)

https://stick-hero-pressure.vercel.app
1•booffa•3m ago•1 comments

SSH Virtual Hosting: No Host Header, but Public Key

https://blog.exe.dev/ssh-host-header
1•pvtmert•4m ago•1 comments

BrokenClaw – RCE in OpenClaw via Gmail Hook

https://veganmosfet.codeberg.page/posts/2026-02-02-openclaw_mail_rce/
1•veganmosfet•5m ago•1 comments

Ask HN: How do you implement production-grade draft isolation in Django?

1•pigon1002•5m ago•0 comments

Bare Zork

https://github.com/Drache93/bare-zork
2•Drache93•7m ago•1 comments

Queues for Kafka ready for prime time

https://freedium-mirror.cfd/https://medium.com/@andrew_schofield/queues-for-kafka-ready-for-prime...
1•gslin•8m ago•0 comments

Show HN: Murmuration – AI visualizes your state of mind

https://github.com/paraschopra/murmuration
1•paraschopra•9m ago•0 comments

JwtAuth Plugin for Firebird

https://asfernandes.github.io/2026/02/22/jwtauth-plugin-firebird-en
1•mariuz•9m ago•0 comments

Sprites on the Web

https://www.joshwcomeau.com/animation/sprites/
1•vinhnx•11m ago•0 comments

Claude the Instructor

https://rmoff.net/2026/02/20/claude-the-instructor/
1•vinhnx•12m ago•0 comments

Could You Survive Without Modern Technology? (1978) [video]

https://www.youtube.com/watch?v=WXZpjZidCNk
1•aluket•12m ago•0 comments

So I've Been Thinking About Static Site Generators

https://wolfgirl.dev/blog/2026-02-23-so-ive-been-thinking-about-static-site-generators/
1•vinhnx•12m ago•0 comments

Cliamp – retro terminal music player inspired by Winamp

https://github.com/bjarneo/cliamp
1•dsego•14m ago•0 comments

Tailscale Aperture

https://tailscale.com/blog/aperture-partners-update
1•tosh•16m ago•1 comments

Conference Arena, a rating leaderboard where papers fight each other

https://confarena.com/arena
1•seonglae•25m ago•1 comments

Passkeys and the Quiet Revolution in Corporate Crypto

https://conic.al/writing/passkeys-and-the-quiet-revolution-in-corporate-key-material/
1•seanieb•26m ago•1 comments

Agent/Skill for Literature Reviews

https://github.com/5ak3t/literature-review-skills
1•fruiapps•30m ago•0 comments

PCB Tracer

https://pcbtracer.com
1•Luc•32m ago•0 comments

Show HN: AI tools on one domain, built with Next.js and Claude AI

https://ai-tools-woad-six.vercel.app
1•oteo_buildso•33m ago•0 comments

Show HN: AI Headcanon Generator: Instant Ideas, Endless Stories

1•avaj03•35m ago•0 comments

Ask HN: How are you doing with AI overload?

1•Gooblebrai•38m ago•1 comments

Show HN: Kuta – Treadmill Interval Training for iOS

1•eriknielsen•40m ago•0 comments

AI-generated replies really are a scourge these days

https://twitter.com/simonw/status/2025909963445707171
15•da_grift_shift•41m ago•13 comments

Microsoft execs worry AI will eat entry level coding jobs

https://www.theregister.com/2026/02/23/microsoft_ai_entry_level_russinovich_hanselman/
2•latexr•43m ago•0 comments

Is GitHub Down Again?

4•MicKillah•44m ago•0 comments

Timedb: Open-Source Database for Timeseries

https://github.com/rebase-energy/timedb
1•davide_rebase•47m ago•1 comments

Mastodon Engagement Viewer

https://www.leeholmes.com/projects/mastodon-engagement-viewer/?url=https%3A%2F%2Finfosec.exchange...
1•latexr•48m ago•0 comments

How I made a shooter game in 64 KB [video]

https://www.youtube.com/watch?v=qht68vFaa1M
1•freetonik•49m ago•0 comments

I Built an AI Agent That Trades Crypto on a Mac Mini for $2/Month

https://jdbot54.substack.com/p/i-built-an-ai-agent-that-trades-crypto
1•JohncheckMunich•49m ago•0 comments