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

The scammer, the fixer and the cop: Inside LA's world of millionaire crypto kids

https://www.latimes.com/california/story/2026-03-24/los-angeles-crypto-kids-trial
1•koolba•40s ago•0 comments

The Resonance Web – a living network engine where death strengthens the web

https://github.com/Dosage2AG/resonance-web
1•Dosage2ag•1m ago•0 comments

OpenAI shutters AI video generator Sora in abrupt announcement

https://www.theguardian.com/technology/2026/mar/24/openai-ai-video-sora
1•beardyw•1m ago•0 comments

Meta Targets $9T Valuation with New Executive Incentive Program

https://www.wsj.com/tech/meta-targets-9-trillion-valuation-with-new-executive-incentive-program-6...
1•pera•2m ago•0 comments

AI Daemons: A new category of AI for engineering teams

https://twitter.com/rileytomasek/status/2035042454483714317
1•mrbbk•3m ago•0 comments

Show HN: Kide – A CMS built inside Astro 6

https://github.com/mhernesniemi/kide-cms
1•zernobilly•4m ago•0 comments

Tell HN: Slow Down

1•jacquesm•4m ago•0 comments

Johnston, surrounding counties to receive broadband funding

https://www.johnstoniannews.com/news/johnston-surrounding-counties-to-receive-broadband-funding-b...
1•01-_-•5m ago•0 comments

Show HN: Refrain – Generate browser automations with AI, replay them without AI

https://therefrain.ai/
1•timakin•6m ago•0 comments

Agentic commerce runs on truth and context

https://www.technologyreview.com/2026/03/25/1134516/agentic-commerce-runs-on-truth-and-context/
1•joozio•6m ago•0 comments

Quantum Computing Is Today's Manhattan Project

https://www.wsj.com/opinion/quantum-computing-is-todays-manhattan-project-9746be3b
1•mathgenius•9m ago•0 comments

Open source isn't a tip jar – it's time to charge for access

https://www.theregister.com/2026/03/25/open_source_bill_opinion/
3•beardyw•10m ago•0 comments

Ask HN: Early stage Founders – How do you acquire early beta users?

1•KhushaliT•10m ago•0 comments

Losing my email account locked me out of my Digital Life

https://appsec.space/posts/email-lockout/
1•_zeta•10m ago•0 comments

Show HN: AgentPass – The credit check for AI agents

https://agentpass.co.uk
1•AskCarX•12m ago•0 comments

Ask HN: What are some ways you have limited AI slop

1•grahammccain•12m ago•0 comments

Spent too much on ads, so built an AI that makes converting product videos

https://instant-ugc.com/?red=abdelk
1•Locas•13m ago•2 comments

Native macOS/iOS eBook Reader

https://getbookshelves.app
1•carlosjobim•13m ago•1 comments

Rust reflection and a multi-array list

https://fnordig.de/2026/03/25/rust-reflection-and-a-multi-array-list/
1•hasheddan•14m ago•0 comments

VTAM: Video-Tactile-Action Models for Complex Physical Interaction Beyond VLAs

https://arxiv.org/abs/2603.23481
1•chrsw•15m ago•0 comments

Show HN: Anneal – model-agnostic; makes LLMs remember, obey, and stay private

https://annealit.ai/
1•cdbattags•15m ago•0 comments

A man who coined Metaverse now says Meta's glasses are creepy

https://www.theverge.com/tech/899797/metaverse-neal-stephenson-headsets-goggles-glasses-creepy-no...
1•speckx•16m ago•0 comments

Esp-IDF v6

https://developer.espressif.com/blog/2026/03/idf-v6-0-release/
2•hasheddan•16m ago•0 comments

Designing a Slider for Feeling

https://rajavijayaraman.com/writing/designing-slider-for-feeling/
1•rajavijayaraman•21m ago•0 comments

MolmoWeb: Give it a task, it clicks, types, and navigates the web itself

https://github.com/allenai/molmoweb/
1•steveharing1•22m ago•0 comments

The Missing OS for AI-Driven Development: From Hallucinations to High-Governance

https://www.haniweiss.com/the-missing-os-for-ai-driven-development-from-hallucinations-to-high-go...
1•BorrowBrain•23m ago•0 comments

Why Is Vogue Suing a Dog Fashion Magazine?

https://www.nytimes.com/2026/03/17/style/vogue-conde-nast-dogue-magazine-lawsuit.html
1•doener•24m ago•0 comments

Washington passes new AI laws to crack down on misinformation, protect minors

https://www.kuow.org/stories/washington-passes-new-ai-laws-to-crack-down-on-misinformation-protec...
1•greyface-•24m ago•0 comments

Obelix a Multi-Provider LLM ADK with Granular Control and A2A Deployment

https://github.com/GiulioSurya/Obelix/tree/main
1•GiulioSurya•24m ago•1 comments

MCP-Manticore: Let Your AI Assistant Write Manticore Queries for You

https://manticoresearch.com/blog/mcp-manticore-server/
1•snikolaev•25m ago•0 comments