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?

Show HN: Loris Tunnel – an open-source desktop manager for SSH tunnels

https://github.com/RangerWolf/loris-tunnel-app
1•rangerwolf•1m ago•0 comments

The Computer at the Bottom of a Canal

https://negroniventurestudios.com/2026/07/18/the-computer-at-the-bottom-of-a-canal/
1•Kudos•2m ago•0 comments

Neither GCC nor Clang are compliant with standard C++

https://sebsite.pw/w/20260708-badstdcxx.html
1•jandeboevrie•4m ago•1 comments

Pal Routes: shortest Palworld 1.0 breeding routes from your owned Pals

https://palroutes.com/
1•AsterXing•5m ago•0 comments

Brazil Eyes Film Royalties and Drug Patents in US Tariff Retaliation

https://www.riotimesonline.com/brazil-us-tariff-film-royalties-drug-patents/
1•vrganj•11m ago•0 comments

Israeli ministers announce plans for illegal settlements in Gaza and West Bank

https://www.theguardian.com/world/2026/jul/18/israel-plan-new-illegal-settlements-gaza-west-bank-...
3•kubafu•12m ago•1 comments

Show HN: Fosnie – open-source self-hosted AI workspace for regulated teams

https://fosnie.dev/
1•bellapai•16m ago•0 comments

Wp2shell Pre Authentication RCE in WordPress Core

https://wp2shell.com/
1•Techbrunch•20m ago•1 comments

AI Mania Is Eviscerating Global Decision-Making

https://ludic.mataroa.blog/blog/ai-mania-is-eviscerating-global-decision-making/
3•bertman•21m ago•0 comments

Timeline Studio

https://github.com/MartinDelophy/ai-video-editor
1•martindelophy•23m ago•0 comments

Compaction

https://developers.openai.com/api/docs/guides/compaction
1•tosh•23m ago•0 comments

Cryptids

https://en.wikipedia.org/wiki/List_of_cryptids
2•tosh•25m ago•0 comments

We run 100% agentic coding at a €2M ARR healthcare SaaS

https://agenticprime.ai/issues/agentic-coding-healthcare-saas/
1•tosh•32m ago•0 comments

Flight Planning with Little Navmap

https://tech.marksblogg.com/little-navmap-flight-planning.html
1•marklit•33m ago•0 comments

Uruky – The Paid European Search Engine

https://robheghan.prose.sh/26_06_30_uruky
1•birdculture•36m ago•0 comments

Curated list of academic papers using Binary Ninja

https://github.com/affinepoly/awesome-binja-papers
2•affinepoly•36m ago•0 comments

JobsNate

https://www.jobsnate.com/
1•neodynix•39m ago•0 comments

Vikram-1, India's first private orbital rocket, aces debut launch

https://www.space.com/space-exploration/launches-spacecraft/skyroot-aerospace-india-first-private...
2•porridgeraisin•43m ago•0 comments

Behind the scenes: watching media on the browser (2021)

https://asyncimpulse.com/behind-the-scenes-watching-media-on-the-browser/
1•csmantle•45m ago•0 comments

External Commentary on LLM Global Workspace Representations [pdf]

https://www-cdn.anthropic.com/files/4zrzovbb/website/cc4be2488d65e54a6ed06492f8968398ddc18ebe.pdf
1•allenleee•45m ago•0 comments

US oil firms sign deals with Iraq to develop alternative shipping routes

https://apnews.com/article/oil-iraq-pipeline-deal-582b42f21cb62cfe8dc6c8e73d1dcafa
1•geox•47m ago•0 comments

Show HN: Yapp.page, publish a webpage from a Claude or ChatGPT chat

https://yapp.page/
1•hpko•52m ago•0 comments

The Sandpaper Cover of the Return of the Durutti Column (2014)

https://daily.redbullmusicacademy.com/2014/04/return-of-the-durutti-column-feature/
2•ravetcofx•54m ago•0 comments

Find What SaaS Tools Competitors Use via Sub-Processors

https://ashishb.net/tech/sub-processors-leak-saas-stack/
7•ashishb•1h ago•0 comments

How Reddit Detects Ban Evasion – and Why a New Account Isn't Enough

https://medium.com/@thesuperrepemail/how-reddit-detects-ban-evasion-and-why-a-new-account-isnt-en...
3•rajsuper123•1h ago•0 comments

DOSBox on OpenVMS (Alpha CPU)

https://astr0baby.online/AXP/OpenVMS/DOSBOX/
1•jandeboevrie•1h ago•0 comments

Vörwatch: The VPS Monitoring Tool

https://medium.com/@vektormemory/v%C3%B6rwatch-the-vps-monitoring-tool-we-built-because-we-needed...
1•vektormemory•1h ago•0 comments

Show HN: Free image tools that never upload your files

https://pixoratools.dev/
1•umarratra•1h ago•0 comments

A search for life on Earth (1993) [pdf]

https://gwern.net/doc/science/physics/astronomy/1993-sagan.pdf
1•mimorigasaka•1h ago•0 comments

AI Mania Is Eviscerating Global Decisionmaking

https://hermit-tech.com/blog/ai-mania-is-eviscerating-global-decisionmaking
1•olalonde•1h ago•0 comments