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•10mo 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•10mo 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•10mo 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•10mo 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•10mo ago
Load test against a clone instead of a DB whose contents you care about?

Winners of the 2026 Kokuyo Design Awards

https://spoon-tamago.com/winners-of-the-2026-kokuyo-design-awards/
1•zdw•1m ago•0 comments

Musk asks SpaceX IPO banks to buy Grok AI subscriptions, NYT reports

https://www.reuters.com/business/finance/musk-asks-spacex-ipo-banks-buy-grok-ai-subscriptions-nyt...
1•1vuio0pswjnm7•2m ago•0 comments

Crafting Engineering Strategy: How Thoughtful Decisions Solve Complex Problems

https://craftingengstrategy.com
1•teleforce•3m ago•0 comments

Media scraper Gallery-dl is moving to Codeberg after receiving a DMCA notice

https://github.com/mikf/gallery-dl/discussions/9304
3•MoltenMonster•6m ago•0 comments

A "Unix-style tool" crashes with the –version flag

https://github.com/imbue-ai/mngr/issues/1165
2•typissedoff•6m ago•0 comments

An open-source 240-antenna array to bounce signals off the Moon

https://moonrf.com/
3•hillcrestenigma•11m ago•0 comments

Show HN: Multi-agent coding assistant with a sandboxed Rust execution engine

https://github.com/christianmeurer/Lula
4•chrismeurer•14m ago•1 comments

A local search engine for AI Agents

https://github.com/itsmostafa/qi
4•puremetrics•16m ago•1 comments

Better ClassPass Food Searching in Manhattan

https://adindrabkin.com/classpass-manhattan/
2•boxedadin•16m ago•0 comments

Show HN: Open-source ontology – SEC fund filings

https://github.com/getfundflow/gff-schema
2•scalefirst•20m ago•0 comments

Show HN: md-redline - inline review comments for markdown, readable by AI agents

https://github.com/dejuknow/md-redline
2•dejuknow•26m ago•0 comments

Your File System Is Already A Graph Database

https://rumproarious.com/2026/04/04/your-file-system-is-already-a-graph-database/
1•alxndr•27m ago•1 comments

The 1987 Game "The Last Ninja" was 40 kilobytes

https://twitter.com/exQUIZitely/status/2040777977521398151
3•keepamovin•30m ago•1 comments

Is AI the New Fracking?

https://www.ft.com/content/525cc89e-1ee9-4039-a588-5039565053f9
2•1vuio0pswjnm7•36m ago•0 comments

More Americans Are Breaking into the Upper Middle Class

https://www.wsj.com/economy/more-americans-are-breaking-into-the-upper-middle-class-bf8b7cb2
2•lxm•38m ago•0 comments

Show HN: Not a CLI, Toward a New Agent-Computer Interaction Model

https://agentina-agent-apps.vercel.app/
2•agentina•44m ago•1 comments

Show HN: Magma Memory Claude Browser cloaking tool

https://github.com/Vektor-Memory/Vektor-memory
2•vektormemory•47m ago•0 comments

The Spark – A sophisticated scrolling experience

https://spark.thedigitalpanda.com/
2•gitgud•58m ago•1 comments

Does coding with LLMs mean more microservices?

https://ben.page/microservices
4•jer0me•1h ago•0 comments

Kicking Off the ATP Working Group at the IETF

https://atproto.com/blog/kicking-off-the-atp-working-group
1•andrewl•1h ago•0 comments

Best Paper Awards in Computer Science over the past 30 years

https://jeffhuang.com/best_paper_awards/
3•vinhnx•1h ago•1 comments

Case study: recovery of a corrupted 12 TB multi-device pool

https://github.com/kdave/btrfs-progs/issues/1107
3•salt4034•1h ago•0 comments

Which is when I got to see what it looks like

https://technex.us/2026/04/while-humans-are-flying-to-the-moon-i-tried-to-build-an-earth-orbital-...
1•hparadiz•1h ago•1 comments

Before smart Siri, I made Agentic Quake Terminal

https://www.patreon.com/posts/154881456
3•rohanrhu•1h ago•0 comments

Show HN: I made a free daily puzzle game

https://www.nerdcube.games/carom
3•nerdcube•1h ago•2 comments

Moody – Give your MacBook a personality that reacts to hardware events

https://dinakars777.github.io/moody/
2•dinakars777•1h ago•1 comments

Show HN: LLM Wiki – Open-Source Implementation of Karpathy's LLM Wiki

https://llmwiki.app
2•lucasastorian•1h ago•1 comments

Show HN: The easiest way to generate AI stickers then get them in the mail

https://stickerdaze.com/
1•qhoc•1h ago•2 comments

New Copilot for Windows 11 includes a full Microsoft Edge package, uses more RAM

https://www.windowslatest.com/2026/04/05/new-copilot-for-windows-11-includes-a-full-microsoft-edg...
11•aaronsung•1h ago•2 comments

Association between Covid-19 vaccination and sudden death in younger individuals

https://journals.plos.org/plosmedicine/article?id=10.1371/journal.pmed.1004924
4•pseudolus•1h ago•2 comments