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•12mo 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•12mo 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•12mo 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•12mo 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•12mo ago
Load test against a clone instead of a DB whose contents you care about?

Show HN: ProvisioningIQ – Continuous Benchmarks of AWS/Azure/GCP Latency

https://provisioningiq.appswireless.com/
1•syed786•2m ago•0 comments

Postmortem: TanStack NPM supply-chain compromise

https://tanstack.com/blog/npm-supply-chain-compromise-postmortem
2•carlos-menezes•3m ago•0 comments

Anxiety vs Depression

https://silence.bearblog.dev/anxiety-vs-depression/
2•thejamesbox•3m ago•0 comments

Legacy preference bans may not increase college diversity, researchers say

https://phys.org/news/2026-04-legacy-college-diversity.html
1•PaulHoule•4m ago•0 comments

Designing GPUs for Developers: A Conversation with Godot

https://blog.imaginationtech.com/designing-gpus-for-developers-a-conversation-with-godot
1•danbolt•4m ago•0 comments

GM just laid off IT workers to hire those with stronger AI skills

https://techcrunch.com/2026/05/11/gm-just-laid-off-hundreds-of-it-workers-to-hire-those-with-stro...
3•jnord•5m ago•0 comments

Intel Reenters DRAM Race? A Closer Look at the Z-Angle Memory

https://www.trendforce.com/news/2026/02/03/news-intel-reenters-dram-race-a-closer-look-at-the-z-a...
2•jeffufl•6m ago•1 comments

Hermes Agent Background Computer Use on macOS via SkyLight Private SPIs

https://hermes-agent.nousresearch.com/docs/user-guide/features/computer-use
1•simonpure•8m ago•0 comments

When My Father's Canary Flew Away

https://www.nytimes.com/2026/05/07/science/dementia-memory-brain-injury.html
1•gmays•11m ago•0 comments

Star Wars: Fall of the Empire by Stern Pinball

https://sternpinball.com/game/star-wars-fall-of-the-empire/
1•pentagrama•12m ago•0 comments

Why LLMs Make Learning to Code More Important, Not Less

https://senthil.learntosolveit.com/posts/2026/05/10/why-llms-make-learning-to-code-more-important...
1•orsenthil•13m ago•1 comments

What do you NOT like about Cursor / VSCode / Claude Code desktop / Codex / etc.?

1•nokturn•16m ago•0 comments

Show HN: NodeDB – High Perfomance Multi-Model Database

https://github.com/nodedb-lab/nodedb
1•fs90•16m ago•0 comments

Show HN: Inrepo – Pull upstream repos into your app without forks or submodules

https://github.com/inthhq/inrepo
1•burnedchris•16m ago•0 comments

'Not normal': one April day, planet's 50 hottest cities were in a single country

https://www.cnn.com/2026/05/11/climate/50-hottest-cities-aqi-india-heatwave
1•littlexsparkee•20m ago•0 comments

Oxide private cloud rack 3D explorer

https://explorer.oxide.computer/
2•wmf•27m ago•0 comments

Apple Releases iOS 26.5 and iPadOS 26.5 with End-to-End Encrypted RCS

https://www.macrumors.com/2026/05/11/apple-releases-ios-26-5/
1•JumpCrisscross•30m ago•0 comments

GM cutting up to 600 white-collar jobs, even as it seeks tech talent

https://www.detroitnews.com/story/business/autos/general-motors/2026/05/11/gm-to-cut-some-tech-jo...
1•littlexsparkee•32m ago•0 comments

Launching on Product Hunt Tonight

https://www.stackgraveyard.dev/
1•tlseternal•33m ago•1 comments

Show HN: Scholr – search 200M+ academic papers with citation-grounded synthesis

https://www.tryscholr.com/
1•JosephB07•33m ago•0 comments

We are not going to agree on AI

https://idiallo.com/blog/we-are-not-going-to-agree-on-ai
1•foxfired•34m ago•1 comments

Ask HN: What happens when eventually all E2E mess. apps removed from app stores?

1•kingleopold•35m ago•0 comments

Met Introduces Hi-Def 3D Scans of Dozens of Historical Art Objects

https://www.thisiscolossal.com/2026/03/metropolitan-museum-of-art-3d-models-art-history/
1•bookofjoe•36m ago•0 comments

Open-source endpoint detection engine for Windows and Linux

https://github.com/Karib0u/rustinel
1•nhatcher•37m ago•0 comments

Marco Polo: Finding a friend with only distance and motion

https://www.jackhogan.me/blog/marco-polo
1•amy1173•38m ago•0 comments

Searching over Session Transcripts > MEMORY.md

https://github.com/edwarddgao/agent-traces
1•edwarddgao•39m ago•1 comments

VGA memory access is complicated

https://www.os2museum.com/wp/learn-something-old-every-day-part-xxi-vga-memory-access-is-complica...
2•bananaboy•41m ago•0 comments

Natural Language Autoencoders Produce Unsupervised Explanations LLM Activation

https://transformer-circuits.pub/2026/nla/
1•Anon84•41m ago•0 comments

The Dome: A Simple Violation of Determinism in Newtonian Mechanics

https://sites.pitt.edu/~jdnorton/Goodies/Dome/index.html
3•antiquark•49m ago•0 comments

Show HN: I built an MCP server for narrative-driven trading intelligence

2•anish_mitta•51m ago•0 comments