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?

Wake me up when AI can...

https://stoppels.ch/2026/10/03/wake-me-up-when-ai-can.html
1•signa11•1m ago•0 comments

27-year-old ex-firefighter builds $225M truck marketplace after leaving Goldman

https://fortune.com/2026/11/10/garage-used-fire-trucks-martin-hunt-funding/
1•alazsengul•3m ago•0 comments

Show HN: AppTraction – A Native Mac App for Apple's App Store Connect

https://apptraction.dev
1•jscalo•4m ago•0 comments

Show HN: Distributed Langton Ant in Rust

https://giuseppeblog.onrender.com/en/blog/langton-ga
2•sudo-giusppe•4m ago•0 comments

Sexual harassment takes a hidden toll on gig workers

https://www.futurity.org/sexual-harassment-gig-workers-3352412/
2•DeepLogin•5m ago•0 comments

Chat-style runs ended corrupted; 0 of 360 with host-held state

https://zenodo.org/records/23958737
1•shalendragaur•5m ago•0 comments

We checked 312 AI-built apps: how ready are they to launch?

https://launchpal.app/guides/vibe-coded-app-statistics
1•mantasn•7m ago•0 comments

Show HN: ChatCairn, a local, searchable library of your AI chats

https://lgdventures.github.io/chatcairn/
1•lgday•7m ago•0 comments

Anthropic to Seek $1.3T Valuation in IPO

https://www.wsj.com/finance/stocks/anthropic-ipo-valuation-8337b669
1•DGAP•8m ago•1 comments

Show HN: Padwan AI, an LLM Client for Python with HTTP/2 and HTTP/3

https://polarsen-io.github.io/padwan-ai/
1•Orelus•8m ago•0 comments

Consumer prices rose 0.4% in October, more than expected

https://www.cnbc.com/2026/11/10/cpi-inflation-report-october-2026.html
1•DGAP•8m ago•0 comments

Digital and hybrid interventions for subacute and chronic low back pain

https://www.nature.com/articles/s41746-026-03416-5
2•chavasorani•8m ago•0 comments

The state of decision models: adoption, competition, and the integration gap

https://seldon-ai.com/blog/state-of-decision-models
1•nlpnerd•8m ago•0 comments

Show HN: Silos – an open source local agent sandbox CLI orchestrator

https://siloslabs.com/
1•AsDivyansh•8m ago•0 comments

A JSONSchema content mapper for TypeScript 7.1beta

https://github.com/nfroidure/json-schema-content-mapper
1•nfroidure•8m ago•0 comments

We Made J.a.r.v.i.s. At Home – What Can We Do with It?

https://www.lttlabs.com/articles/2026/11/02/jarvis-at-home
1•willx86•8m ago•0 comments

Lions and tigers are kept legally in Ontario backyards. How many are there?

https://www.cbc.ca/news/canada/ontario-exotic-animal-ownership-9.7393011
2•curmudgeon22•9m ago•0 comments

Almanzor – Ask AI and an MCP server for your docs, with cited answers

https://almanzor.cloud
1•victorelexpe•10m ago•0 comments

Show HN: Running MiniCPM-v4.7 35B-A3B on a 2020 Android phone with 8 GB RAM

https://github.com/mlguyYT/MiniCPM-V-Apps
1•mhjafari92•12m ago•0 comments

Exchange for breakfast: Turla's Cereal tricks are not for kids

https://www.welivesecurity.com/en/eset-research/exchange-for-breakfast-turlas-cereal-tricks-are-n...
1•torutofu•13m ago•0 comments

Matt's Free Perl CGI Scripts

https://www.scriptarchive.com/
3•rickcarlino•14m ago•1 comments

Show HN: MyType FYI finds your type from the faces you tap

https://mytype.fyi/
2•MathYouF•14m ago•1 comments

Typed Graphs, Checked Types: Graph as Code for Agentic Engineering/Data Quality

https://www.ssp.sh/blog/context-as-code-typed-graphs-checked/
1•zazuke•15m ago•0 comments

Is AI code rotting open source? 450 repos, 12 months

https://coderot.ai/blog/ai-code-rot-in-open-source
1•coderot_ai•16m ago•0 comments

Show HN: Taskman – open-source, Rust TUI to manage many Claude/Codex sessions

https://github.com/sanagnos/taskman
1•subparsec•16m ago•0 comments

Prison Tech (2020) [video]

https://www.youtube.com/watch?v=O3PfsndsihY
1•mvlipwig•17m ago•0 comments

Native Shell: A Native UI Framework for iOS, Android, macOS, Windows and the Web

https://github.com/longbridge/nsh
1•ksec•17m ago•0 comments

The Need for Experimental Law

https://www.noemamag.com/turbulent-times-call-for-experimental-law/
1•speckx•18m ago•0 comments

Open-Source 2026 AI Cloud GPU and Scraping Proxy Pool Cost Calculator

https://github.com/alekseev04051988-blip/ai-cost-calculator
1•Alekseev0405198•18m ago•0 comments

Best of Bootc Issue #1

https://kheeper.com/best-of-bootc/1
1•areed•21m ago•1 comments