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?

Fan Performance Database

https://www.cybenetics.com/index.php?option=fan-performance-database
1•picture•38s ago•0 comments

Rune – persistent context for AI coding tools

https://github.com/thecolourfoundation/rune
1•malixp•1m ago•0 comments

Pander Score: How much do AI models mirror what users believe?

https://sophronresearch.org/pander/
1•stared•1m ago•0 comments

Eberto Streaming Companion

https://eberto.net/top/us/movies/netflix
1•nkrycek•3m ago•0 comments

Optimizing Base58: up to 67× faster encoding and decoding

https://fluxrpc.com/blog/base58-optimization-solana-rpc
1•cloakd•5m ago•0 comments

Shares in humanoid robot firm Unitree surge 600% on Chinese stock market debut

https://www.theguardian.com/technology/2026/aug/19/unitree-shares-surge-humanoid-robot-firm-chine...
1•martyvis•9m ago•1 comments

Build your first FlaskTrack MCP agent

https://flasktrack.com/build-mcp-agent
1•boredumb•11m ago•0 comments

A multi-tenant SaaS built in a 92-hour AI-augmented engineering sprint

https://fast-and-flow-production.onrender.com/case-study
1•caredeo•11m ago•0 comments

IOmap Improvement for Linux 7.3 Takes EXT4 and XFS Performance Further

https://www.phoronix.com/news/IOmap-Linux-7.3-Faster
1•rbanffy•16m ago•0 comments

Greenhouse gas emissions of all world countries – 2025 report

https://edgar.jrc.ec.europa.eu/report_2025
1•leonidasrup•19m ago•0 comments

Rebuilding Linear's delta sync read path

https://linear.app/now/rebuilding-delta-sync-read-path
1•tosh•21m ago•0 comments

Supersonic, a cross-platform Subsonic client

https://github.com/supersonic-app/supersonic
1•tentacleuno•21m ago•0 comments

NASA images show crater carved by a SpaceX rocket that slammed into the moon

https://apnews.com/article/spacex-rocket-moon-crash-crater-52b76d61289c06b7d32348b082a8e6b8
1•bushwart•22m ago•0 comments

CS229 Lecture Notes [pdf]

https://cs229.stanford.edu/main_notes.pdf
1•tosh•22m ago•0 comments

Cloning takes a weekend, finding the 38% took months

https://dev.profullstack.com/~anthony/blog/021-post.html
2•buffer_overlord•27m ago•0 comments

Cerebras Overclocks WSE-3 Waferscale Engine to Boost Inference in "Nexus" CS-4

https://www.nextplatform.com/compute/2026/08/19/cerebras-overclocks-wse-3-waferscale-engine-to-bo...
1•rbanffy•29m ago•0 comments

Clop Returns with Custom Implant in Mass-Extortion Campaign

https://reliaquest.com/blog/clop-returns-with-custom-implant-in-mass-extortion-campaign/
1•nyku•34m ago•0 comments

Many Ways to Win

https://stephango.com/moats
1•futurecat•37m ago•0 comments

Nitrogen pollution from the sky is a likely driver of global vegetative greening

https://nsojournals.onlinelibrary.wiley.com/doi/10.1002/ecog.08631
1•vixen99•39m ago•0 comments

The Great ADHD Myth?

https://www.theguardian.com/tv-and-radio/2026/aug/18/the-great-adhd-myth-review-most-controversia...
1•Gupie•39m ago•0 comments

Oh Yeah That Guy

https://ohyeahthatguy.com/
1•4pkjai•39m ago•0 comments

"The most terrifying 11 hours of my life"

https://meduza.io/feature/2026/08/17/samye-zhutkie-11-chasov-v-zhizni
1•Michelangelo11•42m ago•0 comments

CapsLock Enhancement

http://capslock.vonng.com/
1•figmert•54m ago•0 comments

High Capacity Color Barcode

https://en.wikipedia.org/wiki/High_Capacity_Color_Barcode
1•plaguna•56m ago•0 comments

The Equations of Reasoning – Pathway AI

https://pathway.com/research/the-equations-of-reasoning
2•unprovable•56m ago•0 comments

OpenAI makes ChatGPT less 'human' for teens in new safety update

https://www.bbc.com/news/articles/czxqz91n5n8o
2•1659447091•56m ago•0 comments

US Military funding propelled China's robot dogs

https://www.reuters.com/world/asia-pacific/how-us-military-funding-propelled-chinas-robot-dogs-20...
2•ironyman•59m ago•0 comments

10M for Spirit Airlines data, a bargain and a question?

1•srguarapo•1h ago•0 comments

GLM 5.3 Available in OpenRouter

https://openrouter.ai/z-ai/glm-5.3
1•herlon214•1h ago•0 comments

BeneFITs: Bypassing Signature Verification in U-Boot SPL

https://www.binarly.io/blog/signature-verification-bypass-in-u-boot-spl
2•n0blenote•1h ago•0 comments