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?

Cisco to buy unit 8200 affiliated company that tracks all your API keys

https://www.timesofisrael.com/us-tech-giant-cisco-buys-israeli-ai-cyber-startup-to-protect-digita...
1•neuroelectron•5m ago•0 comments

Supreme Court signals it may end Cisco human rights suit

https://www.washingtonpost.com/politics/2026/05/02/supreme-court-cisco-torture-china/
1•neuroelectron•7m ago•0 comments

Denial of Service Vulnerability in React Server Components

https://github.com/facebook/react/security/advisories/GHSA-rv78-f8rc-xrxh
1•karimf•9m ago•0 comments

Could Lovable's automatic 10% pay raise be the cure for toxic cultures?

https://techcrunch.com/2026/05/07/could-lovables-automatic-10-pay-raise-be-the-cure-for-toxic-cul...
2•dicksent•9m ago•0 comments

Trump Is Getting Away with Murdering an American Industry

https://heatmap.news/plus/the-fight/spotlight/trump-federal-aviation-administration-wind-farms
2•gok•14m ago•0 comments

I designed Microsoft's EA channel in 2001. It's being dismantled in 2026

https://www.brendanoconnor.net/case-studies/microsoft-enterprise-channel/
1•brendo_y•15m ago•0 comments

Copy Fail 2: Electric Boogaloo

https://github.com/0xdeadbeefnetwork/Copy_Fail2-Electric_Boogaloo
3•larusso•18m ago•0 comments

Tailscale is down

https://status.tailscale.com/incidents/01KR2VHMYPMHVS821CJRD4Q3N9
2•bithavoc•19m ago•0 comments

Ask HN: Does CopyFail make a stronger case for rolling releases such as Arch?

1•fullstacking•23m ago•1 comments

Higher usage limits for Claude and a compute deal with SpaceX

https://www.anthropic.com/news/higher-limits-spacex?id=19234
2•alex_young•27m ago•1 comments

NIST – How Do You Measure It?

https://www.nist.gov/how-do-you-measure-it
1•rramadass•27m ago•1 comments

US will start revoking passports for parents who owe child support

https://apnews.com/article/passports-unpaid-child-support-penalty-state-department-42d90cfa8a06ee...
2•OutOfHere•27m ago•0 comments

Show HN: jj diff review integrated with agents

https://twitter.com/plannotator/status/2052594084527677612
1•ramoz•27m ago•0 comments

Digging into Drama at the Document Foundation

https://lwn.net/Articles/1066418/
1•signa11•27m ago•0 comments

Coming of Age

https://dirt.fyi/article/2026/05/coming-of-age
1•colinprince•28m ago•0 comments

Most bad analytics is a translation problem, not a tooling problem

https://lowhangingdata.com/article/telephone-game-bad-analytics/
1•mryagerr•29m ago•0 comments

Sunburn inspired a new way to store energy

https://www.bbc.com/news/articles/c62l9gnx775o
1•eptityri•30m ago•0 comments

QuickTools Pro – Free browser-based utility suite

https://fascinating-crepe-d7b325.netlify.app/
1•chbayah•33m ago•0 comments

Am I over reacting?

https://talkboy.org/s/DgwuLPHR
1•reieicucv•36m ago•0 comments

Guitar tuner that uses phone accelerometer

https://tautme.github.io/phone-sensors/accel-tuner.html
2•adm4•36m ago•1 comments

Life Layering

https://longevity.stanford.edu/michael-clinton-on-life-layering/
1•andsoitis•41m ago•0 comments

Utah data center: Projected daily heat equivalent to 23 atomic bombs

https://www.abc4.com/news/northern-utah/box-elder-data-center-heat-atomic-bombs/
5•WarOnPrivacy•42m ago•5 comments

New York state set to ban law enforcement, including ICE, from wearing masks

https://www.reuters.com/legal/government/new-york-state-set-ban-law-enforcement-including-ice-wea...
20•tartoran•42m ago•2 comments

AWS says data center overheating in North Virginia disrupts services

https://www.reuters.com/business/retail-consumer/amazon-cloud-unit-says-data-center-overheating-n...
6•christhecaribou•47m ago•1 comments

Replit's Amjad Masad on Cursor deal, Apple fight, and why he'd rather not sell

https://techcrunch.com/2026/05/01/replits-amjad-masad-on-the-cursor-deal-fighting-apple-and-why-h...
1•gmays•49m ago•0 comments

Sley is live: the first native AI programming language

https://github.com/GreyforgeLabs/sley
1•Greyforge•53m ago•2 comments

Evaluating Geekbench 6

https://chipsandcheese.com/p/evaluating-geekbench-6
1•wmf•1h ago•0 comments

Canadian sues DHS over alleged Google data grab tied to social media posts

https://www.cbc.ca/news/world/us-dhs-aclu-lawsuit-canadian-john-doe-9.7187851
4•cdrnsf•1h ago•1 comments

How to Generate Terraform from Existing AWS Resources

https://www.ops0.com/blog/generate-terraform-from-existing-aws-resources
1•sureshpaulchamy•1h ago•0 comments

Worlds first OptoSAR Satellite launched

https://www.indiatoday.in/science/story/galaxeye-mission-drishti-optosar-satellite-launch-india-p...
3•raks619•1h ago•0 comments