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

Investors commit quarter-billion dollars to startup designing "Giga" satellites

https://arstechnica.com/science/2025/12/investors-commit-quarter-billion-dollars-to-startup-desig...
1•BWStearns•5m ago•0 comments

Rails Pulse: Performance monitoring and debugging gems for Rails application

https://github.com/railspulse/rails_pulse
1•ksec•6m ago•0 comments

Tiger teeth, dried seahorses and shark fins sold illegally on Facebook

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

The Chinese Billionaires Having 100s of U.S.-Born Babies via Surrogate

https://www.wsj.com/us-news/chinese-billionaires-surrogacy-pregnancy-7fdfc0c3
9•jkuria•16m ago•0 comments

The Math of Universality

https://www.pma.caltech.edu/news/the-math-of-universality
1•ashishgupta2209•28m ago•0 comments

Black Pyramid, Alaska

https://vinyasi.substack.com/p/the-black-pyramid-of-alaska
1•vinyasi•32m ago•0 comments

Advanced Embedded Software Development at CU Boulder Final Projects

https://sites.google.com/colorado.edu/aesdf25finalprojects/home
3•mooreds•33m ago•1 comments

Tiobe Index for December 2025: R Joins the Top as SQL Climbs

https://www.techrepublic.com/article/news-tiobe-commentary-dec-2025/
5•smurda•39m ago•1 comments

Show HN: ZeroCRM – Simple CRM with Source Code

https://zerocrm.demo.codegres.com
1•Codegres•40m ago•0 comments

Is Times New Roman Better Than Calibri for the State Department?

https://www.nytimes.com/interactive/2025/12/13/us/calibri-font-times-new-roman-state-department.html
1•gaws•44m ago•0 comments

Sometimes you don't get your ice cream at the end

https://cezarcocu.com/blog/sometimes-you-dont-get-your-ice-cream-at-the-end
1•ggamecrazy•49m ago•0 comments

MartSpace

1•rb-rbloxk•57m ago•0 comments

Component Party – Compare JavaScript Frameworks

https://component-party.dev/?f=react-svelte5
3•joshdavham•1h ago•0 comments

Heavy metal is healing teens on the Blackfeet Nation

https://www.hcn.org/issues/57-11/heavy-metal-is-healing-teens-on-the-blackfeet-nation/
6•cdrnsf•1h ago•0 comments

Apple loses contempt appeal in Epic case

https://www.theverge.com/news/842991/apple-epic-appeal-loses-contempt
5•samuel246•1h ago•1 comments

Ask HN: Are we forcing LLMs to be State Machines?

2•kodiyak•1h ago•0 comments

Planning the Future of Gimp

https://www.patreon.com/posts/planning-future-144005216
1•marcodiego•1h ago•0 comments

360Brew Decoder-Only Foundation Model for Personalized Ranking and Reco

https://web.archive.org/web/20250129030709/https://arxiv.org/pdf/2501.16450
1•felineflock•1h ago•0 comments

Show HN: Wiki.txt

https://github.com/wikitxt/wiki.txt
2•tamnd•1h ago•1 comments

A look at an Android ITW DNG exploit

https://googleprojectzero.blogspot.com/2025/12/a-look-at-android-itw-dng-exploit.html
1•gslin•1h ago•0 comments

Modern SID chip substitutes [video]

https://www.youtube.com/watch?v=nooPmXxO6K0
3•vismit2000•1h ago•0 comments

Rocket Lab – 'Raise and Shine' Launch for JAXA [video]

https://www.youtube.com/watch?v=cMP328yoUu4
9•schappim•1h ago•0 comments

Deal or No Deal Game

https://jgbrwn.neocities.org/games/dond
2•indigodaddy•1h ago•1 comments

The state of enterprise AI – What we're learning about AI at work

https://openai.com/index/the-state-of-enterprise-ai-2025-report/
1•achow•1h ago•0 comments

Operation Cowboy

https://en.wikipedia.org/wiki/Operation_Cowboy
1•srl•1h ago•0 comments

Intel Nears $1.6B Deal for AI Chip Startup SambaNova

https://www.bloomberg.com/news/articles/2025-12-12/intel-nears-1-6-billion-deal-for-ai-chip-start...
6•pinewurst•1h ago•1 comments

Four AI Systems Negotiate Binding Framework for Viral Content Management

https://github.com/aiconvergence-collab/multi-ai-viral-uncertainty-pact
2•mrocelot1976•2h ago•1 comments

Show HN: Scrape websites into queryable Gemini RAG knowledge bases

https://apify.com/yoloshii/gemini-file-search-builder
1•yoloshii•2h ago•0 comments

Larval stage support engineering: great at what doesn't scale

https://thundergolfer.com/startups/support/2025/12/13/support-eng-stage-1/
2•thundergolfer•2h ago•0 comments

Online Piracy Can Boost Box Office Revenue, Study Suggests

https://torrentfreak.com/online-piracy-can-boost-box-office-revenue-study-suggests/
6•gslin•2h ago•1 comments