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?

Two-stack sliding-window aggregation

https://orlp.net/blog/two-stack-sliding-window-aggregation/
1•fanf2•20s ago•0 comments

How to scale intent, quality, and artistry with AI [video]

https://www.youtube.com/watch?v=GLvFTMtw4Jk
1•simonjgreen•28s ago•0 comments

Impact of AI Search Summaries on Website Traffic

https://arxiv.org/abs/2602.18455
1•geox•1m ago•0 comments

Agentic Video Understanding with Gemini

https://aistudio.google.com/learn/agentic-video-understanding-with-gemini
1•jskherman•2m ago•0 comments

Hairline Isometry

https://hairline.lucasmarkes.com
2•handfuloflight•2m ago•0 comments

In Ukraine, distributed renewables foil Russia's assaults

https://energytransition.org/2026/09/in-ukraine-distributed-renewables-foil-russias-assaults/
1•JumpCrisscross•2m ago•0 comments

How does the AI and Agent Gateway market will shape up going forward

1•sameerdeshmukh•3m ago•0 comments

Browser extension that warns before signing up with a scam-listed site

https://dontkyc.me/browser-addon?lang=en
2•thorarganaut•14m ago•0 comments

Show HN: Liftspan – strength training that works around bad joints

https://liftspan.fit/
1•liftspan•21m ago•0 comments

America wants to wean itself off Chinese technology

https://www.cnn.com/2026/10/02/business/us-china-tech-bans-intl-hnk-dst
1•01-_-•24m ago•0 comments

Muse Creates Detailed Profiles of All Your Friends and Family

https://www.wired.com/story/muse-creates-detailed-profiles-of-all-your-friends-and-family/
3•01-_-•25m ago•0 comments

Chandraprakash Kumawat – Digital Marketer in Jaipur

https://www.instagram.com/mr_chandrapraksh/
1•mr_chandrapraka•29m ago•0 comments

China's Push into A.I. Has Led to a Problem: Too Much Usage

https://www.nytimes.com/2026/10/02/world/asia/china-ai-overuse.html
1•TMWNN•30m ago•0 comments

AI Learning to Play Chess

https://ailearningchess.ai-learning-chess.workers.dev/
1•porridgeraisin•33m ago•1 comments

IBM Debuts Brain-Inspired Chip for Speedy, Efficient AI (2023)

https://spectrum.ieee.org/neuromorphic-computing-ibm-northpole
1•lioeters•34m ago•0 comments

Show HN: Northstar Web Browser 1.0.28

3•roschdal•35m ago•0 comments

Official Proton Drive CLI

https://proton.me/business/drive/cli
1•chjail-11•38m ago•0 comments

Svelte UI library – looking for feedback and users

https://www.sivir.dev/
1•aidan-neel•38m ago•1 comments

Using Blu-ray M-Disk as Backup of Last Resort

https://smyck.net/2026/10/03/holocron-the-backup-of-last-resort/
2•hukl•39m ago•0 comments

"Torturing" LLMs in a Robot Prison Has Triggered the Dumbest Debate in AI Yet

https://www.404media.co/someone-torturing-llms-in-a-robot-prison-has-triggered-the-dumbest-debate...
3•airhangerf15•39m ago•0 comments

Data Loss in Ttrpc-Rust

https://notes.shvbsle.in/ttrpc-data-loss/
2•dropbox_miner•45m ago•1 comments

OpenBSD Developers Reject Uutils Coreutils

https://news.lavx.hu/article/openbsd-developers-reject-uutils-coreutils-port-over-licensing-and-c...
3•pjmlp•47m ago•1 comments

What's the Future for Pure Math Research in the Age of AI?

https://writings.stephenwolfram.com/2026/09/whats-the-future-for-pure-math-research-in-the-age-of...
1•6bitquant•48m ago•0 comments

A Reinforcement Learning for PC-98 Touhou Games

https://github.com/touhourl/thrl
1•thrl•50m ago•0 comments

Blackbody: Scientific OLED Wallpapers

https://alistair-roberts.co.uk/blackbody
3•simonjgreen•50m ago•1 comments

Show HN: Solvi 1.0 – an LLM proposes, checks decide, every decision replays

https://github.com/solvi-ai/solvi
1•mxkuzn•51m ago•0 comments

Show HN: Thirds.ai – Beautiful, on-brand images and PDFs from templates

https://thirds.ai
1•imvalerian•51m ago•0 comments

Show HN: Artbucket – OSS brand assets and portals for humans and AI agents

https://github.com/pwnera/artbucket
1•akaabachi•52m ago•0 comments

Doom Town: Doom mods playable on Browser

https://indie.fun/play/doom-town
1•m0dE•53m ago•0 comments

Cloudflare OS (Also on GitHub)

https://os.cloudflare.app/
2•a3w•55m ago•0 comments