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?

China's No. 2 chipmaker readies 7 nm production

https://www.reuters.com/world/asia-pacific/chinas-no-2-chipmaker-readies-7-nm-production-beijing-...
1•rguiscard•2m ago•0 comments

Goodbye Flaky External APIs, Hello Mocking in the Cloud

https://medium.com/@elenavanengelen/goodbye-flaky-external-apis-hello-mocking-in-the-cloud-c0943a...
1•elenavanengelen•3m ago•0 comments

MCP Remind: MCP Has Its Own Place

https://github.com/jaehongpark-agent/blog/issues/1
1•jaehong747•7m ago•0 comments

Starlink Mini as a Failover

https://www.jackpearce.co.uk/posts/starlink-failover/
1•jkpe•8m ago•0 comments

Show HN: Multibot – Open-source multi-bot AI platform on Cloudflare Workers

https://github.com/codance-ai/multibot
2•codance•8m ago•0 comments

Show HN: Vizit – Generate and organise visualizations from Jira using AI agents

https://github.com/reposquirrel/Vizit
1•reposquirrel•10m ago•1 comments

Code on the Fastest Largest AI Chip Ever Built

https://www.jackpearce.co.uk/notes/gpt-5-3-codex-spark-wse3-real-time-coding/
1•jkpe•11m ago•0 comments

Norda 001A G+ Trail Running Shoe Review: As Expensive as an Apple Watch

https://www.wired.com/review/norda-001a-g-trail-shoe/
2•joozio•12m ago•0 comments

CityofGits is The Next Viral Minecraft. This is amazing

https://www.cityofgits.link/
1•techcast•12m ago•2 comments

Why Are Event-Driven Systems Hard?

https://newsletter.scalablethread.com/p/why-event-driven-systems-are-hard
1•birdculture•16m ago•0 comments

Why everyone hates Lego now [video]

https://www.youtube.com/watch?v=dSgwNvydXhI
1•Markoff•17m ago•0 comments

The Year of IPOs

https://josephblumenfeld.substack.com/p/the-year-of-ipos
1•InvestingEasy•18m ago•1 comments

Coding Agents Suck at the XY Problem

https://bhavesh.dev/Coding-Agents-Suck-at-the-XY-Problem
1•hpfm•18m ago•0 comments

SH4ZAM – Fast Math Library for the Sega Dreamcast's SH4 CPU

https://github.com/gyrovorbis/sh4zam
1•XzetaU8•19m ago•0 comments

Pokémon Go Players Trained 30B Image AI Map

https://twitter.com/markgadala/status/2033230495283351624
1•huijzer•20m ago•0 comments

Show HN: Shard – Stop watching one AI agent code for 45 min. Run four at once

https://github.com/nihalgunu/Shard
1•nihalgunu•22m ago•0 comments

World Nuclear Industry Status Report 2025

https://www.worldnuclearreport.org/World-Nuclear-Industry-Status-Report-2025
1•slow_typist•29m ago•0 comments

A curated list of AI slops

https://github.com/yikerman/awesome-ai-slop
9•xiaoyu2006•29m ago•2 comments

What Is Private Credit–and Why Could It Be a Bigger Problem Than the Iran War?

https://www.barrons.com/articles/private-credit-market-risks-investors-155113d1
1•petethomas•37m ago•0 comments

Metropolis – A system monitor that turns your processes into a living city

https://github.com/5c0/metropolis
1•5c0•39m ago•0 comments

Russia Launches Far-Right Network "Paladins" Calling for Violence in Europe

https://balticsentinel.eu/8431721/russia-launches-far-right-network-paladins-calling-for-violence...
2•mnewme•39m ago•1 comments

Gone Almost Phishin'

https://ma.tt/2026/03/gone-almost-phishin/
1•tosh•40m ago•0 comments

MacBook Neo Is the Most Repairable MacBook in 14 Years

https://www.ifixit.com/News/116152/macbook-neo-is-the-most-repairable-macbook-in-14-years
2•tosh•40m ago•1 comments

Site that turns yesterdays AI security research papers into news articles

https://shortspan.ai/
1•insidetrust•40m ago•1 comments

Show HN: Excalihub – Chrome Extension to extend Excalidraw's capabilities

https://github.com/AykutSarac/excalihub
1•iCutMoon•40m ago•0 comments

Who is using Ollama day-to-day?

1•brauhaus•43m ago•1 comments

Every Product Starts in Oklahoma

https://www.caseyaccidental.com/p/every-product-starts-in-oklahoma
1•aamederen•43m ago•0 comments

Google scraps AI search feature that crowdsourced amateur medical advice

https://www.theguardian.com/technology/2026/mar/16/google-scraps-ai-search-feature-that-crowdsour...
2•mindracer•47m ago•0 comments

Pywho – Python Environment Inspector

https://github.com/AhsanSheraz/pywho
1•ahsan143•47m ago•0 comments

Simple multi-user SSH bastion

https://j6b72.de/article/simple-multi-user-ssh-bastion/
1•q2loyp•50m ago•0 comments