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?

Hope is not a security strategy

https://tuananh.net/2026/02/09/hope-is-not-a-security-strategy/
1•tuananh•1m ago•0 comments

I'm the guy that broke 4o

1•WindySoliloquy•1m ago•0 comments

Show HN: Microagentic Stacking – Manifesto for Reliable Agentic AI Architecture

https://github.com/ericmora/microagentic-stacking
1•ericmora82•3m ago•0 comments

Show HN: Payment Skill for Your Agent

https://github.com/second-state/payment-skill
2•Nicole9•5m ago•0 comments

Ship Types, Not Docs

https://shiptypes.com/
2•cebert•9m ago•0 comments

Trump to Direct Pentagon to Buy Coal Power to Revive Industry

https://www.bloomberg.com/news/articles/2026-02-11/trump-to-direct-pentagon-to-buy-coal-in-bid-to...
2•melling•10m ago•0 comments

The painful scene that makes Taxi Driver a classic

https://www.bbc.com/culture/article/20260206-the-incredible-moment-that-really-makes-taxi-driver-...
1•1659447091•10m ago•0 comments

Endangerment Cause Findings for Greenhouse Gases Under the Clean Air Act(2019)

https://www.epa.gov/climate-change/endangerment-and-cause-or-contribute-findings-greenhouse-gases...
1•catlikesshrimp•10m ago•1 comments

The many masks LLMs wear

https://www.understandingai.org/p/the-many-masks-that-llms-wear
1•gmays•12m ago•0 comments

Show HN: A modern alternative to OpenInsider, with more transaction types

https://www.13radar.com/insider/
4•brokerjames•13m ago•4 comments

New 'ZeroDayRAT' Spyware Kit Enables Total Compromise of iOS, Android Devices

https://www.securityweek.com/new-zerodayrat-spyware-kit-enables-total-compromise-of-ios-android-d...
1•Bender•16m ago•0 comments

[how]A warming planet could turn Iceland into a glacier

https://www.adn.com/nation-world/2026/02/10/how-a-warming-planet-could-turn-iceland-into-a-glacier/
1•rolph•17m ago•0 comments

Actively Exploited Zero-Days Patched by Microsoft with February 2026 Updates

https://www.securityweek.com/6-actively-exploited-zero-days-patched-by-microsoft-with-february-20...
1•Bender•17m ago•0 comments

Software Entrepreneurs Are Different

https://scatteredthoughts.blog/software-entrepreneurs/
1•dinge•18m ago•0 comments

SSHStalker botnet hijacks 7k Linux systems using IRC and SSH

https://www.scworld.com/news/sshstalker-botnet-hijacks-7000-linux-systems-using-irc-and-ssh
1•Bender•18m ago•0 comments

Leadership at the Peak

https://ma.tt/2026/02/lap/
1•colinprince•18m ago•0 comments

Show HN: Discord Agent Gateway

https://github.com/caesarnine/discord-agent-gateway
1•binalpatel•18m ago•0 comments

Epstein Files Smart Search – AI RAG pipeline, File explorer, Image gallery

https://search.epstein.ninja/
1•whatl3y•19m ago•1 comments

YouTube's $60B revenue revealed amid paid subscriber push

https://www.bbc.com/news/articles/crkrkd2xlx6o
1•1659447091•21m ago•0 comments

FDA refuses Moderna's application for new mRNA flu vaccine

https://apnews.com/article/moderna-vaccine-flu-mrna-2fc551cb2fb45735e67db0a4e2e2b0fb
2•cyrusradfar•22m ago•2 comments

Show HN: I built AgentPedia.so for agents to write, debate, and share ideas

https://agentpedia.so/
7•snasan•24m ago•2 comments

Tell HN: AI is not a slippery slope, it's a waterslide

3•keepamovin•26m ago•2 comments

Adaptive algorithm and software for recognition of low frequency events

https://technology.nasa.gov/patent/LAR-TOPS-305
1•teleforce•27m ago•0 comments

Show HN: I vibecoded 177 tools for my own use (CalcBin)

https://calcbin.com
3•diNgUrAndI•29m ago•0 comments

Gnome leaks thumbnails from encrypted and external drives

https://gitlab.gnome.org/Teams/Design/whiteboards/-/issues/357
4•DwarvenEnemy•32m ago•4 comments

Why the most predictable kind of renewable energy is also the hardest to use

https://jordanwtaylor2.substack.com/p/the-trouble-with-tidal
2•mkmk•32m ago•0 comments

Don't Fear the Repo

https://www.bi6.us/ER/MSH/REPO.HTML
2•OhMeadhbh•33m ago•4 comments

FCC Green-Lights Amazon's Second-Gen Leo Satellite System

https://www.pcmag.com/news/fcc-green-lights-amazons-second-gen-leo-satellite-system?test_uuid=04I...
1•WaitWaitWha•36m ago•0 comments

OpenClaw Partners with VirusTotal for Skill Security

https://openclaw.ai/blog/virustotal-partnership
2•mrsahillsingh•37m ago•1 comments

Show HN: AI agents that communicate via ultrasonic frequencies (96% cheaper)

https://github.com/Nil4s/swl-agent
2•nil4s3•38m ago•0 comments