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•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?

Lupine: A GPU-over-IP Bridge

https://github.com/lupinemachines/lupine
1•kevmo314•4m ago•0 comments

Oxia ― Metadata Store and Coordination System

https://oxia-db.github.io/
1•mooreds•4m ago•0 comments

Getting the (staff) title where you are

https://staffeng.com/guides/getting-the-title-where-you-are/
1•mooreds•5m ago•0 comments

DeepSeek reasonix, DeepSeek native coding agent with high caching and low cost

https://esengine.github.io/DeepSeek-Reasonix/
1•Alifatisk•6m ago•0 comments

Mouthwords

https://everythingchanges.us/blog/mouthwords/
1•mooreds•8m ago•0 comments

OpenAI co-founder Andrej Karpathy joins Anthropic

https://www.axios.com/2026/05/19/anthropic-openai-karpathy-andrej-claude
1•synapsehub_ai•8m ago•0 comments

Russell's Paradox [video]

https://www.youtube.com/watch?v=ymGt7I4Yn3k
2•stormdennis•10m ago•0 comments

'He refused to quit:' 27-year walk around the world

https://www.rmoutlook.com/mountain-guide/he-refused-to-quit-fundraiser-for-man-on-27-year-walk-ar...
2•Kaibeezy•11m ago•0 comments

Constraint Decay: The Fragility of LLM Agents in Back End Code Generation

https://arxiv.org/abs/2605.06445
2•wek•12m ago•0 comments

Show HN: A picker that maps local LLMs to hardware, hardware to LLMs

https://llmrequirements.com/
2•truetotosse•17m ago•1 comments

Alyx – Crypto Portfolio Dashboard on New Tab

https://chromewebstore.google.com/detail/alyx-—-crypto-portfolio-d/nmchlndcajncggcpeokebegjhlje...
2•Teyz•22m ago•0 comments

Your Clippy Config Should Be Stricter

https://emschwartz.me/your-clippy-config-should-be-stricter/
2•blenderob•26m ago•0 comments

The guide to RL environments: building and scaling them in the LLM era

https://huggingface.co/spaces/AdithyaSK/rl-environments-guide
2•kunalsin9h•27m ago•0 comments

PromptVC

https://www.promptvc.io/blog/introducing-promptvc
2•justicea83•27m ago•0 comments

Charging power bank left in checked baggage diverts easyjet flight

https://simpleflying.com/easyjet-flight-diverted-power-bank-charging-luggage/
3•giuliomagnifico•27m ago•2 comments

AI Proves Mathematicians Wrong

https://www.heise.de/en/news/AI-proves-mathematicians-wrong-11303022.html
2•NicoHartmann•27m ago•1 comments

Are Tech Meetups Dead?

2•mlinhares•29m ago•0 comments

I missed NETworkManager on Windows so I built a Linux equivalent

https://github.com/thongor77/nmlinux
2•magetriste•32m ago•0 comments

I built a free AI travel planner for budget Europe trips

2•supreethadev•34m ago•2 comments

Accessibility in JavaFX

https://dev.java/learn/javafx/a11y/
1•Tomte•34m ago•0 comments

Sips, macOS native scriptable image processing system

https://ss64.com/mac/sips.html
2•Alifatisk•35m ago•0 comments

Our AI just got better

https://blog.ecosia.org/improving-our-ai/
6•thunderbong•36m ago•2 comments

Gustafson's Law

https://en.wikipedia.org/wiki/Gustafson%27s_law
2•tosh•38m ago•0 comments

We are Poles, so, of course, we print in Latin

https://www.ustc.ac.uk/news/we-are-poles-so-of-course-we-print-in-latin
3•danielam•39m ago•0 comments

Cost Model: Work, Span and Parallelism [pdf]

https://www.cse.wustl.edu/~angelee/archive/cse341/fall14/handouts/lecture03.pdf
2•tosh•40m ago•0 comments

The Neuroscience Behind Writing: Handwriting vs. Typing–Who Wins the Battle?

https://www.mdpi.com/2075-1729/15/3/345?
2•dhfbshfbu4u3•41m ago•0 comments

Handwriting but not typewriting leads to widespread brain connectivity

https://www.frontiersin.org/journals/psychology/articles/10.3389/fpsyg.2023.1219945/full
2•dhfbshfbu4u3•42m ago•1 comments

A personal agent with auto-generate tools based on what you need

https://agenvoy.com/
2•pardnchiu•44m ago•1 comments

Are Determinacy-Race Bugs Lurking in Your Multicore Application? (2009)

https://web.archive.org/web/20091103173033/http://software.intel.com/en-us/articles/are-determina...
2•tosh•45m ago•0 comments

Operating licence of Bilgi University revoked

https://www.aljazeera.com/news/2026/5/22/turkiye-shutters-liberal-istanbul-university-seized-in-c...
2•anticensor•47m ago•1 comments