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?

Show HN: A chess.com profiler that runs Stockfish in the browser

https://the-law-1.github.io/chess-insights/
1•the_law•1m ago•0 comments

Microsoft Exchange, Windows 11 hacked on second day of Pwn2Own

https://www.bleepingcomputer.com/news/security/pwn2own-day-two-hackers-demo-microsoft-exchange-wi...
1•Brajeshwar•1m ago•0 comments

Frink – programming language designed to make physical calculations simple

https://frinklang.org/#AboutFrink
1•gurjeet•2m ago•0 comments

Show HN: I scanned Cal.com for architecture drift caused by AI coding tools

https://github.com/mattykry/revos
1•Mattykry•2m ago•0 comments

Auto-Improving Software

https://twitter.com/ashpreetbedi/status/2053885390717890757
1•gmays•4m ago•0 comments

Bluesky Radio – Hosted by Opus 4.7

https://bskyrad.io/
1•wilted-iris•4m ago•0 comments

Ruby-charts: Generate pie, bar, and line charts from data files

https://github.com/ggerman/ruby-charts
1•thunderbong•6m ago•0 comments

iOS-Linuxkit: Linux on iPad, the Hard Way

https://taoofmac.com/space/blog/2026/05/16/1130
2•rcarmo•6m ago•0 comments

Do you spend 1h+ time a week just reading?

https://grops.biz/app
1•filippo_ciprian•6m ago•1 comments

Is the Secret to Men's Longevity a Great Butt?

https://www.wsj.com/lifestyle/fitness/glutes-men-longevity-hockey-butt-9c02666d
1•rawgabbit•9m ago•0 comments

Redux maintainer's thoughts on AI

https://blog.isquaredsoftware.com/2026/05/ai-thoughts-part-1-fears-opinions-journey/
1•newbie578•11m ago•0 comments

OpenAI seals deal in Malta to give all Maltese access to ChatGPT Plus

https://www.reuters.com/business/openai-seals-deal-malta-give-all-maltese-access-chatgpt-plus-202...
1•T-A•13m ago•0 comments

Recent Developments in LLM Architectures: KV Sharing, MHC, Compressed Attention

https://substack.com/@rasbt/p-197933886
1•eigenBasis•14m ago•0 comments

I spent my whole career building passive income. Here's what I got wrong

https://dariusforoux.com/i-spent-my-whole-career-building-passive-income-heres-what-i-got-wrong/
2•speckx•16m ago•0 comments

Rikkahub-agent OpenClaw/hermes for Android phones

https://github.com/ExTV/rikkahub-agent
1•ExTv•16m ago•0 comments

What it would have been like to experience the dinosaur-killing asteroid

https://theconversation.com/what-it-would-have-been-like-to-experience-the-dinosaur-killing-aster...
1•akkartik•16m ago•0 comments

The Changing Landscape of CTF-Based Learning

https://exploiting.systems/posts/2026-05-15-the-changing-landscape-of-ctf-based-learning
2•ropbear•21m ago•0 comments

Show HN: A Claude Skill to render resume templates. CV/Resumes are HTML and JSON

https://github.com/farhan0167/cv-claw
1•farhan0167•24m ago•0 comments

Repositories Are Human/Agent Knowledge Factories – Sigplan Blog

https://blog.sigplan.org/2026/04/21/repositories-are-human-agent-knowledge-factories/
1•rbanffy•24m ago•0 comments

GitHub takes aim at Claude Code and Codex with its new Copilot app

https://thenewstack.io/github-copilot-desktop-app/
1•Brajeshwar•24m ago•0 comments

How to Use LLMs as Teachers?

1•KneeAwn•25m ago•0 comments

UFO files nod to growing belief in aliens and mistrust in institutions

https://www.washingtonpost.com/opinions/2026/05/15/ufo-files-nod-growing-belief-aliens-mistrust-i...
1•bookofjoe•28m ago•1 comments

The Protein Shortage Is Coming

https://www.theatlantic.com/culture/2026/05/protein-powder-shortage/687193/
2•fortran77•29m ago•0 comments

Accelerate

https://github.com/AccelerateHS/accelerate
3•tosh•30m ago•0 comments

Using static websites for tiny archives

https://alexwlchan.net/2024/static-websites/
2•lemonberry•35m ago•0 comments

It's OK to want to have a good time [pdf]

https://drops.dagstuhl.de/storage/01oasics/oasics-vol134-programming2025/OASIcs.Programming.2025....
1•surprisetalk•36m ago•0 comments

MCP-stdio-guard – MCP stdio sanity checks

https://github.com/1Utkarsh1/mcp-stdio-guard
1•utkarsh4995•43m ago•0 comments

The Accidental Bestseller (2014)

https://www.publishersweekly.com/pw/by-topic/childrens/childrens-book-news/article/64933-the-acci...
1•downbad_•43m ago•0 comments

Norwich Community Kitchen – Community Input Survey

https://envisionnorwich360.com/en/projects/norwich-community-kitchen
1•mooreds•44m ago•0 comments

Stera: Open-Source Infra That Turns iPhones into Spatial Data for World Models

1•satpal•45m ago•0 comments