frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

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

Andy McLean: Rapidus MoU Boosts U.K. Access to 2-Nm Tech- EE Times

https://www.eetimes.com/andy-mclean-rapidus-mou-will-help-british-innovators-access-2-nm-technology/
1•rbanffy•2m ago•0 comments

Meta Employees Hate Zuckerberg's Plan for a Companywide AI Hackathon

https://www.wired.com/story/meta-employees-absolutely-hate-mark-zuckerbergs-hackathon-idea/
2•cdrnsf•6m ago•0 comments

Ask HN: Why did you open source your project?

1•david_shi•6m ago•0 comments

Micro Radar: a tiny open-source flight radar for your desk

https://github.com/AnthonySturdy/micro-radar
2•asturdy•7m ago•1 comments

You Can't Have Both Democracy and Billionaires

https://www.currentaffairs.org/news/you-cant-have-both-democracy-and-billionaires
1•jacquesm•10m ago•0 comments

Justice Department Decision to Allow Paramount Deal Surprised Investigators

https://www.wsj.com/business/media/justice-department-decision-to-allow-paramount-deal-surprised-...
1•JumpCrisscross•10m ago•0 comments

Qualcomm in Talks to Purchase Tenstorrent

https://www.reuters.com/technology/qualcomm-talks-buy-tenstorrent-information-reports-2026-06-15/
1•milleramp•12m ago•0 comments

Openfootmanager: Open-source football management simulation game

https://github.com/openfootmanager/openfootmanager
1•nateb2022•13m ago•0 comments

Show HN: AltiVerse: What If SIM, see different decisions affect an environment

https://github.com/LeoTheAIDev/Altiverse
3•leoTheCoderrr•14m ago•0 comments

SMTP Relay with Web Dashboard

https://github.com/toinbox/simplerelay
1•toinbox•15m ago•0 comments

Satellite Tracker 3D

https://satellitetracker3d.com/track?norad-id=44800
2•ColinWright•16m ago•0 comments

San Francisco Weighs PG&E Takeover Amid Soaring Utility Costs

https://www.kqed.org/news/12081882/san-francisco-has-been-trying-to-leave-pge-for-100-years-will-...
4•cdrnsf•20m ago•0 comments

Show HN: Phlox – Open-source self-hosted agentic web chat

https://github.com/robert-mcdermott/phlox
1•mcdermott•22m ago•1 comments

Show HN: A Framework with a Possible Application to Hybrid Cryptography

https://zenodo.org/records/20613435
2•A19dammer91•22m ago•0 comments

AWS WAF now lets content owners charge AI bots for access

https://aws.amazon.com/blogs/aws/aws-waf-adds-ai-traffic-monetization-capability-to-help-content-...
6•mak8•22m ago•0 comments

Why I Email Complete Strangers

https://www.goodinternetmagazine.com/why-i-email-complete-strangers/
5•karakoram•24m ago•0 comments

Show HN: Simple, lightweight, modern, turnkey, Java web server library

https://github.com/Petersoj/jet
1•Petersoj•25m ago•0 comments

Pinboard.in is not resolving DNS

https://pinboard.in
2•yevuard•25m ago•1 comments

The Backdoors Inside Smart Devices WSJ [video]

https://www.youtube.com/watch?v=apEPPKYgLL0
1•gastonmorixe•26m ago•0 comments

Show HN: When Will AI? – A timeline of top AI predictions

https://whenwill.ai
2•jaymeh13•27m ago•0 comments

What if it all came out?

https://nymag.com/intelligencer/article/your-digital-self-is-vulnerable.html
2•alwa•29m ago•0 comments

Passing Cloudflare Turnstile using two fingers

https://blog.gingerbeardman.com/2026/06/15/passing-cloudflare-turnstile-using-two-fingers/
2•zdw•31m ago•0 comments

DPBench: Structural Determinants of Multi-Agent LLM Coordination

https://arxiv.org/abs/2602.13255
1•najmul-hasan•33m ago•0 comments

Fedora 44 Gnome review – We're not in Kansas anymore

https://www.dedoimedo.com/computers/fedora-44-gnome.html
2•dxs•34m ago•0 comments

The Most Recognized English Word

https://irreal.org/blog/?p=13877
1•dxs•34m ago•0 comments

Show HN: Get your first set of users by supporting others

https://founderkarma.co
2•okiki-clickdrop•35m ago•0 comments

Node-Red 5 Released

https://nodered.org/blog/2026/06/09/version-5-0-released
2•kristopherleads•36m ago•1 comments

90s Kid – Nineties Nostalgia

https://notas.grod.es/en/90s-kid
1•grodes•36m ago•0 comments

Family Tree File Format Open Sourced by LDS Church (1984)

https://en.wikipedia.org/wiki/GEDCOM
2•henryoman•37m ago•2 comments

Cisco SD-WAN Manager arbitrary file write (CVE-2026-20262) – CISA KEV

https://hellorecon.com/blog/cve-2026-20262
2•slvnx•40m ago•0 comments