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?

Rowly – a free open-source security scanner

https://rowly.me
1•popkoren•30s ago•0 comments

Mayflies and the Toxic Side of "Carpe Diem"

https://decodingvibes.com/blog/mayflies-and-the-toxic-side-of-carpe-diem/
1•altmanaltman•4m ago•0 comments

The Evolution of Go Generics: A Retrospective from 1.18 to 1.27

https://towardsdev.com/the-evolution-of-go-generics-a-retrospective-from-1-18-to-1-27-f11c06513ee...
1•cheikhdev•6m ago•0 comments

Kill Switch (X-Files episode)

https://en.wikipedia.org/wiki/Kill_Switch_(The_X-Files)
2•theopsimist•10m ago•0 comments

Colors' Package Skills Catalog is live

https://www.getcolors.ai/skills
1•amiorin•11m ago•0 comments

Ask HN: How has AI helped your personal algorithmic trading strategy?

2•brcmthrowaway•11m ago•0 comments

Georgia police officers fired after Flock camera misuse

https://www.wtoc.com/2026/08/07/savannah-police-department-fires-6-employees-over-flock-safety-sy...
5•chirau•11m ago•1 comments

Ask HN: What would convince you that a closed source messaging app is secure?

2•Brandon-Coll•13m ago•0 comments

How to Find the Most Talented People on Earth (Tyler Cowen, 2025)

https://www.thefp.com/p/the-fives-rules-of-finding-talent
1•ronfriedhaber•14m ago•0 comments

Framework for Digital Media Lifespans and EOL Safe Harbors

https://github.com/jbenoitdigitalpolicy/digital-media-lifespan-framework
1•jbenoitdigitalp•15m ago•0 comments

Search Engine – MP3Juice

https://ppev.co.za/search/yimi-umaqondana-mahostela-97
2•figelandadrian•18m ago•0 comments

Reducing Graphics API Complexity: A Clean Slate Design for Modern GPUs

https://www.youtube.com/watch?v=aQv9pUl9PBM
1•coffeeaddict1•18m ago•0 comments

Edge Browser: End Date for Manifest V2 Set – End for uBlock Origin

https://www.heise.de/en/news/Edge-Browser-End-date-for-Manifest-V2-set-End-for-uBlock-Origin-1140...
2•wodniok•20m ago•0 comments

Ship to Burn

https://huntersoftwareconsulting.com/posts/2026-08-09-ship-to-burn/
2•mooreds•22m ago•0 comments

I think I found the best way to find a baby name

https://www.kennyalami.com/mamou
2•kennyalami•23m ago•1 comments

Show HN: Pacific Slate: a self-hosted, model-agnostic multi-agent AI assistant

https://pacslate.com/
5•badwx•27m ago•0 comments

Show HN: Wardline, a Go proxy that auto-blocks compromised AI agents

https://github.com/kabirnarang39/wardline
2•kabirnarang39•27m ago•0 comments

Is it all just vapourware?

https://kirahowe.com/2026/aug/8/is-it-all-just-vapourware
32•Lyngbakr•28m ago•14 comments

I've yet to see any"My AI went rogue and caused us to recognise a workers union

https://mastodon.neilzone.co.uk/@neil/117061512483182546
18•severine•30m ago•1 comments

Romania Extends Nuclear Reactor Output by Nine Days After Danube Blasts

https://www.bloomberg.com/news/articles/2026-08-09/romania-extends-reactor-output-by-nine-days-af...
4•alephnerd•32m ago•0 comments

TubeStream – Turn a YouTube channel into a podcast you can listen to

https://github.com/GhostService/tubestream
2•ghostservice•32m ago•0 comments

Show HN: Form cohorts in your city for study and business

https://chimera.university/event/
2•celestiallylvd1•33m ago•0 comments

Codreo AI Mail – AI Outlook Email Assistant

https://codreo.az/products/codreo-ai-mail/
2•codreotech•42m ago•0 comments

Tuxedo No. 2 – Cocktail recipes

https://tuxedono2.com
4•smartmic•42m ago•0 comments

Endless Execution

https://world.hey.com/dhh/endless-execution-4157e065
4•therepanic•45m ago•0 comments

New Zealand lost its music media, and what we're building to replace it

https://propelmusic.co.nz/articles/the-sound-went-quiet-nz-music-media
10•berghoffer•49m ago•1 comments

Show HN: Standards – Opinionated Linter

https://github.com/sarj-ai/standards
2•nasrmaswood•51m ago•0 comments

TV Station Launches Multiple 4K Broadcasts OTA on ATSC 1.0 (2024, video)

https://www.youtube.com/watch?v=_t_GN8qPf8g
3•Velocifyer•51m ago•0 comments

Ask HN: Recommended Merchant of Record and Affliate Setup

2•tisdadd•55m ago•2 comments

FreeBSD Storage for OpenShift with Democratic CSI

https://vermaden.wordpress.com/2026/08/09/freebsd-openshift-democratic-csi/
2•vermaden•55m ago•0 comments