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?

Do you remember usability testing?

https://www.userium.com/
1•calmnordic•40s ago•0 comments

Agent Governance Toolkit: Open-source runtime security for AI agents

https://opensource.microsoft.com/blog/2026/04/02/introducing-the-agent-governance-toolkit-open-so...
1•tcbrah•50s ago•0 comments

The Melanesian: Dark-skinned people with blonde hair region of Oceania

https://guardian.ng/life/the-melanesian-dark-skinned-people-with-blonde-hair/
1•thunderbong•3m ago•0 comments

OpenNMC is an open network management card platform for APC SmartSlot UPS units

https://gitlab.com/netcube-systems-austria/opennmc
1•zdw•5m ago•0 comments

A all CLIs tokens and context reducer by 97%

https://www.squeezr.es/
1•sergioramosv•6m ago•1 comments

How we feel about AI (2025)

https://goauthentik.io/blog/2025-12-10-how-we-really-feel-about-ai/
1•walterbell•9m ago•0 comments

Show HN: Gecit – DPI bypass using eBPF sock_ops, no proxy or VPN

https://github.com/boratanrikulu/gecit
1•boratanrikulu•10m ago•0 comments

How to Get Better at Guitar

https://www.jakeworth.com/posts/how-to-get-better-at-guitar/
1•jwworth•11m ago•0 comments

Iran internet blackout now longest nation-scale shutdown on record

https://mastodon.social/@netblocks/116350984373909468
1•ukblewis•14m ago•0 comments

Show HN: Stablemount, a response to EmDash, a prototype for a future CMS

https://github.com/jhyolm/stablemount
1•jhyolm•14m ago•1 comments

Watch 'S4 – The Bob Lazar Story' online: Here's where to watch the UFO doc

https://www.tomsguide.com/entertainment/streaming/watch-s4-the-bob-lazar-story-online
1•evo_9•17m ago•0 comments

Show HN: YardSard – Inventory Management

https://apps.apple.com/us/app/yardsard/id6759114903
2•prithsr•21m ago•0 comments

Show HN: Imladri – Cryptographic enforcement and semantic monitoring for your AI

https://imladri.com/
2•osama872•23m ago•0 comments

AST vs. Bytecode: Interpreters in the Age of Meta-Compilation [pdf]

https://stefan-marr.de/downloads/oopsla23-larose-et-al-ast-vs-bytecode-interpreters-in-the-age-of...
3•tosh•24m ago•0 comments

Codex is switching to API pricing based usage for all users

https://help.openai.com/en/articles/20001106-codex-rate-card
6•ccmcarey•27m ago•1 comments

Francis Li

https://furclick.top/
2•menshowlee•33m ago•0 comments

Show HN: Regression-dog – A 20-line skill that reviews your code for regressions

https://github.com/imaman/skills/tree/main/skills/regression-dog
2•itay-maman•37m ago•0 comments

OpenRockets Archive New Submission(Autoscript)

https://archive.openrockets.com/Litha2024-main/
2•openrockets•37m ago•1 comments

Open source voice cloning TTS models worth trying

https://firethering.com/open-source-tts-voice-cloning/
2•steveharing1•37m ago•0 comments

Claude AI powered trading bot turns $1 into $3.3M on Polymarket

https://finbold.com/claude-ai-powered-trading-bot-turns-1-into-3-3-million-on-polymarket/
3•madaxe_again•39m ago•0 comments

Microsoft terms say Copilot is for entertainment purposes only, not serious use

https://www.tomshardware.com/tech-industry/artificial-intelligence/microsoft-says-copilot-is-for-...
39•jatins•40m ago•3 comments

We are facing the most significant days and weeks in world history since 1945

https://www.taxresearch.org.uk/Blog/2026/04/05/we-are-facing-most-significant-days-and-weeks-in-w...
3•only_in_america•40m ago•1 comments

iCloud appears to be down for some users

https://www.reddit.com/r/iCloud/s/GAahHRBNPX
3•FinnKuhn•45m ago•3 comments

Computational Physics (2nd Edition)

https://websites.umich.edu/~mejn/cp2/
3•teleforce•47m ago•0 comments

Open Source Elixir Personel Health Management

https://github.com/joestein/health-pilot
3•buoewe•48m ago•0 comments

Agile Development Is Dead Reckoning

https://paolog.net/posts/dead-reckoning-agile/
2•paologi•54m ago•0 comments

Inference Arena – new benchmark of local inference and training

http://kvark.github.io/ai/performance/2026/04/04/inference-arena.html
3•kvark•55m ago•1 comments

Show HN: Identa – CLI to calibrate prompts across local LLMs

3•srodriguezp•55m ago•0 comments

The Disposable Tools Manifesto

https://blog.vtemian.com/post/disposable-tools-manifesto/
4•vtemian•56m ago•0 comments

StackOverflow: Retiring the Beta Site

https://meta.stackoverflow.com/questions/438628/retiring-the-beta-site
19•stefankuehnel•58m ago•8 comments