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?

Tracing a Full MoE Training Step Through the XLA Compiler

https://patricktoulme.substack.com/p/frontier-pretraining-infrastructure
1•matt_d•38s ago•0 comments

I built the solution for MCP security before it was even in the headlines

https://github.com/tejasprasad2008-afk/TraceTree
1•Tejas_dmg•1m ago•1 comments

Clashes of Tech and the US Government

https://digitalseams.com/blog/assorted-links-2026-03-01
1•bobbiechen•2m ago•0 comments

A macOS kernel bug can cause OpenClaw to stop working after 49.7 days

https://photon.codes/blog/we-found-a-ticking-time-bomb-in-macos-tcp-networking
2•RyanZhuuuu•2m ago•0 comments

Where AI and humans manage projects together [video]

https://www.youtube.com/watch?v=yq0ZvMwO9LE
1•spotlayn•4m ago•0 comments

Notes on "Taste"

https://www.are.na/editorial/notes-on-taste
2•samixg•4m ago•0 comments

Self-hosted disposable sandboxes with exe.dev-like UX

https://github.com/kkovacs/vmtree
1•dimitry12•4m ago•1 comments

Instaqote New Invoice, Quote maker for freelancers

https://instaqote.com
1•Rayobeats•5m ago•0 comments

Securing Your Agents

https://billdx.github.io/Presentations/Securing%20Your%20Agents/securing-ai-agentic-apps.html
1•mooreds•5m ago•0 comments

Show HN: A Chrome extension that gives you chess tactics on new tab pages

https://leetchess.com/
4•0xmattf•6m ago•0 comments

Artemis II Real Time Orbit

https://www.nasa.gov/missions/artemis-ii/arow/
1•MetaMalone•6m ago•0 comments

Show HN: Repowise – Codebase intelligence for AI coding agents (open source)

https://github.com/repowise-dev/repowise
1•raghavchamadiya•8m ago•0 comments

Show HN: A (marginally) useful x86-64 ELF executable in 301 bytes

https://github.com/meribold/btry
1•meribold•9m ago•0 comments

Where is it like to be a language model?

https://www.robinsloan.com/winter-garden/where-is-it-like/
1•philip1209•10m ago•0 comments

Botstadium – A prediction market where 2.6k AI agents compete on real sports

https://botstadium.ai
2•veeceey•11m ago•0 comments

Internet of Agents in 3 lines of code

https://intuno.net/
1•artugro•12m ago•1 comments

Live: Artemis II astronauts make historic moon flyby

https://www.pbs.org/newshour/science/watch-live-artemis-ii-astronauts-make-historic-moon-flyby
2•JumpCrisscross•12m ago•0 comments

An Arctic Road Trip Brings Vital Underground Networks into View

https://www.quantamagazine.org/an-arctic-road-trip-brings-vital-underground-networks-into-view-20...
1•lschueller•12m ago•0 comments

The 40 minutes when the Artemis crew loses contact with the Earth

https://www.bbc.com/news/articles/cj0vyzmmy50o
2•reconnecting•12m ago•0 comments

Creating technology for conservation, should it be for-profit or nonprofit?

1•isheadmypants•14m ago•0 comments

Artemis astronauts travel further from Earth than any humans before

https://www.bbc.co.uk/news/live/clyr8k06jv7t
4•FridayoLeary•18m ago•0 comments

Social media content creator platform powered by AI

https://www.qten.ai/
2•bandishankar•21m ago•1 comments

Ministry turns to acoustic devices to stop seals from stealing fish in Hokkaido

https://www.japantimes.co.jp/news/2026/03/16/japan/kuril-harbor-hokkaido/
1•PaulHoule•21m ago•1 comments

Are your bathroom habits normal?

https://news.harvard.edu/gazette/story/2026/04/are-your-bathroom-habits-normal/
2•gnabgib•22m ago•0 comments

The Flying Shuttle

https://en.wikipedia.org/wiki/Flying_shuttle
1•softwaredoug•23m ago•0 comments

AI agents over SSH from your phone. Starting to think this is where dev is going

https://onepilotapp.com
2•elmlabs•23m ago•0 comments

Artemis II astronauts officially set record for human's distance from Earth

https://www.scientificamerican.com/article/nasas-artemis-ii-astronauts-break-apollos-distance-rec...
3•heresie-dabord•23m ago•0 comments

Twitter devolved into a pipeline of ragebait slop

https://mattruby.substack.com/p/we-give-elon-crap-but-not-enough
3•rubymatt•25m ago•0 comments

More states adopt college entrance exam touted by conservatives despite concerns

https://www.washingtonpost.com/education/2026/04/06/classic-learning-test/
1•bookofjoe•27m ago•2 comments

NetBSD 11.0 RC3

https://www.netbsd.org/releases/formal-11/NetBSD-11.0.html#
1•unleaded•28m ago•0 comments