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•11mo 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•11mo 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•11mo 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•11mo 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•11mo ago
Load test against a clone instead of a DB whose contents you care about?

Show HN: Prism – Self-hosted notification gateway (Signal, Telegram, WebPush)

https://github.com/lone-cloud/prism
1•lone-cloud•1m ago•0 comments

New Generation Tri-Digit Character Encoding Table

https://drive.google.com/drive/folders/1H1fs8MckSBomk0s37KN-2atUoUKSoSXY?usp=sharing
2•jackhua18112001•5m ago•1 comments

Meta Is Dying. It's About Time

https://www.nytimes.com/2026/05/08/opinion/meta-facebook-zuckerberg.html
1•flowerlad•5m ago•0 comments

The "Digital Complexity" of Nations

https://github.blog/news-insights/policy-news-and-insights/how-researchers-are-using-github-innov...
1•mlinksva•7m ago•0 comments

Why age assurance laws matter for developers

https://github.blog/news-insights/policy-news-and-insights/why-age-assurance-laws-matter-for-deve...
1•mlinksva•8m ago•0 comments

Rare Look Inside California's Last Nuclear Power Plant

https://www.kqed.org/science/2000835/the-view-inside-californias-last-nuclear-power-plant
1•pseudolus•9m ago•0 comments

Kerncap: Automated Kernel Extraction and Isolation for AMD GPUs

https://arxiv.org/abs/2605.03208
1•matt_d•10m ago•0 comments

Increasing State of Surveillance from All Sides Around the World

https://community.qbix.com/t/increasing-state-of-surveillance-from-all-sides-around-the-world/804
1•EGreg•13m ago•0 comments

Bleeding Llama: Critical Unauthenticated Memory Leak in Ollama

https://www.cyera.com/research/bleeding-llama-critical-unauthenticated-memory-leak-in-ollama
2•nateb2022•13m ago•0 comments

Floppy Days 162 – Interview with Apple Legend, Steve Wozniak

https://www.youtube.com/watch?v=zvPrIrTRdqM
1•oldnetguy•15m ago•0 comments

One keypress is all it takes to compromise four AI coding tools

https://www.helpnetsecurity.com/2026/05/07/trustfall-ai-coding-cli-vulnerability-research/
2•kgolubic•16m ago•0 comments

The Rise of Emotional Surveillance

https://www.theatlantic.com/culture/2026/05/worker-surveillance-emotion-ai/687029/
1•bookofjoe•16m ago•1 comments

It isn't a happy picture, is it?

https://doomsdaymachines.net/p/it-isnt-a-happy-picture-is-it
1•greedo•17m ago•1 comments

Why data center company IREN bought cloud-native power Mirantis

https://opensourcewatch.beehiiv.com/p/here-s-why-data-center-company-iren-bought-cloud-native-pow...
1•CrankyBear•18m ago•0 comments

Vega

https://github.com/vega/vega
2•tosh•20m ago•0 comments

Reading Is the Closest Thing We Have to Telepathy

https://devz.cl/posts/reading-is-the-closest-thing-we-have-to-telepathy/
1•DanielVZ•22m ago•0 comments

How to learn to code in the age of AI

https://devz.cl/posts/how-to-learn-to-code-in-the-age-of-ai/
1•DanielVZ•23m ago•0 comments

JupyterLab

https://github.com/jupyterlab/jupyterlab
2•tosh•23m ago•0 comments

There Is No 'Hard Problem of Consciousness'

https://www.noemamag.com/there-is-no-hard-problem-of-consciousness/
2•Hooke•24m ago•0 comments

Show HN: Build a custom AI in under 60 seconds (demo video)

https://www.youtube.com/watch?v=wXnq_49sCow
1•AnujKapasia•25m ago•0 comments

Thousands of Vibe-Coded Apps Expose Corporate and Personal Data on the Open Web

https://www.wired.com/story/thousands-of-vibe-coded-apps-expose-corporate-and-personal-data-on-th...
2•mooreds•25m ago•0 comments

The Sunset of Arrogance as a Service

https://valeriavg.dev/the-sunset-of-arrogance-as-a-service
1•mooreds•25m ago•0 comments

Asking Better Questions

https://michaelheap.com/asking-better-questions/
1•mooreds•25m ago•0 comments

Apple, Intel have reached preliminary chip-making deal

https://www.reuters.com/business/apple-intel-have-reached-preliminary-chip-making-deal-wsj-report...
25•scrlk•26m ago•0 comments

DynDNS via SSH and NSD

https://cweiske.de/tagebuch/ssh-dyndns2.htm
1•speckx•26m ago•0 comments

Widower can't renew license because DMV software unearthed 47yo speeding ticket

https://www.whec.com/top-news/news10nbc-investigates-widower-cant-renew-drivers-license-because-d...
1•josephcsible•26m ago•0 comments

Forgejo "carrot disclosure" raises security questions

https://lwn.net/Articles/1071499/
1•chmaynard•27m ago•0 comments

Killswitch: Add per-function short-circuit mitigation primitive

https://lwn.net/ml/all/20260507070547.2268452-1-sashal@kernel.org/
1•jervant•27m ago•0 comments

How (Not) to Manage Your Agent Team

https://gavinpineapple.substack.com/p/how-not-to-manage-your-agent-team
2•gavinpineapple•28m ago•1 comments

Wealth is righteously earned and poverty is righteously dispensed

https://www.welcometohellworld.com/wealth-is-righteously-earned-and-poverty-is-righteously-dispen...
2•speckx•31m ago•0 comments