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?

Could Nigerian eateries become as widespread as Chinese restaurants?

https://www.cnn.com/world/africa/could-nigerian-restaurants-become-as-common-as-chinese-restauran...
1•koolhead17•1m ago•0 comments

Alan Turing – Intelligent Machinery, a Heretical Theory (1951)

https://turingarchive.kings.cam.ac.uk/publications-lectures-and-talks-amtb/amt-b-4
1•yshklarov•2m ago•0 comments

Unauthorized access, personal data leaks surge in Japan

https://www3.nhk.or.jp/nhkworld/news/20261007de55671/
1•phantomathkg•6m ago•0 comments

Cyril Hilsum invented the flat-screen displays that hold us in thrall

https://www.economist.com/obituary/2026/10/08/cyril-hilsum-invented-the-flat-screen-displays-that...
1•sohkamyung•8m ago•0 comments

Encore CloudOps

https://encore.dev
1•handfuloflight•10m ago•0 comments

Zulu Assistant – an ops board and agent workforce for your Mac

https://github.com/zulu-assistant/zulu-assistant
1•mswart427•10m ago•0 comments

Show HN: Nostos – A self-hosted home for reading, notes, and writing

https://github.com/Christian-Gennari/Nostos
1•CalmReader96•10m ago•0 comments

3D structure of DNA may explain how cephalopods evolved complex brains

https://www.univie.ac.at/en/news/detail/3d-structure-of-dna-may-explain-how-cephalopods-evolved-c...
1•geox•12m ago•0 comments

Show HN: Konnextions – A local-or-online contact-centre dialer and CRM

https://konnextions.marketingstudios.in/
1•ms_by_pd•16m ago•0 comments

Meet Bibi: We're Building a Voice-Controlled Robot

https://www.youtube.com/shorts/dQeFn7aHyGc
1•aufklarer•18m ago•0 comments

Rat's Register Allocator

https://hexrat.cc/pages/blog/2026_10_07
1•mpweiher•23m ago•0 comments

OpenAIRE Innovation

https://innovation.openaire.eu//
1•T-A•31m ago•0 comments

Building AI agents? You're probably overpaying for infrastructure

https://withruntime.com/
1•shermansingh•31m ago•0 comments

The Most Backdoor-Looking Bug I've Ever Seen (2021)

https://words.filippo.io/telegram-ecdh/
1•theanonymousone•36m ago•1 comments

Bun 1.4.3

https://bun.com/blog/bun-v1.4.3
1•thetallgeek•41m ago•0 comments

VibeSys Builds a Qwen3.5-397B Engine on MI300A, 2.3× Tuned SGLang

https://syfi.cs.washington.edu/blog/2026-10-08-qwen35-mi300a/
2•matt_d•41m ago•0 comments

Show HN: Check how readable your docs are to AI agents

https://www.veludocs.com/agent-friendly-documentation/
1•_aravindc•45m ago•0 comments

Herdr does not accept unsolicited pull requests

https://github.com/herdrdev/herdr/blob/master/CONTRIBUTING.md
2•figmert•46m ago•0 comments

Curious-Learner Skill

https://gist.github.com/skorotkiewicz/84786f0df57cb1a179df1c5dca1e2054
1•modinfo•49m ago•0 comments

Japan protests Russia's extradition requests for ICC president and 8 other staff

https://mainichi.jp/english/articles/20261010/p2g/00m/0in/006000c
2•mdp2021•54m ago•0 comments

GitSwarm: Decentralized Compounding Inference

https://veds12.github.io/git-swarm/
2•matt_d•1h ago•0 comments

Pocket Cloud – Automated zero-cost NAS and media server on unrooted Android

2•Huzefdev•1h ago•0 comments

DHP – agent work that survives kill -9

https://github.com/SIDDARTHAREDDY8/dhp
2•siddarthareddy8•1h ago•0 comments

Metal Driver for Nvidia GeForce RTX Cards on macOS 15 Sequoia

https://github.com/nullmoth/nvidia-macos-driver
3•MrBuddyCasino•1h ago•0 comments

ESA's Map of Recovered Reentry Debris

https://reentry.esoc.esa.int/home/recovereddebris
2•_Microft•1h ago•0 comments

Vectorized CLZ and CTZ

https://purplesyringa.moe/blog/vectorized-clz-and-ctz/
2•g0xA52A2A•1h ago•0 comments

The Coming Technological Singularity: How to Survive in the PostHuman Era (1993)

https://edoras.sdsu.edu/~vinge/misc/singularity.html
3•adityaathalye•1h ago•1 comments

Helping Developers Since 2015 [R/TestMyApp]

https://www.reddit.com/r/TestMyApp/
1•cs1996•1h ago•0 comments

Designing Kolibri: Architecture Trade-Offs from First Principles

https://aleph-alpha.com/en/blog/designing-kolibri-architecture-trade-offs-from-first-principles/
2•frostbyte7•1h ago•0 comments

Show HN: The safe-choice tax – what the vendor nobody gets fired for costs

https://svpremium.dev/
3•PaywallBuster•1h ago•1 comments