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?

Hii

1•princea747•5m ago•1 comments

Show HN: A map platform where every category is just a filter

https://umkreisel.com/karte
2•lostbanana4•5m ago•0 comments

How much cost would it take to run a LLMs locally

1•anitroves•6m ago•0 comments

Show HN: Slate, a to-do list shaped like your week, not an endless backlog

https://slate-todo.com
1•al3xandre•9m ago•0 comments

Show HN: RunKit – a browser based tmux manager

https://github.com/sahil87/run-kit
1•sahil87•12m ago•0 comments

Characterizing Metastable Faults and Failures

http://muratbuffalo.blogspot.com/2026/07/characterizing-metastable-faults-and.html
1•matt_d•13m ago•0 comments

Show HN: mcp-console, an MCP CLI with Support for CIMD and DCR

https://github.com/imminent-technology/mcp-console
1•bpedro•17m ago•0 comments

Ruby Markdown Superset Converter

https://github.com/gettalong/kramdown
1•ankitg12•20m ago•0 comments

Eric Schmidt's AI Drones Hit 70% Kill Rate as Commercial Tech Goes to War

https://dronexl.co/2026/01/06/eric-schmidt-ai-drones-hit-70-kill-rate-ukraine/
2•thisislife2•20m ago•0 comments

OpenAI model autonomously hacks HuggingFace

https://www.nbcnews.com/tech/tech-news/openai-says-ai-models-went-rogue-testing-triggering-unprec...
1•AndrewSwift•24m ago•2 comments

I build WebGPU PyTorch debugger, dataset browser and NumPy viewer

https://svetoviz.com
1•piogryko•25m ago•0 comments

TQuel Paper: Implementing Temporal Operators in Postgres

https://illuminatedcomputing.com/posts/2026/07/tquel-paper/
1•pjungwir•27m ago•0 comments

Show HN: SkewAdam – A tiered optimizer that cuts MoE state memory by 97%

https://github.com/nuemaan/skewadam
2•anonnumaan•28m ago•0 comments

OpenAI Models Escaped Containment and Hacked Hugging Face

https://www.wired.com/story/openai-models-escaped-containment-and-hacked-huggingface/
2•sbulaev•32m ago•1 comments

AI for Actual Work – a free, self-paced AI training program by Remote.com

https://aiforactualwork.com/
1•m5r•33m ago•0 comments

Show HN: Eve Directory – Shadcn-installable Eve agent registry

https://www.evedirectory.com
2•nolansym•34m ago•0 comments

Samsung to remove free SmartThings API usage, soon to be 4,99 for individuals

https://blog.smartthings.com/smartthings-updates/a-new-enhanced-smartthings-api-experience/
1•voshond•34m ago•1 comments

Cisco Vulnerability Localization OpenWeight Model Antraes

https://blogs.cisco.com/ai/introducing-antares-the-most-efficient-open-weight-ai-models-for-vulne...
1•Sachinrao•34m ago•0 comments

MCP's new spec breaks latency measurement for observability tools

https://github.com/kerlenton/mcpsnoop/blob/main/docs/2026-07-28-mrtr-breaks-latency.md
1•kerlenton•36m ago•0 comments

Powerplants under DOE emergency orders are producing less energy than before

https://www.utilitydive.com/news/doe-202c-power-plants-centralia-campbell-schahfer/822062/
1•toomuchtodo•37m ago•0 comments

OpenAI and Hugging Face partner to address security incident during model evalu

https://www.lesswrong.com/posts/xcyGdxHC5Rad3fv9h/openai-and-hugging-face-partner-to-address-secu...
1•joozio•37m ago•1 comments

Show HN: Open-source AI shadow that runs on your machine and acts as you

https://github.com/NanoNets/ami
4•ole_gooner•37m ago•0 comments

iAsk.ai

https://iask.ai
1•msaaa•40m ago•1 comments

Show HN: Drey, open source LSP multiplexer so you have to buy less RAM

https://github.com/mario/drey
1•mdjanic•44m ago•0 comments

Judge rules Trump must hand over records sought by BBC in defamation case

https://www.bbc.co.uk/news/articles/c93487x97kyo
3•felooboolooomba•44m ago•0 comments

Winetop – htop for Wine/Proton prefixes

https://github.com/akovari/winetop
1•akovari•46m ago•0 comments

DskDitto: Ultra-fast, parallel duplicate-file detector

https://github.com/jdefrancesco/dskDitto
1•ingve•47m ago•0 comments

HuggingFace Security Incident

https://www.ruxu.dev/links/huggingface-security-incident/
1•ruxudev•47m ago•1 comments

What to know about the landmark Warner Bros. Discovery sale

https://techcrunch.com/2026/07/21/warner-bros-netflix-paramount-acquisition-timeline-wbd/
2•doener•48m ago•0 comments

EY tells clients now about April data breach

https://www.zdnet.com/article/ernst-young-breach-exposed-client-tax-data/
2•Gaishan•52m ago•0 comments