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?

The craft has been commoditized, but access has not

https://ghuntley.com/access/
1•ghuntley•29s ago•0 comments

Show HN: A substantially expanded terminal for AI CLIs – I can't work without it

https://github.com/albertwujj/agent-term#agentterm
1•aywu•1m ago•0 comments

Show HN: Podcast chat – Answers come only from what podcast guests said

https://podcast-chat.jefersondaniel.com
1•jefersondaniel•4m ago•0 comments

Show HN: WebGPU voxel world with LOD chunking

https://cybervoxels.com/
1•captainbenises•5m ago•0 comments

Show HN: Diffusion studio plugin for codex launch

https://github.com/Teseife/diffusion-studio-codex
1•strax01•5m ago•0 comments

Show HN: NeuroDual – Brain-training games with five guided paths

https://neurodual.com/app
1•neurdodual•6m ago•0 comments

The Impact of MITx

https://impact-openlearning.mit.edu/2025-26-mitx-impact-report
1•raybb•11m ago•0 comments

Ask HN: Built a pet-friendly hotel search site – feedback welcome?

1•petntrip•13m ago•0 comments

GitHub can f..k you and you are forced to love it. or live with it...

2•anonymous_frust•16m ago•0 comments

Scaling Laws for Looped Mixture of Experts

https://arxiv.org/abs/2609.40316
1•matt_d•25m ago•0 comments

Battleships: Sandbox Wars

https://battleships.dev/
1•handfuloflight•27m ago•0 comments

Show HN: QC Control – Tiny macOS utility tonight control your Bose ANC levels

https://github.com/Nash0x7E2/QC-Control
1•Nash0x7e2•27m ago•0 comments

IBM QC Solves in 19s a Calculation That Would Take a Supercomputer 110 Years

https://finance.biggo.com/news/ebf10021-70ae-47b2-8563-29faca3ad765
1•donutloop•35m ago•0 comments

AI datacentres pose growing threat to electricity systems worldwide

https://news.un.org/en/story/2026/09/1168296
1•geox•36m ago•0 comments

Quantum computer simulates matter "popping into existence"

https://www.sciencedaily.com/releases/2026/09/260925005416.htm
2•donutloop•36m ago•0 comments

Show HN: A look at the last 100 years of innovation

https://a-century-compressed.vercel.app/
1•dan_ahmadi•37m ago•0 comments

SVG Motion

https://app.svgmotion.workers.dev/assetstudio
1•saidevac1129•38m ago•0 comments

NATO releases Quantum Technology roadmap

https://www.nato.int/en/news-and-events/articles/news/2026/09/29/nato-releases-quantum-technology...
2•donutloop•39m ago•0 comments

Human-Led Matchmaking for Tech Leaders

https://www.selectivesearch.com/geekwire/?Account.Analytics_Campaign__pc=geekwire-newsletter&utm_...
1•GloVin•42m ago•0 comments

Apple Says iPhone Duo Has Replaceable 'Cover Layer'

https://www.macrumors.com/2026/10/01/iphone-duo-cover-layer-is-replaceable/
2•apparent•48m ago•1 comments

Kurzweil's Exponential Computing Growth Chart

https://www.researchgate.net/figure/Kurzweils-8-71-chart-of-exponential-growth-of-computing_fig1_...
2•kiddz•54m ago•0 comments

During Covid I played Go reasonably seriously for about a year

https://twitter.com/spakhm/status/2105673044962296135
2•Ariarule•59m ago•0 comments

List your SaaS for free and be visible

https://goodsaas.xyz/
2•agnes_realm•1h ago•0 comments

Show HN: Subscribe to Your Email – Thegoods.email

https://thegoods.email/
1•petersonh•1h ago•0 comments

Several Models Debate to Consensus

https://yesbrainer.ai/
1•trekhleb•1h ago•0 comments

Typed Decisions: an open benchmark for decision models (official on HF)

https://huggingface.co/datasets/LocalLLaMA/typed-decisions
1•codelion•1h ago•0 comments

Funtech Experience 2026

https://experience2026.funtech.inc/
1•memalign•1h ago•0 comments

Show HN: Fast Ollama like router that gives a text-only model eyes and ears

https://github.com/SpaceSwordAI/funcroute
1•djinn•1h ago•0 comments

DeepSeek Harness Desktop for macOS and Windows

https://www.deepseek.com/en/harness/
29•Kuyawa•1h ago•10 comments

Running Windows 11 and Server 2025 with macOS Virtualization.framework

https://mustafaakin.dev/blog/windows-on-tart/
1•alpb•1h ago•0 comments