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?

Potential everyday use of cargo bikes

https://gupea.ub.gu.se/items/cc92f218-76e1-4a0d-b0b3-46f7a5b39c06
1•emj•34s ago•0 comments

Man gripping his phallus is oldest known narrative scene

https://www.thehistoryblog.com/archives/65878
1•isomorph•53s ago•0 comments

Bill Gates proposes major limits on AI development

https://www.cnn.com/2026/08/26/business/bill-gates-wants-limits-on-ai
1•lsllc•1m ago•0 comments

How I Design with AI

https://twitter.com/reactiverobot/status/2092638003789439075
1•7777777phil•2m ago•0 comments

PlayStation 3 Cluster

https://en.wikipedia.org/wiki/PlayStation_3_cluster
1•jjbinx007•5m ago•0 comments

Gamescom highlights gaming boom amid AI concerns

https://www.dw.com/en/gamescom-2026-highlights-gaming-industrys-strength-ai-challenges/a-78502849
4•billybuckwheat•6m ago•0 comments

US Designates Palestine Action as Terrorist Group: What the Decision Means

https://moztako.me/us-designates-palestine-action-terrorist-group/
3•imanis•7m ago•0 comments

Why Is Everyone in Silicon Valley Talking Like That?

https://www.theatlantic.com/technology/2026/08/ai-jargon-in-everday-speech/688358/
3•apparent•9m ago•2 comments

New GPUThor attack defeats Nvidia ECC protection for root access

https://www.bleepingcomputer.com/news/security/new-gputhor-attack-defeats-nvidia-ecc-protection-f...
1•datakan•9m ago•0 comments

Show HN: NetSour, the modular packet analyzer TUI

https://github.com/thegoodduck/NetSour
1•thegoodduck•13m ago•0 comments

Show HN: Infra Lang – Compile a Single DSL to K8s, Compose, Helm and Terraform

1•Tuvi•13m ago•0 comments

76% of 623 EU software vendors have no security.txt ahead of the CRA 24h rule

https://cradrill.com/research.html
2•gilsha•14m ago•1 comments

Numbat Editor: a notepad-style calculator with first-class units

https://numbat.dev/editor.html
1•ikesau•16m ago•1 comments

Show HN: Find Perth jobs. Hire local talent

https://jobsinperth.com.au
1•wowinter15•17m ago•0 comments

Bellevue speed cameras vandalized just a week after installation

https://www.seattletimes.com/seattle-news/bellevue-speed-cameras-vandalized-just-a-week-after-ins...
3•petethomas•17m ago•0 comments

Ask HN: Why do tools like customer.io abandon self-serve after their Series A?

2•alessandroetc•18m ago•0 comments

'A Bible-sized blind spot': alarm on rising Christian nationalism

https://www.theguardian.com/world/2026/aug/26/jared-huffman-rising-christian-nationalism-no-proph...
2•johnea•18m ago•1 comments

Building textlog without JavaScript

https://gist.github.com/stagas/09ad937b493bf8cd3285917279de2488
1•stagas•18m ago•0 comments

Show HN: Ten_cubed – Artificially restricted social graph

https://tencubed.dev
1•darkpicnic•20m ago•0 comments

Science magazine casts doubt on genes hailed as warding-off Alzheimer's disease

https://www.science.org/content/article/science-investigation-casts-doubt-genes-hailed-warding-al...
1•pcrh•21m ago•0 comments

Remote Patient Monitoring Software

https://andersenlab.com/industries/healthcare/remote-patient-monitoring
1•morganclns94•22m ago•0 comments

Australian data centres will use seven times more power by 2036

https://thenextweb.com/news/australian-data-centres-power-aemo-forecast-2036
1•01-_-•23m ago•0 comments

Your Discs. Now Also Digital

https://news.xbox.com/en-us/2026/08/26/your-discs-now-also-digital/
1•durron•24m ago•0 comments

Minicomputers Made by Nvidia Are Powering Moscow's A.I. Drones

https://www.nytimes.com/2026/08/24/world/europe/ukraine-war-nvidia-ai-autonomous-drones.html
1•01-_-•24m ago•1 comments

We're Only "Renting" What We Think We "Own"

http://charleshughsmith.blogspot.com/2026/08/were-actually-only-renting-what-we.html
2•speckx•25m ago•0 comments

Vibe-Coding Optimized Binary Search

https://parallelprogrammer.substack.com/p/vibe-coding-optimized-binary-search
1•ryandotsmith•28m ago•0 comments

Show HN: Convolens – Real time slides and fact-checking

https://demo.convolens.ai
2•Banbanaste•30m ago•0 comments

Treat Meetings as Crucibles

https://www.skmurphy.com/blog/2026/08/24/treat-meetings-as-crucibles/
1•skmurphy•30m ago•1 comments

'Temu Range Rovers' Are Taking over Britain

https://www.telegraph.co.uk/business/2026/08/26/temu-range-rovers-are-taking-over-britain/
1•rayrey•32m ago•1 comments

How I Created the Iconic iPhone Sound

https://jacklinstudios.com/docs/making-of-158-marimba.html
1•fidotron•33m ago•0 comments