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•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?

Pollen: The Book Is a Program

https://docs.racket-lang.org/pollen/
2•tosh•4m ago•0 comments

Ask HN: Did anyone noticed – Claude vs. Claude generated code act different?

1•kocialnews•6m ago•0 comments

Demographics may be breaking traditional labor market signals

https://www.reuters.com/business/feds-williams-productivity-shifts-hard-spot-real-time-2026-05-28/
2•latentframe•16m ago•0 comments

Blue Origin faces months of delays after rocket explosion damages launch pad

https://www.reuters.com/business/aerospace-defense/blue-origin-faces-months-delays-after-rocket-e...
2•JumpCrisscross•18m ago•0 comments

The National Automated Highway System That Almost Was (2013)

https://www.smithsonianmag.com/history/the-national-automated-highway-system-that-almost-was-6302...
2•downbad_•28m ago•0 comments

The U.S. Has Found a Way to Down a Drone Without Spending $1M

https://www.wsj.com/world/the-u-s-has-found-a-way-to-down-a-drone-without-spending-1-million-848f...
2•JumpCrisscross•34m ago•0 comments

Show HN: GoodSender – the email API for makers and AI agents

https://goodsender.com/
2•efsher_azoy2•35m ago•0 comments

The ~500kB NBSDGames 6 managed to be published ahead of GTA 6

https://github.com/abakh/nbsdgames/releases
3•abakh•38m ago•0 comments

Access Advance Licensor Sues Snap Inc. For AV1 and HEVC Patent Infringement

https://www.accessnewswire.com/newsroom/en/electronics-and-engineering/access-advance-licensor-su...
2•maxloh•39m ago•0 comments

Why Custom Attributes in .NET Give Me Nightmares

https://blog.washi.dev/posts/custom-attributes-and-why-they-suck/
2•jandeboevrie•40m ago•0 comments

Alibaba DAMO Academy Releases GPU Version of Solver

https://www.moomoo.com/news/post/70684711/alibaba-damo-academy-releases-gpu-version-of-solver-for...
2•devy•42m ago•0 comments

Avian Visitors

https://theodore.net/projects/AvianVisitors/
7•fdb•42m ago•0 comments

I'm a photographer. I built a DSL for multi-agent workflows

https://github.com/anhonestboy/agentflow
4•westhills•50m ago•0 comments

A Complexity Theory of AI Value Accrual

https://twitter.com/hypersoren/status/2056866328003174707
3•pretext•55m ago•0 comments

Google infringed trademark allowing competitors use brand name as an ad keyword

https://economictimes.indiatimes.com/tech/technology/ettech-explainer-why-google-was-fined-rs-30-...
6•alok-g•56m ago•1 comments

Dell Confirms XPS Laptop with Nvidia N1X at Computex

https://videocardz.com/newz/dell-confirms-xps-laptop-with-nvidia-n1x-at-computex
4•theanonymousone•58m ago•0 comments

High Tech Heroes #37: Sherwin Gooch Interviews Jef Raskin (1989?)

https://www.youtube.com/watch?v=1qvrOEExlps
3•OhMeadhbh•1h ago•0 comments

Codex generated code that bypasses security constraints

https://twitter.com/sluongng/status/2060746160558543217
4•nomilk•1h ago•0 comments

Why Don't Computers Just Use One Type of Memory?

https://www.youtube.com/watch?v=TfhL5kBiQVI
4•randfur•1h ago•0 comments

Show HN: News about positive advances in medicine, climate tech, research

https://thegoodreport.co/
3•dreadsword•1h ago•0 comments

The SpaceX IPO is great for Elon Musk and terrible for you

https://www.theverge.com/ai-artificial-intelligence/940001/elon-musk-spacex-ipo-ai
11•1vuio0pswjnm7•1h ago•3 comments

A pictorial introduction to differential geometry (2017)

https://arxiv.org/abs/1709.08492
4•ricudis•1h ago•0 comments

How LLMs Work

https://arpitbhayani.me/blogs/how-llms-work/
3•dharaniES•1h ago•0 comments

We contain Claude across products

https://www.anthropic.com/engineering/how-we-contain-claude
4•Tomte•1h ago•0 comments

Show HN: V0.6.0-pre.14 hopefully the last release before v0.6.0

https://codeberg.org/ordinarylabs/Ordinary/releases/tag/v0.6.0-pre.14
2•seanwatters•1h ago•0 comments

Show HN: Komi-learn – continuous memory and self-improvement for coding agents

https://github.com/kurikomi-labs/komi-learn
7•rainxchzed•1h ago•1 comments

Blackwall – OSINT exposure scanner that pulls from real sources

https://theblackwall.vercel.app/
2•jwallace•1h ago•0 comments

Gradient animation using a WebGL shader

https://garden.bradwoods.io/notes/shaders/gradient
3•bradwoodsio•1h ago•0 comments

A standard for building production AI agents (+ installable Claude Code skills)

https://github.com/AlexDuchDev/agentic-product-standard
2•AlexDuch•1h ago•0 comments

OMP – pi agent with batteries included and a coding agent with the IDE wired in

https://omp.sh/
4•himata4113•1h ago•0 comments