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

Zencoder: Zenflow

https://zencoder.ai/lp/zenflow-enterprise
1•handfuloflight•56s ago•0 comments

Show HN: I Replaced Vector DBs with Optimal Transport (Open Source Project))

https://github.com/merchantmoh-debug/Remember-Me-AI
1•MohskiBroskiAI•3m ago•0 comments

Brooks on the System 360 and adoption of the 8 bit byte [video]

https://www.youtube.com/watch?v=9oOCrAePJMs
1•ggeorgovassilis•3m ago•0 comments

AgentCraft: RTS for AI Agents

https://www.getagentcraft.com/
1•doppp•4m ago•0 comments

Show HN: Travel itinerary manager (passion project)

https://tripwaffle.com
1•bufferout•11m ago•0 comments

Archaeologists find the oldest-known shell beads (2021)

https://leakeyfoundation.org/archaeologists-find-the-oldest-known-shell-beads/
1•thunderbong•12m ago•0 comments

Spirit of ThinkPad

https://thinknextdesign.com/home.html
1•__patchbit__•13m ago•0 comments

Reverse Engineering the ESP32-C3 Wi-Fi Drivers for Static Worst-Case Analysis

https://arxiv.org/abs/2501.17684
1•timschmidt•13m ago•0 comments

FragCut – AI that turns gaming streams into viral TikTok/Shorts clips in minutes

https://fragcut.io
1•jacobgor502•16m ago•2 comments

Chat, Save, and Blog

https://chatblogr.com
1•vijayst•33m ago•0 comments

Aesthetics Bento microsites with built-in analytics

1•sendnow•35m ago•0 comments

What the future holds for AI – from the people shaping it

https://www.nature.com/immersive/d41586-025-03701-5/index.html
1•XzetaU8•35m ago•0 comments

Disenshittify or die! How hackers can seize the means of computation (2024)

https://www.youtube.com/watch?v=4EmstuO0Em8
1•undeveloper•36m ago•1 comments

'He's an Idiot': Musk and Ryanair's O'Leary Trade Insults in Starlink Wi-Fi Row

https://www.politico.eu/article/elon-musk-ryanair-chief-michael-oleary-trade-insults-starlink-spa...
2•JumpCrisscross•38m ago•0 comments

How to Use Your Claude Code Pro Subscription in Docker

https://foldr.uk/claude-code-pro-subscription-docker/
1•johnny_reilly•38m ago•0 comments

Verbalized Sampling: How to Mitigate Mode Collapse and Unlock LLM Diversity

https://arxiv.org/abs/2510.01171
1•ycombiredd•41m ago•0 comments

Trump 25% tariff on European allies until Denmark sells Greenland to US

https://www.theguardian.com/us-news/2026/jan/17/trump-tariff-european-countries-greenland
6•KnuthIsGod•41m ago•0 comments

SFTP Still Delivers the Goods

https://folio.co/blog/sftp-still-delivers-the-goods
1•whatrocks•42m ago•0 comments

Show HN: Figma-use – CLI to control Figma for AI agents

https://github.com/dannote/figma-use
1•dannote•44m ago•0 comments

Tunnl.gg: Expose Localhost to the Internet

https://github.com/klipitkas/tunnl.gg
1•thunderbong•48m ago•1 comments

What were books like in ancient Greece and Rome?

https://www.popsci.com/science/what-were-books-like-in-ancient-greece-and-rome/
1•WaitWaitWha•50m ago•0 comments

AIVO Standard Operational AI Reliance Observation Protocol

https://zenodo.org/records/18286718
1•businessmate•1h ago•1 comments

Is the World Random?

https://mantrna.com/astrobench
2•prabhatkr•1h ago•0 comments

Show HN: 30min video analysis for $0.003 via frame-tiling and Vision API

https://github.com/unhaya/vam-seek-ai
3•haasiy•1h ago•1 comments

300X fast clustering with rust-louvain for nodes

https://github.com/FastBuilderAI/rust-louvain
2•prabhatkr•1h ago•0 comments

Quantum Name Service (QNS)- Path to Web5

https://github.com/aevov/qns
2•cr8oscloud•1h ago•1 comments

Show HN: vr.dev – simple 3D/VR/XR portfolio and links (Meta hit hard this week)

https://www.vr.dev/
2•vrdev•1h ago•0 comments

Shackleton and the Endurance Expedition: Photos from the 1915 Disastrous Journey

https://www.utterlyinteresting.com/post/the-amazing-survival-story-of-ernest-shackleton-and-his-e...
5•nomagicbullet•1h ago•2 comments

Show HN: Task Orchestrator – Production Safety for Claude Code Agents

https://github.com/TC407-api/task-orchestrator
2•Travis_Cole•1h ago•1 comments

Model is intended for use particularly for language learning

https://huggingface.co/EnversonAI/DeepSeek-R1-FineTuned-AdaptiveQGen-COT
2•AslanMammadli•1h ago•1 comments