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 Hare Programming Language

https://harelang.org/
1•xz18r•1m ago•0 comments

Show HN: New daily password puzzle game with real passwords from data breaches

https://dailycrack.app
1•walker1993•1m ago•0 comments

Freebies EOL

1•nubuntu•1m ago•0 comments

Show HN: Slap Alert

https://slapalert.com/
1•NikNewton•3m ago•0 comments

Apache Airflow AI Provider 1.0

https://airflow.apache.org/blog/common-ai-provider-1.0/
1•jonbaer•3m ago•0 comments

Salmon Farmers Deploy Lasers, Robots to Meet Booming Demand

https://www.wsj.com/business/salmon-farmers-deploy-lasers-robots-to-meet-booming-demand-2cad3925
1•mudil•3m ago•0 comments

Rebuilding the monday.com API edge for AI Agents

https://engineering.monday.com/rebuilding-monday-api-edge-for-agents/
1•jensneuse•4m ago•0 comments

Minlit – an AI agent that reads CS/ML papers and answers with citations

https://www.minlit.app/ask
2•damicoedoardo•7m ago•0 comments

Grafana Pages

https://grafana.com/blog/grafana-ai-next-gen-visualization/
1•ilreb•7m ago•0 comments

Musk's Fake Flying Car and 'CEO Said a Thing ' Journalism

https://karlbode.com/musks-fake-flying-car-and-ceo-said-a-thing-journalism/
3•HotGarbage•10m ago•0 comments

Show HN: Trellis - A macOS Terminal with a CLI, JSON-RPC API and MCP Server

https://github.com/bearstouch/trellis
1•felltrifortence•10m ago•0 comments

Demands for AI Filter on Steam Grow as Next Fest Is Flooded with AI Slop

https://respawnfirst.com/demands-for-ai-filter-steam-next-fest-ai-slop/
2•cwal37•11m ago•0 comments

Skolimowski, AI, and Linus Torvalds

https://jasonpolak.substack.com/p/skolimowski-ai-and-linus-torvalds
2•bemtevi•14m ago•0 comments

Show HN: Smash Gauntlet

https://smash-gauntlet.atomic14.com/
1•iamflimflam1•15m ago•0 comments

Availability Cascades and Risk Regulation

https://www.researchgate.net/publication/228607880_Availability_Cascades_and_Risk_Regulation
1•danielam•15m ago•0 comments

The Flash Menagerie

https://excamera.substack.com/p/the-flash-menagerie
1•jamesbowman•15m ago•0 comments

The dangers of letting tech billionaires shape our world

https://www.theguardian.com/global/2026/oct/19/musk-ukraine-ai-music
2•robtherobber•16m ago•0 comments

Giant 'heat storms' are scorching the Earth

https://www.reuters.com/investigates/special-report/climate-heatstorms-science/
4•saikatsg•16m ago•0 comments

Ahead of IPOs, AI companies are sketching plans to share their wealth

https://apnews.com/article/anthropic-openai-public-benefit-fund-fc16c0ff997c8334dcd71e65d726aadc
5•devonnull•17m ago•3 comments

EGPU and Local LLM Inference

https://pgaleone.eu/ai/2026/10/20/eGPU-for-local-llm-inference/
1•me2too•18m ago•0 comments

Educational Testing Service (ETS) data breach

https://www.cde.ca.gov/nr/in/ets-notification.asp
2•dotmanish•19m ago•0 comments

The Kiwi AI tech saving our native bush from pests

https://www.rnz.co.nz/news/environment/2044455/the-kiwi-ai-tech-saving-our-native-bush-from-pests
3•billybuckwheat•20m ago•0 comments

Bessent says a Democrat-led Congress could do little to stop Trump agenda

https://www.reuters.com/world/us/bessent-says-democrat-led-congress-could-do-little-stop-trump-ag...
2•tartoran•20m ago•0 comments

Jeventus: A Jev powered Slack pet

https://twitter.com/thepericulum/status/2108649129798701363
1•jljljl•20m ago•0 comments

HanOS Cloud Want to realse new project with hanFlow stay tuned

https://han-os-offical-site.vercel.app
1•hanath_mahdi_up•21m ago•0 comments

Commentary: Cory Doctorow: Technopolitics

https://locusmag.com/feature/commentary-cory-doctorow-technopolitics/
2•cdrnsf•22m ago•0 comments

Dysregulated cholesterol drives neurodegeneration in Parkinson's disease

https://www.nature.com/articles/s41593-026-02487-7
2•elo2000•23m ago•0 comments

Android Running on an iPod Touch 4G

https://twitter.com/PeterDobbyojtu/status/2112143181152403681
3•bigwheels•24m ago•1 comments

Need for Speed Underground 2 ported to WASM

https://nfsu2.xyz/
4•astlouis44•24m ago•0 comments

Show HN: Gauge CLI – Open-Source Hillclimbing for Agent Experience

https://github.com/gauge-sh/gauge-cli
5•0x63_Problems•25m ago•0 comments