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?

Wearable Bioacoustics for Two-Way Communication Between Humans and Cetaceans

https://neurips.cc/virtual/2025/loc/san-diego/workshop/109586
1•joebig•43s ago•0 comments

Lipid and Lipoprotein Tutorial

https://thomasdayspring.substack.com/p/lipid-and-lipoprotein-tutorial
1•brandonb•51s ago•0 comments

My Obituary for Programming

https://dumbmatter.com/2026/10/programming-obituary/
1•birdculture•5m ago•0 comments

Ask HN: Is Agentic Coding really faster?

2•another_twist•8m ago•0 comments

Show HN: CADR Mono – a programming font designed in Lisp

https://github.com/atgreen/cadr-mono
1•atgreen•11m ago•0 comments

Meta is accused of meddling with Brazilian election

https://www.nytimes.com/2026/10/14/world/americas/brazil-president-lula-meta-bolsonaro.html
2•neves•13m ago•1 comments

Waymo is coming to Toronto. Will its self-driving cars be winter-ready?

https://www.cbc.ca/news/business/waymo-toronto-winter-self-driving-9.7384550
1•reilly3000•15m ago•0 comments

I built a Google Trends for Reddit

https://slashtrends.com/
4•slashtrends•17m ago•1 comments

Making Hybrid Images (2014)

https://www.jeremykun.com/2014/09/29/hybrid-images/
1•birdculture•20m ago•0 comments

ShortSmash – prompt-to-published short videos, 50-language dubbing, open source

https://github.com/hydope/shortsmash
1•abicevoice1•24m ago•0 comments

Boeing's 737 MAX 7 gets certification from FAA

https://monocle.com/radio/shows/the-briefing/3875/
3•andsoitis•30m ago•0 comments

Zlodev – Local HTTPS reverse proxy with auto-certificates, custom DNS, and a TUI

https://github.com/vandot/zlodev
1•ivanvandot•32m ago•0 comments

Trump says Google kisses his ass

https://www.theverge.com/policy/1013485/trump-google-kiss-my-ass
5•cisc•35m ago•0 comments

Men in tech #YesAllMen – EMF 2026 [video]

https://www.youtube.com/watch?v=WXL6K1lhvt0
2•slater•36m ago•1 comments

Cultures Find Women's Faces to Be More Attractive Than Men's, a New Study

https://www.smithsonianmag.com/smart-news/people-across-cultures-find-womens-faces-to-be-more-att...
2•handfuloflight•38m ago•2 comments

Show HN: WhatsApp MCP running free on Cloudflare

https://github.com/finereli/whatsapp-mcp
3•zoozla•40m ago•0 comments

California and Louisiana have US's highest poverty rates when tied to COL

https://www.axios.com/2026/10/18/american-poverty-map-states-california-louisiana
2•cwwc•41m ago•0 comments

Machinarium 2 in Development [video]

https://www.youtube.com/watch?v=ZqcglWA1pDo
1•ZYZ64738•43m ago•0 comments

Subvert.fm AI Policy

https://www.subvert.fm/pages/ai-policy
2•MattSayar•47m ago•0 comments

A Critique of Standard ML (1992) [pdf]

https://www.cs.princeton.edu/~appel/papers/critique.pdf
2•swatson741•49m ago•0 comments

ParetoOps – CI gate on cost per successful task for LLM evals

https://paretoops.dev/
1•manasapalas•50m ago•0 comments

Show HN: OmniPTY – Opinionated terminal emulator for macOS and Linux

https://github.com/omnipty-terminal/omnipty
2•bobbycoleman-de•52m ago•0 comments

1939 Golden Gate International Exposition in Color

https://www.flickr.com/photos/thomashawk/albums/72177720328646191/
3•Lammy•53m ago•2 comments

Why do I update so easily?

https://cx-shipd.netlify.app
2•CX-Designs•1h ago•0 comments

Show HN: Nori – OSS Music Player optimized for battery usage

https://github.com/norifm/nori
2•bstrama•1h ago•0 comments

If you don't run your own LLM proxy, how do you even know whats going on?

https://jrdsgl.com/if-you-dont-run-your-own-llm-proxy-how-the-fuck-do-you-even-know-whats-going-on/
1•amrrs•1h ago•1 comments

Bloccy – A multimodal canvas for ChatGPT and Claude Desktop

https://bloccy.si/
2•raphaelsoeiro•1h ago•0 comments

Compagnies Républicaines de sécurité 8 – police unit countering urban violence

https://monocle.com/affairs/blue-brigade/
3•Bluestein•1h ago•0 comments

Dutch cloud services concerned after U.S. request leads to Amsterdam server seiz

https://nltimes.nl/2026/10/17/dutch-cloud-services-concerned-us-request-leads-amsterdam-server-se...
8•absqueued•1h ago•0 comments

Show HN: AwesomeMap – Discover rising open-source projects before they get big

https://awesomemap.dev/
1•haggai_shachar•1h ago•1 comments