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

Inspiring Female Heavy Equipment Operators in Construction

https://heavydutyjournal.com/female-heavy-equipment-operators-mastering-construction-and-mining-m...
1•thunderbong•6m ago•0 comments

What is Apache Kafka and how does it work?

https://stanislavkozlovski.medium.com/what-is-apache-kafka-and-how-does-it-work-16023aa2efee
1•filipyonov•9m ago•0 comments

How Go Players Disempower Themselves to AI

https://www.lesswrong.com/posts/nR3DkyivzF4ve97oM/how-go-players-disempower-themselves-to-ai
1•cubefox•11m ago•0 comments

I clustered 3,847 public comments on the Santa Ynez offshore EIS

https://www.envirodocket.com/projects/santa-ynez-unit-resumption-eis
1•scarsam•17m ago•0 comments

Watch NASA test its new X-59 jet designed to go faster than the speed of sound

https://www.scientificamerican.com/video/watch-nasa-test-its-new-x-59-jet-designed-to-go-faster-t...
1•beardyw•20m ago•1 comments

SpaceX ISS Docking SIM

https://iss-sim.spacex.com/
1•CubicalOrange•20m ago•0 comments

Show HN: TurnZero – Persistent Expert for LLMs

1•dmilicev2•22m ago•0 comments

Wine 11.8 – Run Windows Applications on Linux, BSD, Solaris and macOS

https://www.winehq.org/announce/11.8
1•neustradamus•25m ago•0 comments

Show HN: Formattery – on-device file converter for iPhone, iPad, and Mac

https://apps.apple.com/es/app/formattery-convertir-archivos/id6759955312
1•alEscarcha•26m ago•0 comments

Ask HN: Should AI agents have their own legal entities?

1•LRG-H•27m ago•2 comments

Show HN: Hollow is an open-sourced self-modifying agentic system

https://github.com/ninjahawk/hollow-agentOS
2•ninjahawk1•30m ago•0 comments

Show HN: Create the right image sizes for social media

https://skills.sh/branding5/social-media-image-sizes/social-media-image-sizes
1•mnewme•30m ago•0 comments

Open source ballistic simulator with NASA SRTM terrain masking (Python/C#)

https://github.com/InsaneInfinity/Balistic
1•insane_infinity•31m ago•0 comments

Show HN: Glacier – A zero-config macOS terminal I vibecoded in Rust

https://github.com/pranjolm/glacier-terminal
1•ArqueNova•45m ago•0 comments

Microsoft Now Recommends 32 GB RAM as a "No Worries" Upgrade for Windows 11

https://www.techpowerup.com/348715/microsoft-now-recommends-32-gb-ram-as-a-no-worries-upgrade-for...
3•SockThief•49m ago•0 comments

I tell about my blog to anyone willing to listen

https://hamatti.org/posts/i-tell-about-my-blog-to-anyone-willing-to-listen/
1•Tomte•51m ago•0 comments

The Java 21 virtual threads and AI hype is half-true

https://old.reddit.com/r/java/comments/1t1fegr/the_java_21_virtual_threads_ai_hype_is_halftrue/
1•Tomte•53m ago•0 comments

Show HN: Agent with its own computer on the cloud

https://pulsarbot.cloud/
1•akshayballal95•58m ago•0 comments

NSA Warned Everyone to Reboot Their Routers

https://www.staysafeonline.org/articles/the-nsa-just-warned-everyone-to-reboot-their-routers-what...
4•saikatsg•1h ago•0 comments

Using Playwright to test my static sites

https://alexwlchan.net/2026/playwright/
1•ingve•1h ago•0 comments

It's a Weird Time to Be Named Claude

https://www.bloomberg.com/news/articles/2026-05-01/claude-ai-is-complicating-life-for-people-name...
3•helsinkiandrew•1h ago•0 comments

Cyber-Insecurity in the AI Era

https://www.technologyreview.com/2026/05/01/1136779/cyber-insecurity-in-the-ai-era/
1•joozio•1h ago•0 comments

Thrml - Probabilistic Compute Simulation on GPUs

https://docs.thrml.ai/en/latest/examples/01_all_of_thrml/
1•oldfuture•1h ago•0 comments

It's super weird, super odd, super rare: meet the twins who have different dads

https://www.theguardian.com/lifeandstyle/2026/may/02/rare-twins-different-dads-the-gift-bbc-radio-4
2•helsinkiandrew•1h ago•0 comments

Interstellar comet came from a much different solar system than ours

https://www.cnn.com/2026/05/01/science/interstellar-comet-3i-atlas-deuterated-water
2•reconnecting•1h ago•0 comments

You'll Subscribe to Your Router, Too – The First Router Bribes Are Here [video]

https://www.youtube.com/watch?v=qjesRkTFZqY
1•stop50•1h ago•0 comments

DojoZero – AI Agent Sport Betting Arena

https://dojozero.live
1•ekzhu•1h ago•0 comments

RYBitten: Configurable RGB-to-RYB Mapping

https://rybitten.space/
2•lioeters•1h ago•0 comments

I was wrong about vibe coding on greenfield projects.

3•dokdev•1h ago•1 comments

Spirit Airlines Is Winding Down All Operations

https://www.spiritrestructuring.com/
44•CaliforniaKarl•1h ago•63 comments