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?

Keyv and Cacheable NPM Package Hijacked in Supply Chain Attack

https://www.wiz.io/blog/keyv-and-cacheable-npm-supply-chain-attack
1•datakan•1m ago•0 comments

Show HN: GeoAI Skills – agent skills that refuse invalid geospatial analysis

https://github.com/muend/geoai-skills
1•muend•2m ago•0 comments

Oauth2-proxy – proxy with authentication with Google, Azure, OpenID Connect

https://github.com/oauth2-proxy/oauth2-proxy
1•gregsadetsky•4m ago•0 comments

I built an LLM debugger for fine-tuning failures

https://github.com/gradian-ai/gradian
1•abdullah-xyz•4m ago•0 comments

Pdf-inspector: The rust-powered open-source PDF parser for AI

https://firecrawl.github.io/pdf-inspector/
1•richbray•5m ago•0 comments

Show HN: Implement-spec – a harness-agnostic spec-to-verified-PR agent skill

https://github.com/SteveVitali/agent-skills
3•SteveVitali•5m ago•0 comments

US has used 'virtually all' of its long-range precision missiles during Iran war

https://www.reuters.com/world/us-has-used-virtually-all-its-long-range-precision-missiles-during-...
1•speckx•7m ago•0 comments

AMD Helios Architecture Deep Dive: The Power of AMD's Hardware Combined

https://www.servethehome.com/amd-helios-architecture-deep-dive-amd-broadcom-hardware-combined/
2•ksec•7m ago•0 comments

'Digital lifeline' – Gaza tech workers give glimpse of possible future

https://www.bbc.com/news/articles/c1m1xm8ykk2o
1•CrypticShift•7m ago•0 comments

REO: Revisiting Erase Operation for Improving Lifetime, Performance of NAND SSDs

https://www.mdpi.com/2079-9292/14/4/738
1•rbanffy•8m ago•0 comments

Show HN: Flyout – Rich-text notes that fly out from your Mac's screen edge

https://getflyout.app/
2•gorkemyildirim•8m ago•0 comments

Show HN: I made a self-built catalogue of education Simulation games

https://cloudsims.online
1•zameermfm•8m ago•0 comments

How to Make a Nintendo 64 Game in 2026

https://phoboslab.org/log/2026/08/xibalba64-making-of
1•atan2•8m ago•0 comments

I switched from Firefox to Vivaldi for browsing

https://michaelharley.net/posts/2026/08/04/why-i-switched-from-firefox-to-vivaldi-for-browsing/
1•ExMachina73•8m ago•0 comments

Plan 9 from Bell Labs, the little OS that could

https://weeraman.com/plan-9-from-bell-labs-the-little-os-that-could/
4•aweeraman•8m ago•0 comments

We let models localize into 16 languages. How we made it read native.

https://reelang.com/open-startup/blog/llm-localization-context-beats-translator
1•stuess•8m ago•1 comments

At least 37 people arrested in 2026 so far for protesting against data centers

https://www.tomshardware.com/tech-industry/data-centers/at-least-37-people-arrested-in-2026-so-fa...
1•speckx•10m ago•0 comments

Show HN: Listen to audiobooks like you read, at your own pace

https://listendock.com/sentence-mode
2•janpmz•10m ago•0 comments

Being a Luddite Is Fun Again

https://www.404media.co/luddite-events-nyc-off-tech-summer-of-ludd/
1•surprisetalk•10m ago•0 comments

I talk my own scam detector out of a verdict

https://patch-security.com/notes/prompt-injection/
2•CoryVD•11m ago•0 comments

Show HN: My journey into game development with AI

https://playdowntime.com/
1•gennadiygryva•12m ago•0 comments

Have We Been Playing Monopoly Wrong All Along?

https://slate.com/life/2026/07/monopoly-go-rules-board-games.html
1•speckx•15m ago•0 comments

PDF Trends 2026 Q2: Analysis of 20.6M PDFs from Common Crawl

https://pdf4wcag.com/blog-news/PDF-trends-2026Q2-by-dual-lab-company
2•smartdev01•16m ago•4 comments

A versatile RSS app design

https://expenses.github.io/notes/
1•bringstdir•16m ago•0 comments

vLLM Recipes

https://recipes.vllm.ai
4•kristianpaul•16m ago•0 comments

Show HN: Skillreaper – find agent skills that load every session but never fire

https://github.com/thousandflowers/skillreaper
1•thousandflowers•16m ago•0 comments

The 4 Categories of Context Rules to Power Enterprise Governance

https://promptowl.ai/resources/the-four-rulebooks-for-enterprise-ai/
1•sparkystacey•17m ago•0 comments

Show HN: Neal – Codex writes the code, Claude reviews it

https://github.com/navels/neal
1•navels•18m ago•0 comments

Introducing: Cloudflare Agents

https://blog.cloudflare.com/agents-on-cloudflare/
1•aofeisheng•18m ago•0 comments

AI pricing is not broken. We have the answers for how to do it

https://www.solvimon.com/blog/ai-pricing-is-not-broken
1•arnon•19m ago•0 comments