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?

Linux 7.4 Sound Changes Merged: "The AI Flood Continues"

https://www.phoronix.com/news/Linux-7.4-Sound
1•mikece•58s ago•0 comments

ArtCraft Changes Every 2 Minutes. So I Built Something to Watch It [video]

https://www.youtube.com/watch?v=wRkQf9IjJOE
1•krisgenre•1m ago•0 comments

The Open Garbage

https://carette.xyz/posts/the_open_garbage/
1•Brajeshwar•4m ago•0 comments

r/open source just banned AI, non-English speakers and more

https://www.theverge.com/ai-artificial-intelligence/1018217/reddit-opensource-ai-ban
1•Brajeshwar•4m ago•0 comments

Potluck – Dynamic documents as personal software

https://www.inkandswitch.com/potluck/
1•andsoitis•5m ago•0 comments

Case Legal IA App

https://caseapp.com.ar/
1•flakinson•5m ago•0 comments

Show HN: The fastest, most token-efficient iOS Simulator MCP for AI agents

https://github.com/NoMac-app/simulator-use
1•garymiklos•6m ago•0 comments

Effective Expressiveness

https://www.inkandswitch.com/malleable-software/effective-expressiveness/
1•andsoitis•6m ago•0 comments

R/open source bans all solo projects and projects using LLMs

https://www.reddit.com/r/opensource/comments/1xelcuf/your_tokens_arent_valuable_no_more_ai
2•schleck8•6m ago•0 comments

iPhone Duo Reports of Faulty Duo Hinges

https://forums.macrumors.com/threads/reports-of-faulty-duo-hinges.2492483/
2•nstj•8m ago•0 comments

Show HN: My biggest C# project: Game engine and programming lang

https://github.com/ArcadeMakerSources/ArcadeMaker/tree/master
1•themondayguy•9m ago•0 comments

Postgres FDW: Query Pushdown is a negotiation

https://clickhouse.com/blog/postgres-fdw-pushdown-negotiation
1•saisrirampur•12m ago•0 comments

Apollo's Slok Says AI Has Delivered Zero Payoff Outside of Tech

https://www.bloomberg.com/news/articles/2026-10-25/ai-provides-zero-payoff-to-s-p-493-outside-tec...
2•jmsflknr•14m ago•0 comments

How Much of a Harness Does a Strong Agent Need for Autonomous ML Engineering?

https://arxiv.org/abs/2609.40303
2•tchalla•15m ago•0 comments

Regent's Ground-Effect Vehicle Reimagines Coastal Travel

https://spectrum.ieee.org/ground-effect-vehicle
1•rbanffy•15m ago•0 comments

Crane – a text editor for large files

https://crane-editor.com
1•the-hangry-dev•15m ago•1 comments

MEPs urge EU ministers to act and bring an end to seasonal clock changes

https://www.thelocal.com/20261021/meps-urge-eu-ministers-to-act-and-bring-end-to-seasonal-clock-c...
2•Markoff•15m ago•1 comments

Show HN: TemplateBox – Free resume, invoice and mockup editors in the browser

https://templatebox.win/
2•Templatebox•16m ago•0 comments

Tailworm

https://tailworm.com/
2•sunils34•21m ago•0 comments

Show HN: Kolo – share your AI coding sessions with anyone

https://github.com/komovaar/kolo
4•whosgotch•22m ago•0 comments

Show HN: Kosh - Give the browser bookmarks a second life

https://addons.mozilla.org/en-US/firefox/addon/kosh/
7•havu12•22m ago•1 comments

Show HN: Teamzlab for FedEx

https://fedex.teamzlab.com/
1•mdhemalakhand•23m ago•0 comments

GitHub Gists Flooded with Spam

https://gist.github.com/discover
2•jdthedisciple•25m ago•2 comments

You Are Losing Weight. Why Are You So Angry?

https://julienreszka.com/blog/you-are-losing-weight-why-are-you-so-angry/
2•julienreszka•27m ago•0 comments

Empires of AI: The Rise and Fall of a New Global Order

https://www.foreignaffairs.com/china/empires-artificial-intelligence-niall-ferguson-eric-schmidt
1•bryanrasmussen•29m ago•0 comments

Show HN: Open-Source Cybersecurity Platform Uses AI Agents to Protect Businesses

https://medium.com/@thomasunise/this-open-source-cybersecurity-platform-uses-ai-agents-to-detect-...
15•modern_cmo•30m ago•3 comments

Slow Software

https://www.inkandswitch.com/slow-software/
1•andsoitis•32m ago•0 comments

Show HN: macOS window switcher replacement that keeps each Space separate

https://debutspace.com/
2•thomplth•35m ago•1 comments

The One Question I Can't Stand at Restaurants

https://www.theatlantic.com/culture/2026/10/restaurant-phone-number-question/688926/
2•masfuerte•36m ago•0 comments

To make AI morally good, tech companies are turning to religion

https://apnews.com/article/anthropic-moral-artificial-intelligence-religion-2bb91e3334fd6d732edf2...
1•geox•41m ago•2 comments