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?

OMP disables Google Antigravity subs due to Google disabling accounts

https://github.com/can1357/oh-my-pi/pull/18622
1•mvid•35s ago•0 comments

BenchUp – 3D design for your next

https://github.com/BenchUp3D/editor
1•marjancek•1m ago•0 comments

Tiny Core Linux

http://tinycorelinux.net/
1•measurablefunc•1m ago•0 comments

ClickHouse Security in Private Preview, Built on RunReveal

https://blog.runreveal.com/introducing-clickhouse-security-in-private-preview-built-on-runreveal/
1•ejcx•2m ago•0 comments

Why Did She Rack Up $40k in Parking Tickets? Fill in the ______

https://www.nytimes.com/2026/11/07/nyregion/nyc-parking-violations.html
1•jaredwiener•2m ago•0 comments

Cargo Takes Minutes. Mitts Takes Seconds: 12 Rustls Worktrees

https://prod.codes/blog/agents-rebuilding-the-same-crates/
1•alex09x•5m ago•0 comments

Computing as Social Activity

https://destructured.net/casa
1•california-og•5m ago•0 comments

We Benchmarked Fireworks, Together, Baseten, Modal, DeepInfra, Z.ai and Keln

https://keln.ai/blog/ai-inference-provider-benchmark-2026
1•kris-holy•5m ago•0 comments

I handed my open-source project to Claude, and it fixed every single issue

https://github.com/lava/matplotlib-cpp
1•HotHotLava•5m ago•1 comments

Nvidia GR00T 2: Scaling Robot Foundation Models [pdf]

https://research.nvidia.com/labs/gear/gr00t-2/assets/gr00t2_whitepaper.pdf
1•covi•6m ago•0 comments

Pdfq – Fast parallel PDF search, drop-in for pdfgrep (Rust)

https://github.com/hakuxyz/pdfq
1•xyzhaku•6m ago•0 comments

Vanderbilt urges university community shut down devices, cybersecurity incident

https://www.wsmv.com/2026/11/09/vanderbilt-urges-university-community-shut-down-devices-amid-cybe...
1•toomuchtodo•8m ago•1 comments

A C++ Quicksort Faster Than std:sort

https://tiki.li/blog/about_blqsort
1•acossta•8m ago•0 comments

macOS 27.2.1, 26.7.3, or 15.8.3 block eMudhra certificates in command-line tools

https://support.apple.com/en-us/149718
1•seam_carver•10m ago•1 comments

Lab-grown meat was supposed to save the world. What happened?

https://www.theguardian.com/news/ng-interactive/2026/nov/05/lab-grown-meat-save-the-world-food-re...
2•Sainth•11m ago•0 comments

U.S. Supreme Court Deals Final Blow to Corporate Human Rights Accountability

https://www.eff.org/deeplinks/2026/11/us-supreme-court-deals-final-blow-corporate-human-rights-ac...
3•HotGarbage•14m ago•0 comments

A Microphone Permission Bypass on iOS 26 (CVE-2026-65339)

https://dbg.re/posts/cve-2026-65339-audiomxd-microphone-permission-bypass/
5•MrFinch•15m ago•1 comments

Fable 5.2 and Jagged AGI

https://www.oneusefulthing.org/p/fable-52-and-jagged-agi
3•theanonymousone•15m ago•0 comments

Vgpu3d: Hardware 3D for Windows VM on QEMU/KVM, on the GPU your host has

https://github.com/fastchain/vgpu3d
1•nokeya•15m ago•0 comments

A Fountain of Slop

https://bencohen.substack.com/p/a-fountain-of-slop
1•bcohen123•15m ago•0 comments

Show HN: Static analysis for JavaScript/TS test suites, written in Rust

https://spirolo.com/
2•AlexFromTwelve•18m ago•0 comments

ClickHouse Observability: Cost-effective managed, OpenTelemetry-native

https://clickhouse.com/blog/announcing-clickhouse-observability
3•mikeshi42•19m ago•0 comments

Pixel Art Lighter: Create and edit normal maps for pixel art – Moonfell

https://www.moonfell-rpg.com/pixel-lighter-desktop
2•jazali•19m ago•0 comments

Show HN: EtherPK Notes – An Agentic Kanban Board from Your Markdown Tasks [video]

https://www.youtube.com/watch?v=6RpNgH8-Dsc
2•gb2d_hn•20m ago•0 comments

Creating Worlds: Runes and Spells Prototype

https://www.fractalkitty.com/creating-worlds-runes-and-spells/
2•evakhoury•21m ago•0 comments

When the Boss on the Phone Isn't Real: How More Than $129M Was Stolen Using A.I

https://www.nytimes.com/2026/11/08/business/ai-ceo-impersonation-theft.html
3•bookofjoe•21m ago•1 comments

YouTuber Geolocates Videos Using Airplane Sounds

https://gizmodo.com/a-youtuber-figured-out-how-to-find-almost-anyone-using-airplane-sounds-200083...
3•leephillips•23m ago•1 comments

Docs for Humans

https://lynx.railcode.dev/docs/humans
2•yakkomajuri•23m ago•0 comments

Muse Ember (Max) Intelligence, Performance and Price Analysis

https://artificialanalysis.ai/models/muse-ember
3•theanonymousone•24m ago•0 comments

There's no such thing as Just a Tool

https://deadsimpletech.com/blog/no-such-thing-as-just-a-tool
2•shlip•24m ago•0 comments