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

Binary GCD

https://gmplib.org/manual/Binary-GCD
1•tosh•3m ago•0 comments

Young sons of legendary U.S. marshal ride horseback from Oklahoma to New York

https://texascooppower.com/the-astonishing-ride-of-the-abernathy-boys/
1•mhb•6m ago•0 comments

Thoughts and Feelings Around Claude Design

https://samhenri.gold/blog/20260418-claude-design/
1•cdrnsf•6m ago•0 comments

OpenAI Proposes a 'Social Contract' for the Intelligence Age

https://www.noemamag.com/openai-proposes-a-social-contract-for-the-intelligence-age/
1•Brajeshwar•7m ago•0 comments

Show HN: TTS.ai

https://tts.ai/
1•nadermx•7m ago•0 comments

My personal website – a start to my internet home

https://alexarias.me/
1•AlexArias•7m ago•0 comments

Vibe Genomics: Sequencing Your Whole Genome at Home

https://vibe-genomics.replit.app/
1•moozilla•8m ago•0 comments

Show HN: Trained a 12M transformer on an ML framework we built from scratch

https://github.com/mni-ml/framework
1•caliandbust•8m ago•0 comments

Trappsec – Deception as a Developer Tool

https://trappsec.dev
2•kyuradar•11m ago•1 comments

Open Source SaaS Is Dead, AI Killed It

https://nmn.gl/blog/open-source-killed-ai
1•namanyayg•12m ago•0 comments

Claude –dangerously-skip-permissions –model Claude-Opus-4-5-20251101

1•deofoo•14m ago•0 comments

Salesforce Goes Headless: The Smart Self-Disruption Play

https://www.whatshotit.vc/p/whats-in-enterprise-itvc-494
1•jhonovich•14m ago•0 comments

The Best Sports Game Nobody Played [video]

https://www.youtube.com/watch?v=7cMc4M5QJvM
1•pulkitsh1234•17m ago•0 comments

Our World in Data

https://ourworldindata.org
2•dnw•18m ago•0 comments

Version 1.0 Released: WireGuard for Windows and WireGuardNT

https://lore.kernel.org/wireguard/CAHmME9pDd2JMcEuSgOKpXPhUB8FSO+rNJdTkXRzpLhK1_xW9Cg@mail.gmail....
2•zx2c4•19m ago•0 comments

Ask HN: Stable, self-hosted macOS VFS that works in 2026?

1•buibuibui•20m ago•0 comments

A short quest to build some Web Feeds

https://lzon.ca/posts/site/feeds/
1•jpmitchell•20m ago•0 comments

Scopeon – AI Observability – token breakdown, cache ROI, cost tracking, CI gates

https://github.com/sorunokoe/Scopeon
3•sorunokoe•21m ago•0 comments

(Gated) Secure Coding AI Prompt Library

https://newsletter.shehackspurple.ca/c/securemyvibe
1•shehackspurple•21m ago•1 comments

How the UK Retreated on Cloud and Called Its Local Media Band-Aid a Plan

https://www.techpolicy.press/how-the-uk-retreated-on-cloud-and-called-its-local-media-bandaid-a-p...
2•ripe•23m ago•0 comments

The blast radius problem with coding agents in bypass mode

https://www.arnaudp.dev/the-blast-radius-problem-running-your-coding-agent-in-yolo-mode/
1•gentle_bubble•24m ago•0 comments

College instructor turns to typewriters to curb AI-written work

https://sentinelcolorado.com/uncategorized/a-college-instructor-turns-to-typewriters-to-curb-ai-w...
2•gnabgib•25m ago•0 comments

Adobe Has Run Out of Allies

https://petapixel.com/2026/04/18/adobe-has-run-out-of-allies/
3•MBCook•29m ago•0 comments

50% of AI datacenters have been cancelled or "delayed"

https://www.youtube.com/watch?v=w-DVTHH1ux8
4•amanaplanacanal•32m ago•0 comments

Widgetfied: Multi-tenant widget platform and hosted pages for service businesses

https://widgetfied.com
1•guymorganb•33m ago•0 comments

Digital Ecosystems: Interactive Multi-Agent Neural Cellular Automata

https://pub.sakana.ai/digital-ecosystem/
2•SebastianSosa•34m ago•0 comments

What Emotion Goes Viral the Fastest? (2014)

https://www.smithsonianmag.com/science-nature/what-emotion-goes-viral-fastest-180950182/
1•chistev•37m ago•1 comments

Music discovery that works like flipping through record store bins

https://app.vinylbins.com/
1•dclatfel•38m ago•0 comments

Deep Scan Page Reader WCAG 2.2 Accessibility

https://webpossum.com
1•raphaelheide•39m ago•0 comments

How Are Calories in Foods Measured?

https://www.merckmanuals.com/home/multimedia/table/how-are-calories-in-foods-measured
1•georgecmu•40m ago•0 comments