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

Factory-built housing hasn't taken off in California

https://www.latimes.com/california/story/2026-02-14/factory-built-housing-hasnt-taken-off-in-cali...
1•PaulHoule•2m ago•0 comments

Ask HN: Cognitive Offloading to AI

1•daringrain32781•2m ago•1 comments

Show HN: Upti – Track cloud provider incidents and get alerts

https://apps.apple.com/us/app/upti-cloud-status-monitor/id6757987553
1•ismailperim•2m ago•0 comments

Green Lumber Fallacy in Software Engineering

https://www.chrisbehan.ca/posts/green-lumber-fallacy-in-software
1•mooreds•3m ago•0 comments

Realistic Adversarial Testing of Computer-Use Agents in Web-OS Environments

https://arxiv.org/abs/2505.21936
1•yakkomajuri•4m ago•0 comments

Show HN: G13u.com An automated SRE for AI apps

https://g13u.com/
2•gerom•5m ago•1 comments

Documentary about Mozilla Firefox at pwn2own (part 1) [video]

https://www.youtube.com/watch?v=YQEq5s4SRxY
1•todsacerdoti•6m ago•0 comments

Ask HN: Do US presidents have less fiduciary liability than CEOs?

1•stopbulying•6m ago•2 comments

As a non-coder(HR professional) I built my first website all by vibe coding

2•VidhiKesarwani•9m ago•0 comments

America's most partisan voters hold the most voting power

https://www.npr.org/2026/02/22/nx-s1-5707254/power-trump-congress-house-representatives-voters-co...
5•rbanffy•10m ago•1 comments

Higher / Lower Game

https://quest.touchgrass.blog/
2•abdullah9•11m ago•1 comments

Six Math Essentials

https://terrytao.wordpress.com/2026/02/16/six-math-essentials/
2•digital55•14m ago•1 comments

Symplex, an open-source protocol semantic negotiation between distributed agents

https://github.com/olserra/symplex
1•olserra•14m ago•1 comments

Black-White Array: fast, ordered and based on with O(log N) memory allocations

https://github.com/dronnix/bwarr
1•platzhirsch•16m ago•1 comments

Show HN: OpenGoat, hierarchical orgs for OpenClaw agents

https://github.com/marian2js/opengoat
1•marian2js•16m ago•1 comments

An Unbothered Jimmy Wales Calls Grokipedia a 'Cartoon Imitation' of Wikipedia

https://gizmodo.com/an-unbothered-jimmy-wales-calls-grokipedia-a-cartoon-imitation-of-wikipedia-2...
4•rbanffy•17m ago•1 comments

Training a Human Takes 20 Years of Food

https://www.news18.com/world/training-a-human-takes-20-years-of-food-sam-altman-on-how-much-power...
2•Aldipower•18m ago•0 comments

The Origins of Agar

https://www.asimov.press/p/agar
1•mailyk•18m ago•0 comments

Dell PC teardown shows mechanically locked 12V-2×6 GPU power connector

https://videocardz.com/newz/dell-pc-teardown-shows-mechanically-locked-12v-2x6-gpu-power-connector
1•layer8•18m ago•0 comments

NanoClaw Moved from Apple Containers to Docker

https://twitter.com/Gavriel_Cohen/status/2025603982769410356
18•simplesort•22m ago•1 comments

Prefer If Statements to Polymorphism

https://htmx.org/essays/prefer-if-statements/
2•birdculture•23m ago•0 comments

I built Timeframe, our family e-paper dashboard

https://hawksley.org/2026/02/17/timeframe.html
1•saeedesmaili•23m ago•0 comments

Building a (Bad) Local AI Coding Agent Harness from Scratch

https://www.appsoftware.com/blog/building-a-bad-local-ai-coding-agent-harness-from-scratch
2•appsoftware•26m ago•2 comments

Centerview Partners settles dispute over junior banker's need for 8 hours sleep

https://www.fnlondon.com/amp/articles/centerview-partners-settles-dispute-over-junior-bankers-nee...
1•helsinkiandrew•27m ago•1 comments

Heliostat: Harnessing Ray Tracing Accelerators for Page Table Walks – ISCA 2025 [video]

https://www.youtube.com/watch?v=gJw8D0kxmF4
1•matt_d•27m ago•1 comments

Convert Any MCP to Code Mode MCP

https://twitter.com/cahidarda/status/2025629891908030697
2•cahid_arda•27m ago•1 comments

Baby Rudin

https://en.wikipedia.org/wiki/Principles_of_Mathematical_Analysis
1•sonabinu•27m ago•0 comments

Bootstrapping Is Not Security Paranoia

https://alganet.github.io/blog/2026-02-22-15-Bootstrapping-Is-Not-Security-Paranoia.html
1•gaigalas•36m ago•0 comments

Loops is a federated, open-source TikTok

https://joinloops.org/
2•Gooblebrai•39m ago•0 comments

Show HN: Claude Agent SDK for Laravel – Build AI Agents with Claude Code in PHP

https://github.com/mohamed-ashraf-elsaed/claude-agent-sdk-laravel
1•mohamedelsaed•40m ago•0 comments