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?

Qwen Drive 1.0: A Vision-Language Foundation Model for Autonomous Driving

https://github.com/QwenLM/Qwen-Drive-1.0
1•LorenDB•51s ago•0 comments

HF hack alignment: make agents more selfish

https://nonlineartransform.substack.com/p/the-collective
1•program_whiz•1m ago•0 comments

AI creators race to understand their creations

https://www.axios.com/2026/09/04/ai-dangers-risks-superintelligence
1•psychanarch•2m ago•0 comments

A field guide to sandboxes for AI

https://www.luiscardoso.dev/blog/sandboxes-for-ai
1•abdelhousni•4m ago•0 comments

Show HN: textlog – The quieter social microblogging platform. HTML-only, no JS.

https://textlog.cc/about?hn
1•stagas•5m ago•0 comments

OpenAI GPT-6 Astra is AGI? [video]

https://www.youtube.com/watch?v=vuFYLqe3-xc
1•harshalone•7m ago•0 comments

Ancient Coins Reveal a Wealth of Information About the Roman Republic

https://nautil.us/ancient-coins-reveal-a-wealth-of-information-about-the-roman-republic-1284847
1•Brajeshwar•8m ago•0 comments

AI Philosophy Competition

https://www.zacharygoodsell.com/ai-philosophy-competition
1•m-hodges•9m ago•0 comments

Two Nations, an Accident, and the Urgent Need to Understand the Laws of Space

https://www.wired.com/story/two-nations-horrible-accident-urgent-need-laws-of-space-lachs-moot/
1•voxleone•9m ago•0 comments

How the Planet-Altering Disaster of "Forever Chemicals" Was Kept Secret

https://www.propublica.org/podcast/forever-chemicals-pfas-pfos-3m-secret-kris-hansen
2•stevenwoo•11m ago•0 comments

Show HN: Show HN Hall of Fame

https://artifactbin.dev/@vivek/6bXsx3-vol-2-show-hn-hall-of-fame
2•nuwandavek•14m ago•0 comments

Donut Labs Solid State Battery Looks Like It May Be Real After All

https://cleantechnica.com/2026/09/04/donut-lab-reveals-amazing-performance-tests/
1•gumby•14m ago•0 comments

Doomscrolling Ourselves to Death

https://www.edwest.co.uk/p/doomscrolling-ourselves-to-death
1•jger15•14m ago•0 comments

A Wandering Mind Is an Unhappy Mind [pdf]

https://greatergood.berkeley.edu/images/uploads/A_Wandering_Mind_Is_an_Unhappy_Mind.pdf
1•aray07•17m ago•0 comments

Discovery of a new IRC bot message board (2018)

https://drewdevault.com/blog/How-to-write-an-IRC-bot/
1•Zsfe510asG•17m ago•0 comments

Show HN: Functional options design pattern and implementation in Go

https://archetechmes.vercel.app/blog/functional-options-go
1•rzwsan•18m ago•1 comments

Sears is alive and well in Mexico

https://www.washingtonpost.com/world/2026/09/05/sears-isnt-dead-its-alive-well-mexico/
1•bookofjoe•18m ago•1 comments

GPT 6 Astra for Developers [video]

https://www.youtube.com/watch?v=9xp1XWmJ_Wo
1•s3p•19m ago•1 comments

Cash in on the AI Boom by Renting Out Your Spare Compute

https://spectrum.ieee.org/ai-inference-distributed-computing
2•pseudolus•21m ago•0 comments

Org chart is your cycle time

https://keithbrown.com/org-cycle-time/
2•optimizethis•23m ago•1 comments

SpaceX is building its own gas turbine blade factory to power AI faster

https://qz.com/spacex-turbine-blade-foundry-ai-data-centers-090226
1•JumpCrisscross•23m ago•2 comments

"Kill All Humans"

https://bsky.app/profile/ruggsea.eurosky.social/post/3murj32dbvs26
2•Bluestein•23m ago•0 comments

Processing power for folding@home has dropped significantly

https://stats.foldingathome.org/os
1•alightsoul•24m ago•1 comments

Almost Anyone Can Make Money Selling Electricity with AI and Batteries

https://www.bloomberg.com/news/features/2026-09-03/consumers-profit-off-solar-batteries-selling-e...
2•JumpCrisscross•25m ago•1 comments

New urinal designs prevent messy splashes onto legs and the floor (2022)

https://www.cbc.ca/news/canada/kitchener-waterloo/urinal-designs-no-splash-backs-university-water...
1•fidotron•28m ago•0 comments

NYC law could force Uber and Lyft to keep dangerous drivers on the road

https://reason.com/2026/09/05/nyc-law-could-force-uber-and-lyft-to-keep-dangerous-drivers-on-the-...
2•leephillips•28m ago•1 comments

Separating Parsing Expression Grammars Using Cell-Probe Lower Bounds

https://arxiv.org/abs/2608.29592
1•pcfwik•29m ago•0 comments

Prompt Evolution Engine

https://vahetorozyan.com/prompt-engineering-engine/
2•VaheT•29m ago•0 comments

Ask HN: Why does it seem like the game industry is stagnating?

1•ishener•29m ago•1 comments

Run AI in the Browser: A Practical Guide to Transformers.js

https://tighten.com/insights/run-ai-in-the-browser-a-practical-guide-to-transformers-js/
1•eustoria•30m ago•0 comments