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?

TA TA: A Human-Owned Autonomous Agent Operating System

https://zenodo.org/records/24123263
1•toccter•47s ago•0 comments

CachyOS November 2026 Release: Easy Anti-Cheat Support

https://cachyos.org/blog/2611-november-release/
2•joshcsimmons•14m ago•0 comments

Google Chrome dev team declares bug report bankruptcy

https://blog.plover.com/2026/11/18/#bug-reports
3•AndrewDucker•15m ago•0 comments

How the Riemann Hypothesis was cracked [video]

https://www.youtube.com/watch?v=PjGlt3y-Nco
1•jonbaer•16m ago•0 comments

Why are so many services using email magic links for login?

6•bfbf•18m ago•2 comments

Stuck in Awe

https://darshanmakwana412.github.io/2026/11/stuck-in-awe/
1•martianvoid•19m ago•0 comments

Just a Few Bugs

https://www.justafewbugs.xyz/
4•jjjegly•23m ago•0 comments

Show HN: Run LLM Benchmarks at 1/10th of the cost

https://benchmarkrouter.newmeasure.ai/
2•abhishek203r•24m ago•0 comments

Show HN: A PDF/DOC editor that changes text in its original font, in the browser

https://quicktou.ch/
2•pierrickl•27m ago•0 comments

Walt Whitman, Shortly After His Stroke, on What Makes Life Worth Living

https://www.themarginalian.org/2017/12/20/walt-whitman-specimen-days-meaning-of-life/
1•robtherobber•28m ago•0 comments

Looped Weight-Space Programming: use AI to set model weights

https://twitter.com/ahmedmm72234641/status/2124869402634129901
1•anonu•30m ago•0 comments

SignafAIde- check AI agent tool calls before they run, verify offline

https://github.com/AIME-TECH-UK-LIMITED/signafaide-sdk
1•dief0001•30m ago•0 comments

Holding the Door for Agents

https://fly.io/blog/holding-the-door-for-agents/
1•ac-ciano•30m ago•0 comments

Jevons Paradox in AI: Cheaper Tokens Won't Pay for Capex

https://philippdubach.com/posts/cheaper-ai-tokens-wont-pay-for-capex/
6•DonAtimator•31m ago•0 comments

Novanetflow

https://www.novanetflow.com/
1•maddphoto•32m ago•0 comments

Show HN: InterviewLint–The Thinking-First technical interview platform

https://interviewlint.com/
1•aburayhanalif•36m ago•0 comments

Mitigeddon by Datadog

https://mitigeddon.ai/
4•janandonly•36m ago•0 comments

Building Our E-Ink Family Calendar

https://acelpb.com/posts/2026-11-02-Four-years-in-the-basement/
2•aborsu•37m ago•0 comments

Mitigeddon: Real-world exploitation and prevalence data

https://securitylabs.datadoghq.com/articles/introducing-mitigeddon/
3•janandonly•37m ago•0 comments

Megaspeed added to entity list (export controls for US companies) [pdf]

https://public-inspection.federalregister.gov/2026-23999.pdf
1•jsiepkes•39m ago•0 comments

Show HN: AraBrief – create personal radio with your briefings between music

https://www.arabrief.com/en
1•pplonski86•41m ago•0 comments

A free Python course in the browser that ends with building a tiny GPT

https://paulspythoncourse.com/
3•bouwles•43m ago•0 comments

Manticore Search 32.1.3: Direct-to-disk bulk import and faster search

https://manticoresearch.com/blog/manticore-search-32-1-3/
5•GloVin•45m ago•0 comments

Why Transcoding and ABR Require Autoscale

https://www.red5.net/blog/why-transcoding-and-abr-require-autoscale/
2•mondainx•46m ago•0 comments

Merchants. 12 Months. Zero Fees

2•MarketPay•48m ago•0 comments

Securing Python projects from supply-chain attacks

https://astral.sh/blog/securing-from-supply-chain-attacks
1•xxmarkuski•49m ago•0 comments

Rats tricked into traps using human marketing tricks, study shows

https://www.abc.net.au/news/science/2026-11-23/tricking-rats-into-traps-with-human-marketing-psyc...
3•bushwart•51m ago•0 comments

After 8 decades in operation Rocket Amateur Radio in Akihabara closed yesterday

https://www.reddit.com/r/japanresidents/comments/1y40oyi/end_of_an_era_after_8_decades_in_operati...
3•SenHeng•53m ago•0 comments

CVE-2026-124851: information disclosure vulnerability in ZSTD 1.5.1 to 1.5.7

https://www.facebook.com/security/advisories/cve-2026-124851?_fb_noscript=1
5•st_goliath•53m ago•2 comments

Ernie 5.5 Flash Preview is now open source

https://huggingface.co/baidu/ERNIE-5.5-Flash-Preview
5•pretext•56m ago•0 comments