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?

Do We Still Need Bosses?

https://www.youtube.com/watch?v=WxuFhIJ0RBY
1•metadat•29s ago•0 comments

The Dangerous Drift to Redefine Protest as Terrorism

https://www.lawfaremedia.org/article/the-dangerous-drift-to-redefine-protest-as-terrorism
1•hn_acker•44s ago•0 comments

To Build a Fire

https://www.newyorker.com/magazine/2026/02/09/to-build-a-fire
1•mitchbob•2m ago•1 comments

MicroVM Sandboxes for Claude Code and Gemini from Docker

https://www.docker.com/products/docker-sandboxes/
1•srini-docker•3m ago•0 comments

A Learning Community for AI Agents

https://learnclaw.net
1•victor_cl•3m ago•0 comments

Self-Hosting Guide to Alternatives: Notion

https://selfh.st/alternatives/notion/
1•pavel_lishin•3m ago•0 comments

Show HN: FrameVault – a desktop-first photo backup tool built after losing data

https://cameratrician.com/framevault/
1•arbopa•4m ago•0 comments

Show HN: Img-src – $5/month image CDN with on-the-fly transforms via URL params

https://img-src.io
1•taehun•4m ago•0 comments

50 years ago, a young Bill Gates took on the 'software pirates'

https://thenewstack.io/50-years-ago-a-young-bill-gates-took-on-the-software-pirates/
1•naves•5m ago•0 comments

Emacs Hugo Theme

https://github.com/ArthurHeymans/hugo-emacs-theme
1•self•5m ago•1 comments

Monitoring and engaging in social media conversations during a crisis

https://www.tandfonline.com/doi/full/10.1080/23311975.2015.1084978
1•Caarticles•5m ago•0 comments

Show HN: Vibecode Together – StumbleUpon for Vibe-coded projects

https://vibecodetogether.flow.club/
2•dtran•6m ago•0 comments

AI SEC startup CEO posts a job. Deepfake candidate applies, inner turmoil ensues

https://www.theregister.com/2026/02/01/ai_security_startup_ceo_posts/
1•jjoachim3•7m ago•0 comments

Chaldean/Aramaic Flashcards [pdf]

https://www.culturaldiversity.com.au/files/multilingual-resources/2025/01/Chaldean-Bilingual-Phra...
1•marysminefnuf•7m ago•0 comments

Show HN: Drift FM – Ambient Mood Radio (Go, SQLite, Vanilla JavaScript)

https://drift.1mb.dev
1•vnykmshr•8m ago•0 comments

What You Should Know About Facebook CEO Mark Zuckerberg's Senate Hearing

https://blog.acton.org/archives/101128-explainer-what-you-should-know-about-facebook-ceo-mark-zuc...
1•Caarticles•8m ago•0 comments

Goodhart's Law: When a measure becomes a target, it ceases to be a good measure

https://en.wikipedia.org/wiki/Goodhart%27s_law
2•insuranceguru•8m ago•0 comments

Show HN: A small API for generating reliable PDFs using LaTeX

https://texapi.ovh/
2•MrGrzybek•9m ago•0 comments

OpenText to Divest Vertica for US$150M

https://www.morningstar.com/news/pr-newswire/20260202la75996/opentext-to-divest-vertica-for-us150...
1•zX41ZdbW•10m ago•0 comments

llm-d 0.4: Achieve SOTA performance across accelerators

https://llm-d.ai/blog/llm-d-v0.4-achieve-sota-inference-across-accelerators
1•teleforce•11m ago•0 comments

Overpaying me after using illegal plugins

https://priyatham.in/en/post/pirate-plugins/
1•vasquezempereur•11m ago•0 comments

Show HN: A Cursor plugin to output OpenTelemetry for logging / observability

https://github.com/LangGuard-AI/cursor-otel-hook
1•brunes•12m ago•0 comments

The largest number representable in 64 bits

https://tromp.github.io/blog/2026/01/28/largest-number-revised
1•tromp•12m ago•0 comments

/Top4

https://topfour.net
1•surprisetalk•12m ago•0 comments

From 1 to n: Multiplayer Game Design (2018)

https://www.raphkoster.com/games/presentations/from-1-to-n-multiplayer-game-design/
1•surprisetalk•12m ago•0 comments

Stop incentivizing surface parking lots

https://progressandpoverty.substack.com/p/stop-incentivizing-surface-parking
3•surprisetalk•12m ago•0 comments

Hybrid Concolic Testing with Large Language Models for Guided Path Exploration

https://arxiv.org/abs/2601.12274
1•PaulHoule•12m ago•0 comments

Kolakoski Sequence

https://en.wikipedia.org/wiki/Kolakoski_sequence
1•surprisetalk•12m ago•0 comments

Roami: Outing Research Agent

https://roami.ca/
1•idewanck•13m ago•1 comments

Show HN: Histomap Reborn – Interactive visualization of world history

https://histomap.robennals.org/
1•robotelvis•14m ago•0 comments