frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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?

Show HN: An update to our long-turn FreeCiv experience

https://freeciv.andrewmcgrath.info/
1•verelo•35s ago•0 comments

StumbleTV: Chat Roulette but for Exposed Webcams

https://stumbletv.alectrocute.workers.dev/c/2e6ff336f1235cc1
1•arm32•2m ago•0 comments

The millionaires tax was pitched as a $2B revenue source. It's blown past that

https://www.bostonglobe.com/2026/05/25/metro/millionaires-tax-massachusetts/
1•ceejayoz•5m ago•0 comments

Delaware court upholds voting by companies in small town's election

https://www.reuters.com/legal/government/delaware-court-upholds-voting-by-companies-small-towns-e...
1•anigbrowl•5m ago•0 comments

Poll: Would you allow a first generation plumber robot in your home?

1•Bender•14m ago•1 comments

Amazon Strikes $6B Deal with Snowflake for Agentic Computing Chips

https://www.wsj.com/tech/amazon-strikes-6-billion-deal-with-snowflake-for-its-agentic-computing-c...
1•jpau•14m ago•0 comments

Breaking Rust

https://en.wikipedia.org/wiki/Breaking_Rust
1•petethomas•17m ago•0 comments

Agents can sign up for Composio

https://composio.dev/blog/your-agents-can-signup-for-composio
1•mooreds•17m ago•0 comments

Xania Monet

https://en.wikipedia.org/wiki/Xania_Monet
1•petethomas•18m ago•0 comments

Agent Security Is a Systems Problem

https://arxiv.org/abs/2605.18991
1•yakkomajuri•22m ago•0 comments

Attrition: The Chinese Family Collapse

https://www.strategypage.com/htmw/htatrit/articles/2026052754034.aspx
1•skmurphy•22m ago•1 comments

The Authorization Paradox: Who Has the Keys to Your AI? [video]

https://www.youtube.com/watch?v=5UUpxgcGKXk
1•mooreds•24m ago•0 comments

GitMo – Auto sync your local project files to GitHub while you work.

https://github.com/KyleBenzle/GitMo/tree/main
1•WWIII_Historian•27m ago•0 comments

Ansel: Complete Pipeline Overhaul

https://ansel.photos/en/news/complete-pipeline-overhaul/
1•neucoas•31m ago•0 comments

Dutch block US takeover of Solvinity as against public interest

https://www.reuters.com/technology/dutch-government-block-takeover-cloud-services-company-solvini...
3•rectang•38m ago•1 comments

Show HN: Liiists, a Markdown-first, iOS and CLI list app

https://github.com/djt53/liiists
1•dtingle•38m ago•0 comments

What Will Happen When the AI Barons Give Back?

https://www.nytimes.com/2026/05/27/opinion/ai-philanthropy-charity.html
1•berkeleyjunk•40m ago•0 comments

You Should Not Update Your Dependencies

https://www.mendral.com/blog/you-should-not-update
7•OlivierCG•41m ago•0 comments

Atom Exhaustion Is Not a Footgun. It's One Third of Our CVEs

https://www.erlef.org/blog/eef/atom-exhaustion
1•croottree•42m ago•0 comments

A non-coding coding agent

https://zserge.com/posts/socreates/
1•croottree•43m ago•0 comments

OpenDisplay – open standard for e-paper screens

https://opendisplay.org/
2•balloob•46m ago•0 comments

Building the Future of Accessible Tech: Inside Uvilox AI

https://uvilox-aiwebsite.pages.dev/
1•Pallav123•47m ago•0 comments

Monome at Twenty

https://monome.org/twenty
2•robenkleene•47m ago•0 comments

Monome at 20: memories of the grid, in pictures

https://cdm.link/monome-at-20-memories-of-the-grid-in-pictures/
1•robenkleene•48m ago•0 comments

Did Newton know that force is mass times acceleration?

https://hsm.stackexchange.com/questions/19441/did-newton-know-that-force-is-mass-times-acceleration
2•kristianp•52m ago•0 comments

Am I a Bad Friend?

https://drobinin.com/posts/am-i-a-bad-friend/
2•valzevul•53m ago•0 comments

Balcony solar could help fight rising US utility costs

https://www.theguardian.com/environment/2026/may/27/balcony-solar-panels-rising-utility-costs
3•ottoboney•54m ago•0 comments

Ask HN: How to live life before AGI

3•atleastoptimal•54m ago•5 comments

German child killer Magnus Gaefgen awarded damages (2011)

https://www.bbc.com/news/world-europe-14408657
1•petethomas•55m ago•0 comments

FBI Arrests CIA Official with $40M in Gold Bars in His Home

https://www.nytimes.com/2026/05/27/us/politics/fbi-arrest-cia-official-gold-bars.html
9•cwwc•1h ago•2 comments