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?

A Tech Founder Wanted to Start a New Country. An Actual Country Got in the Way

https://www.wsj.com/tech/a-tech-founder-wanted-to-start-a-new-country-an-actual-country-got-in-th...
1•nradov•3m ago•0 comments

Show HN: I don't code – I run a self-correcting protocol across 4 projects

https://github.com/Sovereign34/agent-protocol-notes
1•Sovereign34•6m ago•0 comments

Pixel 11 specs and price leak with no surprises

https://www.theverge.com/tech/974238/pixel-11-specs-and-price-leak
1•xiaoyu2006•7m ago•0 comments

U.S. sanctions Iranian firms for Bitcoin maritime insurance operation in Hormuz

https://home.treasury.gov/news/press-releases/sb0581
2•giuliomagnifico•10m ago•0 comments

Game Industry Hardship Fund

https://itch.io/b/3802/game-industry-hardship-fund
1•jbm•20m ago•0 comments

ebookfs – a 9P eBook library filesystem

https://github.com/ramblingenzyme/ebookfs
1•ramblingenzyme•23m ago•1 comments

ao486: x86-compatible Verilog core implementing all features of a 486 SX (2014)

https://github.com/alfikpl/ao486
1•csmantle•25m ago•0 comments

Challenge GPT and Claude to Run Their Own Lemonade Stands[video]

https://www.youtube.com/watch?v=6Ide5pRLR8Y
1•blackcat201•27m ago•0 comments

Strangers pretrained a language model with HF PRs and a cron job

1•somevyn•36m ago•0 comments

'Naked Dressing' Is Spreading and It's Making Things Awkward

https://www.wsj.com/style/fashion/naked-dressing-hailey-bieber-madonna-d2a1d94b
1•petethomas•44m ago•0 comments

Moochacha

https://codeberg.org/markdascher/moochacha
2•sillysaurusx•44m ago•0 comments

J3blocks

https://codeberg.org/amano.kenji/j3blocks
1•sillysaurusx•45m ago•0 comments

Show HN: Nuking the crap Claude left in the codebase – CCN

https://github.com/jonhardwick-spec/ccn
1•jonhardwickspec•47m ago•0 comments

Running Kimi K3 on MI355X at Better Performance per Dollar Than B300

https://www.wafer.ai/blog/kimi-k3-mi355x
17•ilreb•57m ago•0 comments

Booting Fuchsia's Zircon on a Homebrew RISC-V SoC, on an Artix-7 FPGA

https://www.hdlfactory.com/post/2026/07/19/cocoapuffs-booting-fuchsias-zircon-kernel-on-a-risc-v-...
4•mbStavola•59m ago•0 comments

Sick of waiting for agents to run and then having to debug

1•seafaithless•1h ago•1 comments

Ask HN: Collection of Best Pitch Decks?

3•carbonclaw•1h ago•0 comments

PostgreSQL and the Linux OOM Killer: A Better Default

https://clickhouse.com/blog/strict-memory-overcommit-for-postgres
1•saisrirampur•1h ago•0 comments

Don't credit the LLM

https://isaacsu.com/2026/08/dont-credit-the-llm/
11•isaacsu•1h ago•10 comments

Safeguards Based on Copyable Context Cannot Provide Reliable Safety for LLMs

https://arxiv.org/abs/2607.27951
1•sbulaev•1h ago•0 comments

Karpathy's Pelican

https://twitter.com/karpathy/status/2083749667410727319
2•delichon•1h ago•0 comments

Canadians are leaving the country at record levels. Can anyone solve this?

https://thehub.ca/2026/04/03/can-anyone-solve-canadas-brain-drain-problem/
2•TMWNN•1h ago•0 comments

Simple Outlier Detection in a Kalman Filter

https://gurevich.ca/simple-outlier-detection-in-a-kalman-filter/
1•gregsadetsky•1h ago•0 comments

Futurism says Meta has "almost nothing" to show for AI. The numbers say

https://runtimewire.com/article/futurism-says-meta-has-almost-nothing-to-show-for-ai-the-numbers-...
3•ryanmerket•1h ago•6 comments

AI Models as Commodities

https://www.axios.com/2026/08/01/deepseek-model-cheap-ai-price-war
1•kooi•1h ago•1 comments

Play Neuromancer

https://archive.org/details/msdos_Neuromancer_1988
1•mindcrime•1h ago•0 comments

OpenAI's claimed disproof of Connes' Rigidity Conjecture is invalid [pdf]

https://philarchive.org/archive/NIEWTCv17
30•muglug•1h ago•14 comments

Foundational ternary-model inference and training – CUDA, CPU, BitNet/TQ

https://github.com/Quitetall/tritium
1•jacquesm•1h ago•0 comments

Windows XP Original

https://archive.org/details/windows-xp-all-sp-msdn-iso-files-en-de-ru-tr-x86-x64
1•shrikaranhanda•1h ago•1 comments

ModRetro M64 – Nintendo 64 that plays original cartridges with 4K HDMI

https://modretro.com/products/m64
1•dazzatron•1h ago•0 comments