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?

Discretizing Reward Models

https://arxiv.org/abs/2606.21795
1•gmays•44s ago•0 comments

Exploring The Spectrum -Dr. John Ott documentary on the health effects of light [video]

https://www.youtube.com/watch?v=BOUA8UAEAdY
1•Eaglo•3m ago•0 comments

Guardians of the Agents Formal verification of AI workflows. (Dec 2025)

https://cacm.acm.org/practice/guardians-of-the-agents/
1•steilpass•5m ago•0 comments

Oʻahu Needs More Solar, Not New Power Plants

https://civilbeat.org/2026/06/oahu-needs-more-solar-not-new-power-plants/
1•toomuchtodo•7m ago•1 comments

WhiteHouse lifts export control on Anthropic that froze its most advanced models

https://www.cnn.com/2026/06/30/tech/anthropic-export-control-ban-lifted-white-house
1•dstala•8m ago•1 comments

The Future of Software Engineering Is Here but Not Evenly Distributed (Updated)

https://twitter.com/jmugan/status/2065962078322438524
1•jmugan•13m ago•0 comments

Taiwan raids Super Micro in widening China chip smuggling probe

https://www.japantimes.co.jp/business/2026/06/30/taiwan-super-micro-china-chip-smuggling/
4•billybuckwheat•21m ago•0 comments

White House picks Avi Loeb with polarizing alien theories to lead UFO council

https://www.pbs.org/newshour/politics/white-house-picks-harvard-professor-with-polarizing-alien-t...
5•ceejayoz•25m ago•0 comments

The President Made More Than $1Billon in Crypto Deals

https://www.wsj.com/politics/policy/trump-made-more-than-1-billion-on-crypto-deals-part-of-2025-w...
2•fortran77•26m ago•1 comments

A Fusion First: Realta Demos Direct Energy Conversion

https://realtafusion.com/fusion-first-realta-demos-direct-energy-conversion/
1•sien•27m ago•0 comments

Show HN: Explore Ethereum by the Shape of a Transaction

https://www.chaingenius.ai
2•spennant•29m ago•0 comments

Faster Gemma 4 on MLX with multi-token prediction

https://ollama.com/blog/faster-gemma-4-mlx-mtp
2•ilreb•31m ago•0 comments

Why Jet Engines Aren't "Made in China"

https://aakash.substack.com/p/why-jet-engines-arent-made-in-china
2•paulpauper•31m ago•0 comments

Scott Alexander as a modern-day Edmund Wilson

https://statmodeling.stat.columbia.edu/2026/06/07/scott-alexander-as-a-modern-day-edmund-wilson/
2•paulpauper•32m ago•0 comments

Frame Error

https://linch.substack.com/p/frame-error
2•paulpauper•32m ago•0 comments

Wikipedia: Deleted Articles with Freaky Titles

https://en.wikipedia.org/wiki/Wikipedia:Deleted_articles_with_freaky_titles
2•surprisetalk•32m ago•0 comments

Tor’s Arti 2.5.0 Released: Stable Counter Galois Onion

https://blog.torproject.org/arti_2_5_0_released/
3•iamnothere•33m ago•2 comments

Llmaker – spin up a working LLM app from a single prompt, right in your terminal

https://github.com/raiyanyahya/llmaker
3•sleepynoodle•33m ago•0 comments

The Threat of Residential Proxies

https://www.feistyduck.com/newsletter/issue_138_the_threat_of_residential_proxies
2•matheusmoreira•36m ago•0 comments

JWST spots mature galaxy cluster, redefining "cosmic noon."

https://www.eurekalert.org/news-releases/1132818
1•croes•37m ago•1 comments

China's Great Green Wall: 66B trees growing faster than natural forests

https://www.livescience.com/planet-earth/plants/trees-in-chinas-great-green-wall-appear-to-grow-f...
3•simonpure•38m ago•0 comments

The Green Metrics Tool

https://metrics.green-coding.io
1•dijksterhuis•39m ago•1 comments

A new AIs-heading technique to track grain smuggling

https://www.bellingcat.com/news/2026/06/12/shadow-fleet-russian-grain-stolen-ukraine-libya-ais-te...
1•Jimmc414•40m ago•0 comments

Hackers Broke into Madison Square Garden

https://www.404media.co/how-hackers-broke-into-madison-square-garden/
2•Jimmc414•42m ago•1 comments

Donald Trump made more than $1B last year in return to presidency

https://www.ft.com/content/dab0dd71-2d95-4838-b0df-e942f9cc5dec
5•JumpCrisscross•43m ago•0 comments

Ovid: A pi extension that makes it record proof its features actually work

https://github.com/Srinivasa314/ovid
1•s314•43m ago•1 comments

Ironsmith – A full grammar, parser, and compiler for Magic: The Gathering cards

https://chiplis.com/ironsmith/
1•nicolas-siplis•47m ago•1 comments

OpenMontage: an open-source agent that edits real footage into video

https://github.com/calesthio/OpenMontage
2•gittrend•47m ago•0 comments

Show HN: Fruitbox – Docker Compose for Apple's container runtime

https://github.com/urjitbhatia/fruitbox
2•anachronox•49m ago•0 comments

Keybr: Adaptive Touch Typing Trainer

https://www.keybr.com
1•surprisetalk•51m ago•0 comments