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?

Kache v0.21:caching C/C++ links,nvcc objects,and the Clang-CL flags Firefox uses

https://github.com/kunobi-ninja/kache/releases/tag/v0.21.0
1•ainhoaa•2m ago•0 comments

A 386 PC for Your RP2350

https://github.com/rh1tech/frank-386
1•SamuraiLion•6m ago•0 comments

EuroBirdPortal – Live bird movements across Europe

https://www.eurobirdportal.org/ebp/en/
1•NKosmatos•6m ago•0 comments

Sharden: A mineable coin for paying miners

1•Shardhash•8m ago•0 comments

Reverse Engineering Google's TPUs

https://gherkinlabs.com/reverse-engineering-google-tpus
3•goldenarm•11m ago•0 comments

Disclock – Discord timestamp converter with timezone preview

https://disclock.io/
1•louisdc•13m ago•0 comments

Recursive Self-Improvement (RSI)

https://github.com/theseus-labs-rsi/awesome-rsi
1•jonbaer•14m ago•0 comments

This Year I Vibecoded My Taxes

https://capocasa.dev/this-year-i-vibecoded-my-taxes
1•capocasa•15m ago•0 comments

Ask HN: What do you run behind Kafka for log collection and search?

1•whsoul•17m ago•0 comments

Show HN: A web based 4-channel Music Tracker

https://johnoestmannmusic.com/1000-SOS/0007/
1•soundworlds•18m ago•0 comments

Show HN: Build Morocco

https://build-morocco.vercel.app/
1•saadmrb•19m ago•0 comments

When code costs nothing to generate, open source is the only defensible moat

https://joost.blog/open-source-agency/
1•amoriz•19m ago•2 comments

Ultrastorage: Supercharged LocalStorage

https://github.com/yangshun/ultrastorage
1•doppp•20m ago•0 comments

The Last AI Built by Humans: Toward Genuine Recursive Self-Improvement

https://arxiv.org/abs/2609.11873
1•jonbaer•23m ago•0 comments

We are all Product Engineers Now

https://seldo.com/posts/we-are-all-product-engineers-now/
1•max-ch•23m ago•1 comments

GPT-6 Astra solves puzzles

https://quesma.com/blog/gpt-6-astra-solves-puzzles/
1•stared•23m ago•0 comments

How does call center headset noise canceling filter out keyboard sounds?

1•beienchina•23m ago•1 comments

How Good Are Frontier Models at Physics? Expert Re-Grading Reveals Broken

https://arxiv.org/abs/2609.13009
1•sbulaev•25m ago•0 comments

MPs and Lords call for new law to address AI threat to human rights

https://www.bbc.co.uk/news/articles/cwyzvgj70y4o
2•chrisjj•36m ago•0 comments

OpenArch – PyTorch implementations of modern LLM architectures

https://github.com/anuj0456/OpenArch
2•anuj0456•37m ago•2 comments

Tesla owners to get insurance discount if they use self-driving

https://www.afr.com/companies/transport/tesla-owners-to-get-insurance-discount-if-they-use-self-d...
2•Alien1Being•40m ago•1 comments

1.8x faster than GitHub Actions

https://ogirardot.writizzy.blog/p/rickub-1-8-faster-then-github-actions
1•ssaboum•40m ago•1 comments

Would you like to be a helpful idiot to our AI overlords? [video]

https://www.youtube.com/watch?v=CZB7wlYbknM
1•gilfoyle_7•45m ago•0 comments

An open-source diagram skill for designer

https://github.com/cathrynlavery/diagram-design
1•Nina_antalpha•47m ago•0 comments

Is PDF a Problem for AI?

https://pdf4wcag.com/blog-news/is-pdf-a-problem-for-ai
1•JilBill•54m ago•1 comments

Finding All Solutions to LinkedIn-Queens Puzzle

https://wyounas.github.io/model-checking/puzzles/2026/06/06/finding-all-solutions-to-linkedin-que...
1•simplegeek•57m ago•0 comments

SpaceX sues to block release of tax-break records for its Texas Terafab project

https://www.businessinsider.com/spacex-terafab-tax-break-records-ai-transparency-texas-2026-9
6•snikolaev•57m ago•0 comments

Show HN: 1080p is 920px tall – 1k real browser viewports

https://screensize.net/reports/viewport-stats
5•zenpe•57m ago•0 comments

Language Makes Power Feel Like Common Sense

https://linguistically.substack.com/p/antonio-gramsci-how-language-makes
1•akbarnama•58m ago•0 comments

Australian insurer offers discount to self-driving car owners

https://www.smh.com.au/business/consumer-affairs/humans-make-mistakes-insurer-offers-discount-to-...
2•Alien1Being•59m ago•0 comments