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?

Attention is all we have: A conjectural theory of cognitive inequality

https://davidbessis.substack.com/p/attention-is-all-we-have
1•rzk•5m ago•0 comments

Compare robot recordings across runs

https://foxglove.dev/blog/compare-robot-recordings-across-runs
1•intrepidsoldier•6m ago•0 comments

Elevated Errors for Multiple Models

https://status.claude.com/incidents/vgz5psbjmt1h
3•rob•6m ago•0 comments

OpenAI web interface to Claude down, again

3•b112•8m ago•0 comments

Tether: iMessage, SMS, etc. on Linux

https://zackbartel.com/blog/2026/08/tether/
2•zackb•10m ago•0 comments

Show HN: Scalattice Modelmeter. OSS price and latency bench for open models

https://scalattice.com/blog/modelmeter/
1•RomulusHill•10m ago•0 comments

Show HN: Searchable Stripe test cards with one-click copy

https://checkoutpage.com/tools/stripe-test-cards
1•fishsander•14m ago•0 comments

I Rented a 96 GB GPU and Took Uncensored Qwen3.8 From 44 to 125 tok/s

https://aseemshrey.com/blog/running-qwen3-8-27b-uncensored/
2•LuD1161•14m ago•0 comments

Show HN: Open-source calculator for "will my GPU run this LLM?"

https://jaeseok614.github.io/llm-gpu-checker-ko/
2•jaeseok614•15m ago•0 comments

Claude Is Down?

6•tuleiff•18m ago•6 comments

Show HN: Turn everything you read into things you write

https://sidelong.app
2•whatcha•20m ago•0 comments

Texas Gov. says data centers deserve the backlash: 'They dug their own grave'

https://www.businessinsider.com/greg-abbott-texas-data-centers-backlash-2026-8
3•dgellow•24m ago•0 comments

5% of venture capitalists have generated roughly 90% of the industry's profits

https://www.thevccorner.com/p/100-best-performing-vc-firms-ranking-2026
1•koolhead17•29m ago•0 comments

Executable Is a SQLite Database

https://fzakaria.com/2026/08/23/your-executable-is-a-sqlite-database
2•setheron•31m ago•0 comments

The Absolute State of Management

https://infrequently.org/2026/07/state-management/
1•luu•31m ago•0 comments

Mourning Steve French

https://lwn.net/Articles/1090098/
2•mfrw•32m ago•0 comments

The agent that writes the code cannot read the tests that grade it

https://medium.com/@giladha/the-agent-that-writes-the-code-cannot-read-the-tests-that-grade-it-b4...
1•giladha•32m ago•0 comments

AI Is Quietly Draining the Public Internet of Thought

https://twitter.com/BrianRoemmele/status/2091127620431933780
7•nreece•37m ago•1 comments

Observare – one monitoring service instead of five

https://observare.co.uk/
1•5uth3r1ano•42m ago•0 comments

Tesla's Biggest Design Mistake May Be Hiding in Plain Sight

https://www.forbes.com/sites/peterlyon/2026/08/22/teslas-biggest-recall-yet-exposes-a-dangerous-p...
2•FireBeyond•47m ago•1 comments

Moonshine STT adds domain customization

https://moonshine-voice.readthedocs.io/en/latest/models/domain-customization/
1•Curiositry•49m ago•0 comments

Nearly 3M Teslas recalled in China over hidden door handles

https://www.bbc.com/news/articles/c4g6ggdg030o
36•chicken-stew•51m ago•23 comments

Show HN: AltCaption – generate HTML-ready image alt attributes

https://altcaption.com/alt-attribute-generator
1•hboon•52m ago•0 comments

Minimus Is Ending Operations

https://www.minimus.io
4•markiannucci•1h ago•0 comments

Six opportunities for scientists and engineers to learn programming with AI [pdf]

https://pg.ucsd.edu/publications/scientists-engineers-learning-programming-using-ai_CiSE-2023.pdf
3•azhenley•1h ago•0 comments

GitHub tag: "token-optimization" – List of token consumption reduction software

https://github.com/topics/token-optimization
1•peter_d_sherman•1h ago•0 comments

All-in-one tool and config for Claude-things

https://github.com/damusix/atomic-claude
3•daniloa•1h ago•0 comments

Tobi Lutke builds walgit in a weekend

https://twitter.com/tobi/status/2091678506992222258
3•cpstein•1h ago•0 comments

Sabatier Principle

https://en.wikipedia.org/wiki/Sabatier_principle
2•peter_d_sherman•1h ago•0 comments

AIs are companies, my friend

https://www.strangeloopcanon.com/p/ais-are-companies-my-friend
4•walterbell•1h ago•0 comments