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?

Do we just want slaves?

https://www.yashthapliyal.com/blog/do-we-just-want-slaves
1•yash1hi•7m ago•0 comments

Show HN: Claudexor – quota-aware routing for Claude Code, Codex, and Cursor

https://github.com/razzant/claudexor
2•abstractDL•7m ago•0 comments

Zoom is now Chrome only

https://zoom.us/test
2•asdfsa32•8m ago•1 comments

Bloomberg's Last Stand

https://theterminalist.substack.com/p/bloombergs-last-stand
1•hubraumhugo•9m ago•0 comments

Unity ships a CLI that lets AI agents operate running game projects

https://runtimewire.com/article/unity-ships-a-cli-that-lets-ai-agents-operate-running-game-projects
1•ryanmerket•10m ago•0 comments

Show HN: Ex Situ – open-source spatial index of displaced cultural artifacts

https://exsitu.app/map
5•hbyel•14m ago•0 comments

Church was sacred, now it is theater

https://www.flocksafety.com/industries/places-of-worship
1•maieuticagent•15m ago•0 comments

Looking for contributors – trie based memory efficient LLM runner

https://github.com/oteomamo/SALT
1•omamo•18m ago•0 comments

ShotPlan: Cinematic Video Generation with Learnable Planning Token

https://pensioner-11.github.io/ShotPlan/
2•ilreb•25m ago•0 comments

Reasons for having your own website in 2026

https://bellkiosk.website/blog/reasons-to-website.html
4•vinhnx•25m ago•0 comments

Show HN: UEFI Bootloader for TempleOS

https://codeberg.org/0x2f22d23e/UwUEFI
2•AlecMurphy•27m ago•0 comments

Laura Grego on satellites, nuclear weapons and the battle for our skies

https://www.theguardian.com/lifeandstyle/2026/jul/20/doomsday-system-physicist-laura-grego-satell...
3•oriettaxx•30m ago•0 comments

AI's solution to 87-year-old riddle takes mathematicians by surprise

https://www.newscientist.com/article/2580374-ais-solution-to-87-year-old-riddle-takes-mathematici...
2•vismit2000•30m ago•0 comments

What Becomes Scarce After Intelligence?

https://manasbihani.substack.com/p/every-ai-bet-is-the-same-bet
2•manasb25•32m ago•0 comments

Perverse Polymorphism

https://www.science.org/content/blog-post/perverse-polymorphism
2•bryanrasmussen•33m ago•0 comments

Eliminating Conda/CUDA dependency hell in computational biology pipelines

https://github.com/evo-design/proto-tools
2•LionTurtle13•35m ago•0 comments

Paper Soccer

https://paper.soccer/
4•soupspaces•40m ago•1 comments

Show HN: Vertically Works – UI components built on writing-mode: vertical-RL

https://vertically.works
2•jihoons•40m ago•0 comments

Show HN: DroneWorld – Earth with multiplayer drones and Ethereum real estate

https://droneworld.app/
2•mannders•43m ago•0 comments

Elite Young Runners Are Becoming Freakishly Fast. Welcome to 'Trackflation'

https://www.wired.com/story/teenagers-running-trackflation/
2•gammarator•44m ago•0 comments

Show HN: Repolink – Turn any GitHub repo into a tool for any of your projects

https://github.com/imjszhang/js-repolink
2•imjszhang•48m ago•0 comments

X (Formerly Twitter) Is Going Open Source

https://twitter.com/elonmusk/status/2077361679034118271
7•LopRabbit•49m ago•0 comments

Bash for Browser Front End

https://alganet.github.io/terminal/?p=post:2026-07-21-00-Bash-for-Browser-Frontend&lang=en
2•gaigalas•51m ago•0 comments

Show HN: Fluidic Network Grid – A branchless control plane in Jax

https://github.com/PJHkorea/Fluidic_Network_Grid
2•PJHkorea•55m ago•1 comments

Show HN: Imud – Gpsd, but for IMUs

https://github.com/richcreations/imud
2•richcreations•59m ago•0 comments

Covid-19 Misinformation

https://en.wikipedia.org/wiki/COVID-19_misinformation
3•num42•1h ago•1 comments

Foldkit

https://foldkit.dev/
3•handfuloflight•1h ago•0 comments

Video-use: Edit videos with coding agents

https://github.com/browser-use/video-use
3•nateb2022•1h ago•0 comments

Five US tech giants' hidden debts soar to $1.65T on opaque AI funding

https://asia.nikkei.com/business/technology/five-us-tech-giants-hidden-debts-soar-to-1.65tn-on-op...
63•NordStreamYacht•1h ago•5 comments

Salami Slicing Tactics

https://en.wikipedia.org/wiki/Salami_slicing_tactics
3•num42•1h ago•0 comments