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

Elon Musk's SpaceX and XAI Are Planning a Megamerger of Rockets and AI

https://www.wsj.com/tech/elon-musks-spacex-and-xai-are-planning-a-megamerger-of-rockets-and-ai-28...
1•bookofjoe•54s ago•1 comments

A More Perfect Union

https://www.symmetrybroken.com/a-more-perfect-union/
1•riemannzeta•1m ago•0 comments

Ask HN: Weekend Social: What personal chore did you automate recently?

1•susam•2m ago•0 comments

Show HN: Rechain – A daily word puzzle about semantic bridges

https://rechain.me
1•dammdanyal•6m ago•0 comments

An algebra bedtime fable to fall asleep to

https://shukla.io/blog/2021-11/algebra-notes.html
1•BinRoo•6m ago•0 comments

Show HN: Agent Tinman – Autonomous failure discovery for LLM systems

https://github.com/oliveskin/Agent-Tinman
1•oliveskin•8m ago•0 comments

Reincarnation Game: Choose Your Region Wisely

https://reincarnate.fly.dev/
1•manujkant•8m ago•0 comments

The L4Re Operating System Framework

https://l4re.org/
1•doener•9m ago•0 comments

Islechat: Tiny chat server powered by SSH

https://github.com/ashfn/islechat
1•thunderbong•10m ago•0 comments

Show HN: Web Time Machine – Explore internet history with a timeline

https://web-time-travel.vercel.app
1•ashokmarannan•12m ago•1 comments

Show HN: Ctxbin – A deterministic CLI for reliable AI agent handoffs

https://github.com/superlucky84/ctxbin
1•superlucky84•13m ago•1 comments

Eagle Mode: a zoomable user interface

https://eaglemode.sourceforge.net/
1•fanf2•13m ago•0 comments

Google Cloud suspended my account for 2 years, only automated replies

3•andylizf•13m ago•0 comments

Software: Solo or Team?

https://boragonul.com/blog/software-solo-or-team/
1•bora_gonul•14m ago•0 comments

Show HN: Openground, and on-device and open source alternative to Context7

https://github.com/poweroutlet2/openground
1•poweroutlet2•15m ago•0 comments

Show HN: Unicode is weird so I built a site to make text cooler anywhere

https://fontgen.cool/
1•liquid99•19m ago•0 comments

Synth Town

https://synth.town
2•count_zero•20m ago•1 comments

SeL4: The most highly assured and fastest operating system kernel

https://sel4.systems/
2•doener•22m ago•0 comments

California Senate passes bill regulating lawyers' use of AI

https://www.reuters.com/legal/government/california-senate-passes-bill-regulating-lawyers-use-ai-...
4•1vuio0pswjnm7•22m ago•0 comments

Nova OS Virtualization Architecture

https://hypervisor.org/
1•doener•22m ago•0 comments

New heat-shrinking method integrates electronic circuits on irregular shapes

https://techxplore.com/news/2026-01-method-electronic-circuits-irregular.html
2•PaulHoule•23m ago•0 comments

Still conscious? Brain marker signals when anaesthesia takes hold

https://www.nature.com/articles/d41586-026-00301-9
1•bookofjoe•23m ago•1 comments

Trump Officials Move to Double Number of H-2B Guest Visas This Year

https://www.nytimes.com/2026/01/30/us/politics/h2b-visas.html
3•ripe•24m ago•1 comments

Agentchan – imageboard built for AI agents

https://chan.alphakek.ai/
1•TMWNN•27m ago•0 comments

Iva Kosic

1•billystr•27m ago•0 comments

Nintendo DS code editor and scriptable game engine

https://crl.io/ds-game-engine/
2•Antibabelic•27m ago•0 comments

The Context Window Is Becoming a Virtual Machine

https://conikeec.substack.com/p/the-context-window-is-becoming-a
1•conikeec•28m ago•0 comments

Total communications blackout for 22 day, 30k protesters thought killed

https://www.youtube.com/watch?v=hxc8RgchpBs
1•us321•30m ago•0 comments

Show HN: An open-source Chrome extension that lets any LLMs control the browser

https://github.com/hanzili/llm-in-chrome
1•hanzili•32m ago•0 comments

Why Some Code Feels Easier to Read

https://evan-moon.github.io/2026/01/30/developer-intuition-readable-code-and-neuroscience/en/
2•bboydart•37m ago•0 comments