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?

Giving ChatGPT access to Apple Messages is dangerous and irresponsible

https://paulfwalsh.substack.com/p/giving-chatgpt-access-to-apple-messages
1•taubek•15s ago•0 comments

Postgres 19: How Our Advice Has Changed

https://www.crunchydata.com/blog/postgres-19-how-our-advice-has-changed-since-we-wrote-it
1•plaur782•20s ago•0 comments

Show HN: Dev // Cyber Toolkit – a free floating dev/cybersecurity widget

https://dev-cyber-toolkit.netlify.app
1•axoupicsou•1m ago•1 comments

2-click code execution vulnerability on Omarchy Linux

https://twitter.com/mdisec/status/2091293921468932420
1•ozirus•2m ago•0 comments

Mcpsnoop fails CI on what your MCP server did on the wire

https://github.com/marketplace/actions/mcpsnoop
1•kerlenton•3m ago•0 comments

The Mantle

https://johncarlosbaez.wordpress.com/2026/08/22/the-mantle/
1•lukeplato•5m ago•0 comments

A hidden "on switch" in human DNA has been decoded

https://www.sciencedaily.com/releases/2026/08/260823014943.htm
1•geox•6m ago•0 comments

How Much of the Internet Is Written with AI?

https://www.pewresearch.org/data-labs/2026/08/20/how-much-of-the-internet-is-written-with-ai/
2•champagnepapi•8m ago•0 comments

Nvidia Is Spending $6B to Build a Powerful U.S. Alternative to Chinese AI

https://www.wsj.com/tech/ai/nvidia-is-spending-6-billion-to-build-a-powerful-u-s-alternative-to-c...
1•bryan0•8m ago•0 comments

Why Sal Khan't: On Learning by Making but Teaching by Telling

https://punyamishra.com/2026/04/16/why-sal-khant-on-learning-by-making-but-teaching-by-telling/
1•the-mitr•9m ago•0 comments

Pisces V5 – Open-Source 65k-ALU Tensor SoC for Desktop X-Ray Lithography

https://github.com/rgpanday/PISCES-Architecture
1•romes12000•11m ago•0 comments

Fractals Without a Computer [video]

https://www.youtube.com/watch?v=koDCabeh5kQ
1•onemoresoop•12m ago•0 comments

PC Tweaker

https://pctweaker.app/
2•xn0time•13m ago•0 comments

LLM Watermarking from Scratch (Gist)

https://gist.github.com/jSwords91/2732ff6017213526da73e8dc2bd54770
1•protagonist_hn•13m ago•1 comments

History of the Filesystem

https://twitter.com/alezander9/status/2090991558145499607
2•gregpr07•14m ago•0 comments

Git Worktrees for AI Agents

https://lanes.sh/use-cases/git-worktrees-for-ai-agents
2•s-xyz•14m ago•0 comments

Securing sandboxes: What happens when AI agents escape containment?

https://thenewstack.io/securing-ai-agent-sandboxes/
1•Brajeshwar•15m ago•0 comments

AgentGuard – open-source firewall for inter-agent AI messages

https://github.com/nizba06/agentguard
1•Nizba06•15m ago•0 comments

Show HN: Libre WebUI 0.28, a watchable, teachable computer for local agents

https://github.com/libre-webui/libre-webui
2•rob-x-ai•15m ago•0 comments

Coconut Oil Jet Fuel Matches Kerosene's Efficiency in Engine Tests

https://studyfinds.com/coconut-oil-jet-fuel-matches-kerosenes-efficiency-in-engine-tests/
2•mdp2021•18m ago•0 comments

Using Models to Create Models of New York City

https://petersobot.com/blog/using-models-to-create-models-of-new-york-city/
1•psobot•18m ago•0 comments

The Feta War: U.S. Targets Greece's Cheese

https://www.thenationalherald.com/the-feta-war-u-s-targets-greeces-cheese/
2•dataflow•19m ago•0 comments

A free AI model is winning over developers. And nobody knows servers it runs on

https://thenextweb.com/news/ox-alpha-stealth-model-openrouter-anonymous-provider
1•colinprince•21m ago•0 comments

IBM PC XT (Model 5160) emulator in the browser

https://www.pcjs.org/machines/pcx86/ibm/5160/vga/
1•hliyan•21m ago•0 comments

Re: I turned my RSS feeds into an e-ink newspaper to stop reading on my phone

https://cailinpitt.com/blog/2026/8/23/reading-rss-feeds-on-my-xteink-x4
2•classictraffic•24m ago•0 comments

Wiki Is Not Enough

https://replicated.live/blog/wiki
4•gritzko•28m ago•0 comments

Building a Better Inner Loop

https://bradleygibbs.dev/posts/building-a-better-inner-loop/
3•bradleygibbs•30m ago•0 comments

Show HN: Job Seeker – open-source Markdown skills that automate your job search

https://github.com/galiprandi/job-seeker
3•galiprandi•32m ago•1 comments

Show HN: List your good SaaS for free

https://goodsaas.lol/
1•its_ajseven•34m ago•0 comments

I ran out of space extracting a RAR so I built ReclaimArc

https://github.com/harlixay7/ReclaimArc
1•harlixay7•35m ago•0 comments