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?

The absence of visible results does not mean the absence of progress

https://www.indiehackers.com/post/the-absence-of-visible-results-does-not-mean-the-absence-of-pro...
1•staceyPTP•59s ago•0 comments

What is 'Havana syndrome,' condition a CIA director reportedly suffered from?

https://www.washingtonpost.com/national-security/2026/07/22/what-is-havana-syndrome-condition-cli...
1•_tk_•1m ago•0 comments

How My Website Works: A Technical Look at the Stack

https://ammar-najjar.com/blog/website-architecture/
1•ammarnajjar•1m ago•0 comments

CanvasUI: HTML-in-Canvas Component Library

https://canvasui.dev
1•davekiss•2m ago•0 comments

Accidentally built a 500-site SEO mesh network and got 3k visits in 14 days

https://visionvix.com/seo-mesh-network/
1•julian-vix•3m ago•0 comments

Geekbench 7 launches with Ryzen 7 7700 baseline

https://videocardz.com/newz/geekbench-7-launches-with-ryzen-7-7700-baseline-adds-game-physics-av1...
1•leumon•4m ago•0 comments

Show HN: NvChat – A single-exe Windows client for Nvidia's free LLM API

https://github.com/akon47/NvChat
1•akon47•5m ago•0 comments

Tangled – tail CI logs over SSH

https://blog.tangled.org/ssh/
1•nerdypepper•5m ago•0 comments

Yes, you can copy our eval setup

https://langfuse.com/blog/2026-07-16-steal-our-eval-setup
1•clemo_ra•7m ago•0 comments

Liang Wenfeng Investor Exchange Meeting · Audio Transcript

https://www.fredgao.com/p/deepseeks-liang-wenfeng-breaks-his
1•hunglee2•7m ago•0 comments

Carbon: Graduating from the Experiment

https://www.youtube.com/watch?v=WJl4ftb5Fxg
1•mda•8m ago•1 comments

NeuTTS-2E, an open-source on-device TTS model with 7 controllable emotions

https://old.reddit.com/r/LocalLLaMA/comments/1v3h4ni/comment/oz48flp/
1•issaneuphonic•17m ago•0 comments

WASM-native Unix sandboxing for the web

https://wanix.dev/
1•evacchi•19m ago•0 comments

The Semiotics of Fear

https://jlopes.eu/blog/the-semiotics-of-fear/
1•offeringofpie•19m ago•0 comments

Where Are All the Solar-Powered Cars?

https://spectrum.ieee.org/solar-powered-cars
2•rbanffy•20m ago•0 comments

The forbidden railway: Vienna – Pyongyang (2008)

http://vienna-pyongyang.blogspot.com/
2•throwaway2037•24m ago•1 comments

Trump's Plan for Science: More Money for A.I., Less for Universities

https://www.nytimes.com/2026/07/22/us/politics/trump-research-funding-artificial-intelligence.html
2•goplayoutside•25m ago•0 comments

Modern Kubernetes Homelab: GitOps with ArgoCD

https://www.jonashietala.se/blog/2026/07/23/gitops_with_argocd/
1•lawn•25m ago•0 comments

Soon everybody will be worried about Chinese LLM's as agent Trojan horses

https://twitter.com/i/status/2080180914135667085
2•mherrmann•33m ago•1 comments

The Law of Leaky Abstractions (2002)

https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/
2•rldjbpin•34m ago•1 comments

Google's Design Ethicist Testimony [pdf]

https://www.commerce.senate.gov/wp-content/uploads/media/doc/06_25_19Harris_Testimony.pdf
2•malaiqa•35m ago•1 comments

Code review: slapping an AI reviewer on top of an AI author doesn't cut it

https://blog.codacy.com/ai-code-review-is-not-enough-how-engineering-leaders-should-gate-ai-gener...
3•ARayOutOfBounds•35m ago•2 comments

OpenAI's models broke free and launched a cyberattack

https://www.politico.com/news/2026/07/22/openai-hugging-face-congress-response-01009190
2•Alien1Being•36m ago•0 comments

Show HN: I built a token-per-second counter in Go

https://github.com/canergulay/tokps
1•canergl•39m ago•0 comments

Beyond Arc and GSM: Langford Coverage as a Benchmark for ASI

https://zenodo.org/records/21502973
1•Mlangford75•42m ago•1 comments

Stupid Slow: The Perceived Speed of Computers (2024)

https://www.datagubbe.se/stupidslow/
2•doener•42m ago•1 comments

KTransformers – Flexible LLM Inference Framework

https://ktransformers.net/en
1•stareatgoats•46m ago•0 comments

OpenAI's Australian data centre drops water recycling plan

https://www.reuters.com/business/energy/openais-australian-data-centre-drops-water-recycling-plan...
4•adithyaharish•46m ago•0 comments

I gave Pi one tool and it ran for eight days

https://monotykamary.com/posts/i-gave-pi-one-tool/
1•kennyfrc•47m ago•0 comments

Why creators are hedging against the TikTok algorithm

https://www.officeos.co/blog/why-creators-are-hedging-against-the-tiktok-algorithm
1•Harro123•47m ago•0 comments