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?

Has any one ever used Strands – the AI Agent SDK by AWS

https://strandsagents.com/
1•donbox•27s ago•0 comments

AirPods with Cameras Leak: Used for Visual Intelligence

https://www.androidauthority.com/apple-airpods-camera-demo-leak-macos-3699674/
1•dan-bailey•1m ago•0 comments

Node.js Is Doomed (and Back End Developers Are Panicking)

https://medium.com/the-tech-notes/node-js-is-doomed-and-backend-developers-are-panicking-b51ea207...
1•sss111•3m ago•1 comments

The Copyright Fight over Medical Billing Codes

https://www.plagiarismtoday.com/2026/08/18/the-copyright-fight-over-medical-billing-codes/
1•speckx•3m ago•0 comments

LRO images of lunar crater formed by Falcon 9 impact

https://lroc.im-ldi.com/images/1499
1•alejohausner•3m ago•0 comments

Systemic security risks in the managed PostgreSQL services

https://mehmetince.net/part-1-6-systemic-risks-in-the-managed-postgresql-industry-extension-risks...
1•ozirus•3m ago•0 comments

Traces Know What Broke. Your Agent Doesn't

https://memanto.ai/blog/langfuse-traces-into-agent-memory
1•supportm•3m ago•0 comments

Berd from Block: A Better Way to Build

https://berd.xyz
1•nsillik•3m ago•0 comments

The Spectral Neuron

https://arxiv.org/abs/2608.08003
1•alexshtf•4m ago•1 comments

Postgres 19: How Our Advice Has Changed Since We Wrote It

https://www.crunchydata.com/blog/postgres-19-how-our-advice-has-changed-since-we-wrote-it
1•winslett•5m ago•0 comments

Anthropic extending the 50% increase to weekly Claude Code limits till August 31

https://twitter.com/ClaudeDevs/status/2089798442306711646
2•halfmatthalfcat•6m ago•1 comments

3M accused of withholding toxicity of PFAS firefighting foam for decades

https://www.abc.net.au/news/2026-08-18/pfas-3m-court-case-claim/107027292
3•OutOfHere•7m ago•0 comments

The Chevy Nova That Wouldn't Go: This Commonly Told Tale Is Just an Urban Legend

https://www.thoughtco.com/chevy-nova-that-wouldnt-go-3078090
1•andrewfromx•7m ago•0 comments

UK Grid Live

https://www.ukgridlive.co.uk/
1•zeristor•10m ago•1 comments

Effects of Corporal Punishment on Children

https://scholarship.law.duke.edu/cgi/viewcontent.cgi?article=1565&context=lcp
1•simonebrunozzi•11m ago•0 comments

OpenAI built a safer ChatGPT, just not for you

https://www.machinesociety.ai/p/openai-built-a-safer-chatgpt-but
1•mikelgan•11m ago•1 comments

'They knew their platforms could harm young people'

https://english.elpais.com/technology/2026-08-18/decisive-trial-against-meta-begins-they-knew-the...
2•root-parent•11m ago•0 comments

Keanu Reviews – GitHub → Slack PR Bot

https://github.com/unkeyed/keanu-reviews
1•jamesperkins•11m ago•0 comments

Association of Spicy Chilli Food Consumption with All-Cause Mortality

https://pubmed.ncbi.nlm.nih.gov/33657876/
1•MrJagil•12m ago•0 comments

My coding agent invented its own vision

https://nickbusey.com/article/2026-08-18-agent-invented-vision/
2•NickBusey•13m ago•0 comments

Microsoft Copilot reveals secret input that allowed it to be hacked

https://arstechnica.com/security/2026/08/microsoft-copilot-reveals-secret-input-that-allowed-it-t...
2•sbulaev•14m ago•0 comments

Oracle Security Advisory for August 2026 contains 943 new security patches

https://www.oracle.com/security-alerts/cspuaug2026.html
1•speckx•16m ago•0 comments

Blind Egyptian entrepreneur's AI app helps others 'see' the world

https://www.reuters.com/world/middle-east/blind-egyptian-entrepreneurs-ai-app-helps-others-see-wo...
1•tartoran•17m ago•0 comments

Smoking Is Back in Fashion. Why?

https://www.ft.com/content/270bd14a-9016-4861-bdd2-5b6b192ad1c5
1•karakoram•17m ago•0 comments

Ubuntu on Windows outgrowing native installs? Not according to Canonical

https://www.zdnet.com/article/ubuntu-on-windows-outgrowing-native-installs-not-according-to-canon...
2•CrankyBear•19m ago•0 comments

The Letta Agent SDK

https://cameron.leaflet.pub/3mteywuetbs2i
1•cpfiffer•19m ago•0 comments

Why HPSC Is a Big Deal for Space Exploration

https://www.windriver.com/blog/Why-HPSC-Is-a-Big-Deal-for-Space-Exploration
1•ohjeez•20m ago•0 comments

Hister – private, self hosted search engine

https://hister.org/
2•auraham•20m ago•0 comments

What Parents Need to Know About OpenAI's New ChatGPT for Teens

https://www.wsj.com/tech/personal-tech/openai-chatgpt-for-teens-bc0e9d39
3•fortran77•23m ago•1 comments

How to Parallelize a Transformer for Training

https://ezyang.github.io/interactive-parallelize-transformer/
1•matt_d•25m ago•0 comments