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?

People of ACM – Russ Cox

https://www.acm.org/articles/people-of-acm/2026/russ-cox
1•signa11•1m ago•0 comments

Show HN: Columnary, a better experience for reading long articles

https://chromewebstore.google.com/detail/columnary/dechndjpekelnmgcchblfbmcceonfdoo
2•exclipy•3m ago•0 comments

Report supporting Australia's teen social media ban appears to contain AI

https://www.theguardian.com/australia-news/2026/aug/17/australia-social-media-ban-report-ai-hallu...
1•sbulaev•6m ago•0 comments

Facebook Perl source code from 2005

https://gist.github.com/philfreo/7257723
2•zdkaster•8m ago•0 comments

Git Links

https://replicated.live/blog/link
1•gritzko•11m ago•0 comments

What's behind this summer's heat, and why 2027 could be worse

https://www.technologyreview.com/2026/08/13/1141788/summer-heat-el-nino/
1•joozio•12m ago•0 comments

Show HN: TapDiary – a one-tap time and count tracker, works offline

https://www.tapdiary.app/en
1•sangkwun•13m ago•0 comments

A central role for dietary sugars in human evolution

https://www.science.org/doi/10.1126/science.aed8437
2•rzk•16m ago•0 comments

USC Study Finds AI Is Better at Reading Than Listening

https://viterbischool.usc.edu/news/2026/08/can-ai-read-the-room-usc-study-finds-ai-is-better-at-r...
1•shymaple•17m ago•0 comments

Found an Agent created skill that applies uncle bobs

https://github.com/AmazingAng/old-coder
1•wzr1337•17m ago•0 comments

Ask HN: When do you think LLM capacity will reach its ceiling?

2•vincenthsin•17m ago•0 comments

Speeding up the Unreal Editor launch (again) by not loading 1585 files

https://larstofus.com/2026/08/16/speeding-up-the-unreal-editor-launch-again-by-not-loading-1585-f...
1•jay_kyburz•20m ago•0 comments

Hacker News Clone: VibeHack a.k.a. HackPhilia

https://hackphilia.com/about.php
1•pagetelegram•22m ago•0 comments

The null result in OpenAI's enterprise AI paper

https://theworkingmodel.co/analysis/null-result-openai-enterprise-paper/
1•aicoding•22m ago•0 comments

Conservation efforts help an endangered dipterocarp spread roots in Bangladesh

https://news.mongabay.com/2026/04/conservation-efforts-help-an-endangered-dipterocarp-spread-root...
1•thunderbong•22m ago•0 comments

The Internet Archive currently down due to power outage

https://web.archive.org/
1•kogens•22m ago•1 comments

The Indian rupee since 1947

https://finshots.in/archive/the-story-of-the-indian-rupee-since-1947/
1•vismit2000•23m ago•0 comments

Sainsbury's pauses AI cameras after shopper ousted

https://www.bbc.co.uk/news/articles/cddjlmeqjgyo
2•dijksterhuis•25m ago•2 comments

Show HN: Kubara a package manager and framework for Kubernetes platforms

https://github.com/kubara-io/kubara
1•tuunit•25m ago•0 comments

Sixfab Cellular Modems

https://sixfab.com/product-category/development-tools/cellular-modems/
1•peter_d_sherman•26m ago•0 comments

OpenAI-Compatible API Quickstart in Python, JavaScript, and PowerShell

https://github.com/Vector-Compute-Engine/api-quickstart
2•VectorEngine•27m ago•0 comments

ScienceFlow – A Long-Horizon Agent for ML Research

https://github.com/huawei-noah/noah-research/tree/master/ScienceFlow
1•d3ron•28m ago•0 comments

Show HN: Code review that follows callers across your repos

https://contextgoblin.com/
2•clemens1010•30m ago•0 comments

Apache Flink accelerator built with Rust

https://streamfusion.tech/
1•Abbit•32m ago•0 comments

A Camera in My Face

https://www.naths.in/blog/a-camera-in-my-face
2•segalord•36m ago•0 comments

More methods for forecasting code automatiom

https://blog.aifutures.org/p/q25-2026-timelines-update-uplift
1•fbrusch•37m ago•0 comments

Greenest cities in Europe, and where Hamburg stands

https://alsterrunde.com/greenest-cities-in-europe-and-where-hamburg-stands/
3•mertbio•43m ago•0 comments

It's Happening – Europe Is Building an Impossible Fusion Reactor [video]

https://www.youtube.com/watch?v=bPUAKW1Dyek
2•mpweiher•49m ago•0 comments

The LLM Freedom Manifesto: Open-Weight Models and User Responsibility

https://gnu.support/large-language-models-llm/The-LLM-Freedom-Manifesto-Open-Weight-Models-and-Us...
3•rcdwealth•51m ago•0 comments

AI is finding sperm where doctors couldn't

https://www.seattletimes.com/seattle-news/science/ai-is-finding-sperm-where-doctors-couldnt/
2•OutOfHere•54m ago•0 comments