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?

I calculated what 1M tokens costs across 50 LLM models

https://withorbit.io/blog
1•harshit19932703•1m ago•0 comments

Claude for Excel system prompt, tools and beta headers

https://twitter.com/hewliyang/status/2018278447429382531
1•hewliyang•6m ago•0 comments

To Every Developer Close to Burnout, Read This · TheSeniorDev

https://www.theseniordev.com/blog/to-every-developer-close-to-burnout-read-this
1•birdculture•7m ago•0 comments

Show HN: Judgment Boundary – Stop as a First-Class Outcome for AI Systems

https://github.com/Nick-heo-eg/stop-first-rag
1•echoos•9m ago•1 comments

Copy Protection in Jet Set Willy

https://intarch.ac.uk/journal/issue45/2/1.html
1•Dachande663•9m ago•0 comments

DNS Mesh with eBPF

2•woodprogrammer•9m ago•0 comments

Build chatbot to talk with your PostgreSQL database using Python and local LLM

https://mljar.com/blog/chatbot-python-postgresql-local-llm/
1•pplonski86•10m ago•0 comments

New satellite view of Tibet's tectonic clash

https://www.esa.int/Applications/Observing_the_Earth/Copernicus/Sentinel-1/New_satellite_view_of_...
2•layer8•11m ago•0 comments

Android + termux + pi

https://twitter.com/badlogicgames/status/2018200939979526335
1•tosh•13m ago•0 comments

A Pyrrhic Victory?

https://zhaoxo.substack.com/p/a-pyrrhic-victory
1•shrinkzxo•13m ago•0 comments

We Developed a Rule Database

1•rockeetterark•13m ago•0 comments

Show HN: Uruflow – A self-hosted, lightweight CI/CD server written in Go

https://github.com/urustack/uruflow
1•musnas•17m ago•0 comments

Show HN: WonderPic – Turn photos into cartoons/sketches (Free, No Login)

https://www.wonderpic.art/
1•Sharon111•19m ago•1 comments

JigsawPuzzle.pro – Turn any photo into a puzzle (Client-side only)

https://jigsawpuzzle.pro/
1•zealer•20m ago•1 comments

We Developed a Rule Database

https://github.com/topling/ruledb-doc
1•rockeetterark•21m ago•1 comments

Editor of UploadVR on why he was fired

https://goodvr.substack.com/p/ian-is-typing
2•mellosouls•22m ago•0 comments

Termux

https://github.com/termux/termux-app
1•tosh•24m ago•0 comments

Big Brother Is Watching

https://github.com/cursor/agent-trace
1•ak4153•25m ago•0 comments

The Critic (2024)

https://medium.com/luminasticity/the-critic-5f9d210cd5ae
1•bryanrasmussen•25m ago•0 comments

UPT – Preventing Winner-Take-All Dynamics with Math

https://github.com/Join-boy555/UPT-The-Continuum
1•Joyboy_UPT_555•30m ago•0 comments

Synthetic Pretraining

https://vintagedata.org/blog/posts/synthetic-pretraining
3•brimtown•32m ago•0 comments

Rcarmo/daisy: AI SPEC driven speed coding demo with GitHub Copilot

https://github.com/rcarmo/daisy
1•rcarmo•34m ago•0 comments

Shlaude.fun: AI agent running their own website, blog and fraud investigations

https://shlaude.fun/
2•capevace•34m ago•2 comments

Show HN: (the return of) Read The Count of Monte Cristo and others in your email

https://www.confabulists.com/authors
1•pipnonsense•35m ago•0 comments

Monetize with Social Media

https://isocialize.me/
1•ChrisJamesL•36m ago•0 comments

Why Your Front End Org Needs an Architecture, Not Just a Manager

https://evan-moon.github.io/2026/01/24/leading-frontend-organization/en/
2•bboydart•40m ago•2 comments

Georges Borchardt, 97, Dies; Literary Agent Championed Wiesel's 'Night'

https://www.nytimes.com/2026/01/20/obituaries/georges-borchardt-dead.html
1•_tk_•41m ago•0 comments

My (very) fast zero-allocation webserver using OxCaml

https://anil.recoil.org/notes/oxcaml-httpz
1•noelwelsh•42m ago•0 comments

LinkedIn and Toxic Positivity

https://jensrantil.github.io/posts/linked-and-toxic-positivity/
1•JensRantil•43m ago•0 comments

AI Just make it harder to work at tech

2•localhoster•45m ago•1 comments