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?

RL-based robot arm manipulation with Isaac Lab

https://www.hackster.io/agilexrobotics/sim2real-deployment-rl-based-grasping-using-piper-arm-8ae8bb
1•AGX_NERO•1m ago•0 comments

Elm for PostgreSQL

https://twitter.com/evancz/status/2089617868694421564
1•garyclarke27•3m ago•0 comments

Show HN: There are many factories, but this one's *yours

https://github.com/mikaelweiss/penguin
1•mikaelweiss•7m ago•0 comments

Decentralized Universal Computer

https://github.com/Skills03/c9
1•RIshabh235•7m ago•1 comments

What if the AI capex bubble may not be a bubble after all?

https://www.afr.com/technology/sam-altman-is-being-proved-right-about-the-economics-of-ai-2026081...
1•mnoorani•8m ago•0 comments

NASA's Starling Mission Opens New Frontiers in Space Navigation

https://www.nasa.gov/blogs/smallsatellites/2026/08/17/nasas-starling-mission-opens-new-frontiers-...
1•rbanffy•9m ago•0 comments

Paperwing

https://paperwing.dev/
1•tosh•10m ago•0 comments

Zotero 10

https://www.zotero.org/blog/zotero-10/
1•pretext•14m ago•0 comments

CartLens

https://www.cartlens.co/
1•watat83•23m ago•0 comments

Nvidia CMP170HX driver 64GB RAM unlocking patch

https://github.com/amoghmunikote/cmpunlocker
3•ValdikSS•23m ago•1 comments

Forced System

1•shencry•25m ago•0 comments

Max 20x upgrade not reflected in weekly limits, depleting at Max 5x rate

https://github.com/anthropics/claude-code/issues/79773
1•qwertox•26m ago•0 comments

10000 Classic Movie Posters Digitized and Put Online Free to Browse and Download

https://www.openculture.com/2026/08/5000-classic-movie-posters-digitized-put-online-free-to-brows...
2•mdp2021•27m ago•1 comments

Reddit begins testing a new audio and video experience, similar to TikTok videos

https://techcrunch.com/2026/08/17/reddit-begins-testing-a-new-audio-and-video-experience-similar-...
2•HelloUsername•29m ago•0 comments

Measuring Obedience to Authority Across LLMs with the Milgram Paradigm

https://arxiv.org/abs/2608.16177
1•sbulaev•33m ago•0 comments

OpenAI disbanded the team that assessed catastrophic model risks

https://thenextweb.com/news/openai-preparedness-team-disbanded-ipo-streamlining
2•nyku•34m ago•0 comments

Four Levels of In-Place Initialization

https://blog.yoshuawuyts.com/four-levels-of-in-place-initialization/
2•birdculture•36m ago•0 comments

Europe's heatwave boosted solar by up to 17% on hot days

https://www.euronews.com/2026/08/14/the-real-challenge-starts-after-sundown-europes-heatwave-boos...
2•benkan•36m ago•0 comments

Jellyfish force shutdown of three reactors at French nuclear plant

https://www.lemonde.fr/en/france/article/2026/08/11/jellyfish-force-shutdown-of-three-reactors-at...
2•benkan•36m ago•1 comments

qwen3.8-27B likes bash

https://twitter.com/hxiao/status/2089483485547544959
1•tosh•37m ago•0 comments

Meta faces a $1.4T reckoning in latest trial over social media addiction

https://www.engadget.com/2237547/meta-faces-a-1-4-trillion-reckoning-in-latest-trial-over-social-...
4•benkan•37m ago•0 comments

The End-State Fallacy: Where Is AI Security Headed?

https://endstatefallacy.com/
1•mp3il•39m ago•0 comments

Show HN: Amz-CLI – A command line for Amazon

https://github.com/tamnd/amz-cli
3•tamnd•40m ago•0 comments

Creator of TypeScript: 10x Faster TypeScript, Why AI Won't Replace SWEs [video]

https://www.youtube.com/watch?v=cywK3XYYJ2o
1•tosh•45m ago•0 comments

Linux 7.3 improves performance when running out of vRAM

https://pixelcluster.dev/VRAM-Overcommit/
2•flaburgan•49m ago•0 comments

YouTube: A view counts from the first frame

https://www.heise.de/en/news/YouTube-A-view-counts-from-the-first-frame-11416784.html
1•Topfi•51m ago•0 comments

AI is like farming. (and the purpose behind what I'm building)

2•Ozzie-D•52m ago•0 comments

Show HN: Lilo – a lightweight Markdown notes app built with Rust and egui

https://github.com/HellterEnjoy/Lilo
1•HellterEnjoy•53m ago•0 comments

LLMs Aren't Writing

https://sixcolors.com/post/2026/08/llms-arent-writing/
2•cesarrg•56m ago•0 comments

Linux follows Windows and makes a CPU feature requirement mandatory

https://www.neowin.net/news/linux-finally-follows-windows-and-makes-a-cpu-feature-requirement-man...
1•XzetaU8•58m ago•1 comments