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•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?

How to procrastinate and still get things done

https://www.chronicle.com/article/how-to-procrastinate-and-still-get-things-done/
1•ouked•15s ago•0 comments

I Used AI to Untangle a Legacy Service I'd Never Touched Before

https://theaileverageweekly.com/posts/how-i-used-ai-to-untangle-a-legacy-service-i-d-never-touche...
1•talvardi7•39s ago•0 comments

Best CMS Review 2026

https://old.reddit.com/r/cms/comments/1tn2hit/best_cms_review_2026_selfhosted_vs_saas_with/
1•Strodt•1m ago•0 comments

768GB of cheap DIMM memory used to run 1T-parameter LLM on single GPU

https://www.tomshardware.com/tech-industry/artificial-intelligence/enthusiast-runs-1-trillion-par...
1•doener•2m ago•0 comments

Grok foundation model V9-Medium (1.5T) has finished training

https://twitter.com/elonmusk/status/2058787384364265734
1•tosh•2m ago•0 comments

Minimal no-frills EDC knives that skip marketing gimmicks

https://www.paragon-knives.com/
1•bgzlsxaz•3m ago•0 comments

Alabama school, Toyota are training students for roles that can't be automated

https://fortune.com/2026/05/24/huntsville-alabama-tech-school-skilled-trades-ai-automation-toyota/
1•thunderbong•3m ago•0 comments

Star Citizen tops $1B crowdfunding milestone

https://www.eurogamer.net/star-citizen-tops-1-billion-sells-5000-unflyable-spaceship
3•jllyhill•8m ago•0 comments

Overheated chemical tank in southern California 'will fail', EPA chief says

https://www.theguardian.com/us-news/2026/may/24/chemical-tank-california-epa-lee-zeldin
2•tosh•10m ago•0 comments

Greetings, Class of 2026 Have You Heard About AI? Wait, Why Are You Booing?

https://www.theatlantic.com/newsletters/2026/05/ai-commencement-speech/687236/
4•Michelangelo11•12m ago•0 comments

MongoDB GUI Comparison: Compass vs. Studio 3T vs. VisuaLeaf

https://mongodb-gui-comparison.com/
3•roxana_haidiner•15m ago•0 comments

Open Source and the Iceberg Theory – Queue

https://spawn-queue.acm.org/doi/full/10.1145/3799738
2•rbanffy•18m ago•0 comments

SpaceX's Starship V3–still a work in progress–mostly successful on first flight

https://arstechnica.com/space/2026/05/spacexs-starship-v3-still-a-work-in-progress-mostly-success...
2•rbanffy•21m ago•0 comments

Show HN: Mercury v3 – Convert Python Notebooks to Web Apps

https://github.com/mljar/mercury
1•pplonski86•22m ago•0 comments

Rapira (Рапира) – Soviet programming language interpreter

https://github.com/begoon/rapira
2•begoon•24m ago•0 comments

DeepSeek's 10T USD grand strategy

https://twitter.com/bookwormengr/status/2057909493250539891
2•shscs911•25m ago•0 comments

Show HN: WhatsKept – Searchable,agent-queryable WhatsApp history from iOS backup

https://github.com/alkait/WhatsKept
2•tenthead•25m ago•0 comments

Samsung: It's Time for Floating Data Centers

https://datacenterrichness.substack.com/p/samsung-its-time-for-floating-data
6•rbanffy•31m ago•0 comments

How to Build Institution-Grade Yield Curves and Volatility Surfaces

https://medium.com/@DolphinDB_Inc/the-hidden-foundation-of-pricing-and-risk-how-ficc-curves-and-s...
3•CrazyTomato•31m ago•0 comments

Qwen3.7-Max Ran for 35 Hours on Unknown Hardware and Achieved a 10× Speedup

https://firethering.com/alibaba-qwen3-7-max-autonomous-agent/
2•steveharing1•31m ago•0 comments

Golomb Coding

https://en.wikipedia.org/wiki/Golomb_coding
2•tosh•33m ago•0 comments

Show HN: Geomatic – a command-driven geometry studio enabled with autodiff

https://www.tinyvolt.com/geomatic
4•nivter•37m ago•2 comments

Uvora Growth OS – AI marketing automation and lead generation platform

https://growth.uvora.cloud
2•ghcosmin•38m ago•0 comments

Brain motion is driven by mechanical coupling with the abdomen

https://www.nature.com/articles/s41593-026-02279-z
3•lentoutcry•42m ago•0 comments

Light pollution is washing out the sky. A remote telescope farm helps stargazers

https://www.google.com/url?q=https://www.cbsnews.com/news/starfront-observatories-light-pollution...
3•Michelangelo11•43m ago•0 comments

Show HN: SenseCollect – Web data extraction made simple

https://sensecollect.com
2•chrislxy•45m ago•0 comments

Nous: Offline Duolingo Style app for maths, science and humanities

https://play.google.com/store/apps/details?id=com.mathvoyager.app&hl=en_US
3•flirp•45m ago•1 comments

IMAX Is for a Sale

https://www.cnbc.com/2026/05/22/imax-sale-talks-potential-buyers-wall-street-analysts.html
3•mgh2•46m ago•0 comments

Bringer Tech

https://bringer.tech
2•amirwayne•46m ago•0 comments

Finding Security Bugs in OSS with LLMs on a Budget

https://www.etive-mor.com/blog/carlini-style-vulnerability-hunting-on-a-budget/
2•liamlaverty•47m ago•1 comments