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?

Agent Swarms Are a Distributed Systems Problem

https://www.trychroma.com/engineering/transactions
1•rescrv•3m ago•1 comments

Ask HN: How does your preferred AI handle questions we are not allowed to ask?

1•arionhardison•3m ago•0 comments

The Weed Got Too Strong

https://www.nytimes.com/2026/08/24/opinion/weed-marijuna-children-regulation.html
1•bookofjoe•6m ago•1 comments

The Trump administration's March to the Spoils System

https://www.contrariannews.org/p/the-trump-administrations-march-to
1•petethomas•6m ago•0 comments

Model Success Rate May Count the Wrong Runs

https://topicqueue.substack.com/p/four-new-benchmarks-say-your-success
1•DISCURSIVE•6m ago•0 comments

Tim O'Reilly – Writing with AI

https://oreillyradar.substack.com/p/writing-with-ai
1•rmason•8m ago•0 comments

Simple Machine

https://en.wikipedia.org/wiki/Simple_machine
2•ogogmad•9m ago•0 comments

Programmed by Mel Brooks: 100 Years at the Movies (20 titles selected by M.B.)

https://www.americancinematheque.com/series/programmed-by-mel-brooks-100-years-at-the-movies/
1•mdp2021•9m ago•0 comments

Why coding agents stop early on long-horizon software tasks

https://factory.com/news/what-it-takes-for-coding-agents-to-complete-large-software-tasks
2•favoboa•10m ago•0 comments

Show HN: Webtoolio dev tools that run entirely in the browser, nothing uploaded

https://webtoolio.org/
1•deezduudez•11m ago•0 comments

Show HN: A shop that makes it hard to buy things

https://earnyourdescent.com/
1•rexfuzzle•11m ago•0 comments

Bill Gates proposes major limits on AI development

https://www.cnn.com/2026/08/26/business/bill-gates-wants-limits-on-ai
1•rmason•12m ago•2 comments

OpenAI Is Developing a 'Persistent' AI Agent

https://www.wired.com/story/openai-is-developing-a-persistent-ai-agent/
2•thm•12m ago•0 comments

YouTube Shopping Creators can now tag Amazon products

https://blog.youtube/news-and-events/youtube-shopping-amazon-creator-affiliates/
2•thm•13m ago•0 comments

Show HN: ChessRabbit – The AI Chess Analysis Platform

https://chessrabbit.com
1•ahmedhosssam•13m ago•0 comments

Data Centers and the Open Access Order

https://marginalrevolution.com/marginalrevolution/2026/08/data-centers-and-the-open-access-order.htm
1•sershe•14m ago•0 comments

Integrity Bench – Measuring LLM confidence errors

https://integrity-bench.com
1•Topfi•15m ago•0 comments

Google Flow – AI Creative Studio for Video, Images and Custom Tools

https://labs.google/fx/tools/flow
1•thekyle•17m ago•0 comments

The Open Source Maintenance Fee for Polly

https://thepollyproject.org/2026/07/14/polly-osmf-announcement.html
1•billwashere•19m ago•0 comments

Simular's Sai tops OSWorld 2.0, beats GPT and Opus at 2/3 the cost

https://www.simular.ai/articles/sai-tops-osworld-2-0
2•taro666•23m ago•0 comments

SK Hynix CEO: Memory Shortage to Persist Through the End of 2030

https://www.newsis.com/view/NISX20260828_0003766114
2•mfiguiere•24m ago•0 comments

Sam Altman says the economy is adapting to AI slower than he expected

1•oenton•25m ago•2 comments

Millennium Criteria Assessment 2027

https://prachub.com/resources/millennium-criteria-assessment-2027-work-preferences-games-and-what...
1•nian2326076•25m ago•0 comments

Singapore's Neuron Rack Costs More to Rent Than It Saves

https://julienreszka.com/blog/singapore-s-neuron-rack-costs-more-to-rent-than-it-saves/
1•julienreszka•25m ago•0 comments

How to Build an AI Scheduling Assistant with Calendly

https://quickchat.ai/post/ai-scheduling-assistant-calendly
1•piotrgrudzien•26m ago•0 comments

Lambda – fast portable agent harness in C

https://github.com/montyanderson/lambda
2•montyanderson•27m ago•0 comments

Sam Altman says the economy is adapting to AI slower than he expected

https://www.businessinsider.com/sam-altman-economy-ai-adapting-saas-2026-8
2•oenton•27m ago•1 comments

AI's Inference Era of Ferment – By Ben Bajarin

https://www.thediligencestack.com/p/ais-inference-era-of-ferment
1•rbanffy•28m ago•0 comments

We put "stop hiring humans" on billboards, and why we retired it

https://www.artisan.co/blog/stop-hiring-humans
3•cocacola1•29m ago•3 comments

Peeling Apart That Supposed $120B Chip Deal Google Inked with Marvell

https://www.nextplatform.com/compute/2026/08/27/peeling-apart-that-supposed-120-billion-chip-deal...
1•rbanffy•29m ago•0 comments