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•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?

Coding harnesses are used, an introspection

https://research.tamarillo.ai/coding-harness-inspection/
3•ivanbelenky•1m ago•1 comments

From-scratch reimplementation of Mythos Glasswing pipeline

https://github.com/evilsocket/audit
1•djfergus•2m ago•0 comments

A Simple Image Brightness and Contrast Adjustment Technique

https://geo-ant.github.io/blog/2026/simple-image-contrast-brightness-adjustment/
1•yurivish•6m ago•0 comments

Azure's MFA Warning Links Free-Tier Users to a Page They Can't Use

https://playtechnique.io/blog/azures-mfa-warning.html
1•gwynforthewyn•8m ago•0 comments

Nous Research edits GitHub issue to remove plagiarism claims about Hermes Agent

https://github.com/NousResearch/hermes-agent/issues/10232
1•simonmysun•9m ago•0 comments

Show HN: I trained YOLOv8 to detect dynamics markings on sheet music

https://sheetmusicexplainer.com/
1•derekhdawson•18m ago•0 comments

Phantom Data Centers Didn't Break the Power Grid–They Proved It Was Broken

https://www.powermag.com/phantom-data-centers-didnt-break-the-power-grid-they-proved-it-was-alrea...
2•gok•20m ago•0 comments

ASMTP – SMTP for Agents

https://www.asmtp.net/
2•nickcrews•22m ago•0 comments

Click, Agree, and Your Kids Are Bound: Court Compels Minor Children to Arbitrate

https://natlawreview.com/article/click-agree-and-your-kids-are-bound-court-compels-minor-children...
1•petethomas•24m ago•0 comments

Show HN: Vecdb – local-first hybrid vector database in Rust (HNSW and BM25)

https://github.com/zaydmulani09/vecdb
1•zaydmulani•24m ago•0 comments

Why Outsource Your Auth System and How to Sell the Decision to Your Company

https://fusionauth.io/articles/identity-basics/outsource-auth-system-blueprint
1•mooreds•29m ago•0 comments

Show HN: Spud – cross-platform remote control, optimised for gaming

https://github.com/xfoa/spud
2•foax•35m ago•1 comments

The Merge

https://blog.samaltman.com/the-merge
2•skinfaxi•43m ago•1 comments

Anthropic co-founder to present AI encyclical alongside Pope Leo XIV

https://www.vaticannews.va/en/pope/news/2026-05/pope-leo-xiv-first-encyclical-magnifica-humanitas...
23•cucho•55m ago•2 comments

Don't Sign in with Google

https://twitter.com/the_smart_ape/status/2055941633179283523
7•DeusExMachina•55m ago•0 comments

Built an API client with age-encrypted vault for secrets

https://github.com/xaaha/hulak
1•xaaha•59m ago•1 comments

Meta Reassigns 7k Employees to Focus on A.I

https://www.nytimes.com/2026/05/18/technology/meta-reassigns-7000-employees-ai.html
6•xnx•59m ago•2 comments

MIT 14.12 Economic Applications of Game Theory, Fall 2025

https://www.youtube.com/watch?v=WRibE2nt8wM
2•mdp2021•1h ago•0 comments

Key landmark regulations against 'forever' toxins removed by Trump admin

https://www.cnn.com/2026/05/18/health/trump-pfas-rollback-wellness
7•zzzeek•1h ago•0 comments

Intern gets inspired by Bun to rewrite codebase into assembly

https://twitter.com/KashyapVisharad/status/2055239392147718394
2•sundarurfriend•1h ago•1 comments

Canceled by Hinge

https://www.theatlantic.com/ideas/2026/03/hinge-banning-dating-apps-matchgroup/686445/
4•8f2ab37a-ed6c•1h ago•4 comments

APIMatic – Type-safe SDKs for 7 languages from an OpenAPI spec

https://www.apimatic.io
1•m3h•1h ago•1 comments

Click

https://clickclickclick.click/
92•andrewzeno•1h ago•21 comments

Manchester Code Made Bits Behave

https://spectrum.ieee.org/manchester-code-ieee-milestone
1•jnord•1h ago•0 comments

Super-Adaptable Mayhem 10 Swarming Drone Evolved from the Switchblade

https://www.twz.com/air/super-adaptable-mayhem-10-swarming-drone-evolved-from-the-switchblade
2•breve•1h ago•0 comments

My blog was hacked and Claude and I just fixed it

https://lengrand.fr/my-blog-was-hacked-and-claude-and-i-just-fixed-it/
1•jlengrand•1h ago•0 comments

An asteroid discovered days ago will narrowly miss Earth – RNZ News

https://www.rnz.co.nz/news/world/595636/an-asteroid-discovered-days-ago-will-narrowly-miss-earth
9•colinprince•1h ago•0 comments

If AI can translate instantly, why learn another language?

https://theconversation.com/if-ai-can-translate-instantly-why-learn-another-language-280310
1•0in•1h ago•0 comments

A New Look for Express

https://expressjs.com/en/blog/2026-05-18-a-new-look-for-express/
1•patrikcsak•1h ago•0 comments

Musk says Tesla unsupervised FSD will be 'widespread' in the US by year-end

https://electrek.co/2026/05/18/musk-unsupervised-fsd-widespread-us-end-of-year-smart-mobility-sum...
3•breve•1h ago•2 comments