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?

Append filler tokens, answer harder questions

https://twitter.com/kaleybrauer/status/2078185882926846044
1•theroadnotbacon•27s ago•0 comments

Elon Musk Runs from Interview at Last Minute as SpaceX Stock Crashed [video]

https://www.youtube.com/shorts/TFpF7ZzHc3w
2•root-parent•8m ago•0 comments

Supplement that binds to microplastics may remove them from our body

https://www.newscientist.com/article/2580139-supplement-that-binds-to-microplastics-may-remove-th...
1•littlexsparkee•12m ago•0 comments

One probable outcome of an open-weight-model-dominant world is full AI communism

https://xcancel.com/deanwball/status/2078133895766114412?s=46
1•rvz•12m ago•1 comments

Databricks hits $188B valuation, extending its run as AI's favorite second act

https://techcrunch.com/2026/07/17/databricks-hits-188b-valuation-extending-its-run-as-ais-favorit...
3•Brajeshwar•15m ago•0 comments

Frame: A New X11 Server Implementation Written in x86_64 Assembly

https://www.phoronix.com/news/Frame-X11-Server-Assembly
2•Bender•15m ago•0 comments

Gnome OS Safe Mode Improving the System Reliability

https://www.phoronix.com/news/GNOME-OS-Safe-Mode
2•Bender•16m ago•0 comments

Micro-drone achieves first insect kill on the way towards eradicating mosquitoes

https://www.tomshardware.com/tech-industry/drones/autonomous-micro-drone-achieves-first-air-to-ai...
1•rmason•17m ago•0 comments

North Sea hits record 20.4°C amid marine heat wave

https://nltimes.nl/2026/07/17/north-sea-hits-record-204degc-amid-marine-heat-wave
4•tcp_handshaker•18m ago•0 comments

How to Dox Anyone

https://xcancel.com/i/article/2073823066111590866
2•illliillll•18m ago•0 comments

SpaceX and the myth of independent Wall St research

https://www.ft.com/content/ce345155-d897-4f49-b7c8-13680e3b5434
5•JumpCrisscross•24m ago•0 comments

I wanna make $1M for a thousand indies

https://notes.erlend.sh/3mqvs3zg6zs26
2•erlend_sh•25m ago•0 comments

Ask HN: Do you have any plan for post AGI?

5•hypefi•26m ago•6 comments

Sometimes the most resilient thing a system can do isn't retry

https://madflojo.substack.com/p/sometimes-the-most-resilient-thing
2•theanonymousone•27m ago•0 comments

A new wavelet codec for thumbnails/preview (200B–36KB)

https://github.com/lieff/miniwtpc
3•lieff•28m ago•2 comments

Relationships and Power in Startup Ecosystems (2019)

https://siliconhillslawyer.com/2019/02/18/relationships-and-power-startup-ecosystems/
1•robocat•28m ago•0 comments

Pull your calendar availability in 3 seconds

https://www.trytimely.co/
2•jketteringham•28m ago•1 comments

The Camden Fourteen – Identifying America's First Veterans

https://fhdforensics.com/camden-burials-identifications/
1•rmason•36m ago•1 comments

Wp2shell: Pre Authentication RCE in WordPress Core

https://slcyber.io/research-center/wp2shell-pre-authentication-rce-in-wordpress-core/
1•tjwds•39m ago•0 comments

Intel Starts Shipping High-NA EUV Silicon

https://morethanmoore.substack.com/p/intel-starts-shipping-high-na-euv
2•zdw•42m ago•0 comments

Give Agents Homeplace via SSH

https://www.xshellz.com/
2•stfnon•42m ago•1 comments

Why huge pages matter for Postgres?

https://clickhouse.com/blog/huge-pages-clickhouse-managed-postgres
1•saisrirampur•42m ago•0 comments

IBM CEO Arvind Krishna Has Nowhere to Hide from AI

https://www.wsj.com/tech/ibm-ceo-arvind-krishna-has-nowhere-to-hide-from-ai-c9ff290f
2•johnbarron•48m ago•0 comments

Sync.md – keep AGENTS.md, Claude.md, .cursorrules in sync by meaning, not diff

https://marketplace.visualstudio.com/items?itemName=sync-md.sync-md
1•anzilzedex•48m ago•0 comments

Against Mind-Blindness: Recognizing and Communicating with Diverse Intelligences [video]

https://www.youtube.com/watch?v=RHkFmUwW0kM
2•lioeters•49m ago•0 comments

Things I Won't Work With: Dioxygen Difluoride (2010)

https://www.science.org/content/blog-post/things-i-won-t-work-dioxygen-difluoride
4•downbad_•52m ago•0 comments

Show HN: Waylou / a multi-provider CLI coding agent / fork of Gemini CLI

https://github.com/helis-d/waylou
1•Emirhan123•53m ago•1 comments

Tool to benchmark AGENTS.md file on swe tasks

https://github.com/emiliolugo/clawmark
1•emiliolugo•53m ago•0 comments

Apple dethrones Nvidia to regain title of world's most valuable company

https://www.theguardian.com/technology/2026/jul/17/apple-nvidia-most-valuable-company
4•Brajeshwar•54m ago•0 comments

Tutorial: Introduction to Formal Verification with Lean (Part 1)

https://hashcloak.com/blog/tutorial-introduction-to-formal-verification-with-lean-(part-1)
3•birdculture•57m ago•0 comments