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?

Cyber Resilience Guide: Zero Trust, AI Security and Ransomware Recovery

https://phpscientist.com/blog/cyber-resilience-implementation-guide-ai-ransomware-zero-trust/
1•senthil_kr•1m ago•0 comments

AI Browser Agents: SEO, Security and Implementation Playbook for 2026

https://phpscientist.com/blog/ai-browser-agents-seo-security-implementation-playbook-2026/
1•senthil_kr•1m ago•0 comments

Try On-Device AI with FM

https://eclecticlight.co/2026/10/10/try-on-device-ai-with-fm/
1•frizlab•2m ago•0 comments

Is AI conscious? Anthropic says 'maybe'

https://www.machinesociety.ai/p/why-anthropic-thinks-claude-might
1•mikelgan•3m ago•0 comments

A domain by any other name

https://kgolubic.com/posts/does-your-top-level-domain-matter/
1•taubek•4m ago•0 comments

Ask HN: MS Outlook login without an extra email address

2•narevent•4m ago•0 comments

Investigating unintended model actions in our evaluations and internal use

https://www.anthropic.com/research/investigating-unintended-model-actions
1•based2•7m ago•0 comments

Show HN: I made Leisure Suit Larry 1 multiplayer co-op

https://matrix.davor.se/lsl/
1•davorb•8m ago•0 comments

Senior AfD politician barred from German synagogue memorial event

https://dpa-international.com/politics/urn:newsml:dpa.com:20090101:261009-930-817262/
1•hasley•10m ago•0 comments

Cloudflare acquires Deno to improve its Workers programming model

https://techcrunch.com/2026/10/10/cloudflare-acquires-deno-to-improve-its-workers-programming-model/
1•sbulaev•12m ago•0 comments

Tehas: A Pi Software Factory

https://tehas.app/
1•velmu•15m ago•0 comments

Niall Ferguson and Balaji on Reinventing Education [video]

https://www.youtube.com/watch?v=QYhM0w5EFR0
2•simonebrunozzi•16m ago•0 comments

Show HN: Pale Engine – a Doom-like game created by Opus 5.5

https://triptych.github.io/web-games-andrew/game-054/index.html
1•triptych•18m ago•0 comments

Rolling Release Distros Superior to LTS in the Patch-Heavy GenAI Era?

https://www.phoronix.com/news/Rolling-Releases-GenAI-Era
1•dxs•18m ago•0 comments

50MB operating system can resurrect your old PC

https://www.makeuseof.com/this-50mb-operating-system-can-resurrect-your-old-pc/
2•makerdiety•19m ago•0 comments

Tools for Thought

https://cel.cs.brown.edu/csci-1377-s26/
3•smartmic•24m ago•0 comments

The state of AI-assisted reverse-engineering of Apple Macs

https://github.com/aurora-silicon/linux/discussions/70
2•cromka•27m ago•0 comments

Integrated Circuits, AI, and Wallabies

https://walkingtheworld.substack.com/p/integrated-circuits-ai-and-wallabies
1•dxs•27m ago•0 comments

Build Fast, Ship Slow

https://viaknox.com/blog/fast-to-build-slow-to-ship
1•pjpoulose•28m ago•0 comments

Shadow Diplomats

https://www.icij.org/investigations/shadow-diplomats/
1•simonebrunozzi•30m ago•0 comments

"Fear Fokol" Private-Security Forces That Patrol South Africa's Wealthy Enclave [video]

https://www.youtube.com/watch?v=zT7sLN-ovZ4
1•mo7061•31m ago•0 comments

Building Production Grade Products

https://viaknox.com/blog/ai-said-done-make-it-prove-it
1•pjpoulose•31m ago•0 comments

The future of air conditioning is spelled 'propane'

https://www.therebuild.pub/p/hank-hill-heat-pumps
2•JumpCrisscross•34m ago•1 comments

Mspep – Encryption from physical sensor entropy (defensive publication)

2•MechanicusMagus•35m ago•0 comments

Ask HN: What's your plan if AI takes your job?

3•bumicodes•35m ago•2 comments

There has been no increase in car sales in China in over a decade

https://twitter.com/lymanstoneky/status/2107227592151445963
1•JumpCrisscross•38m ago•1 comments

I don't trust Lean code from AI

https://karagila.org/2026/lean/
5•pieterk•38m ago•1 comments

Proof-of-Human

https://twitter.com/bzamayo/status/2108498107184934914
1•tosh•39m ago•0 comments

Nicolas Cage Refused to Sign Amazon AI Waiver: 'I'm Not an AI-Friendly Actor'

https://variety.com/2026/tv/news/nicolas-cage-ai-waiver-amazon-spider-noir-1236907564/
18•CharlesW•39m ago•1 comments

Does written language speed up or slow down cultural change?

https://www.livescience.com/technology/communications/does-written-language-speed-up-or-slow-down...
1•theanonymousone•43m ago•1 comments