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?

Signified and Signifier

https://en.wikipedia.org/wiki/Signified_and_signifier
1•soupspaces•2m ago•0 comments

Show HN: Find. Fix. Verify. Zero Guesswork

https://kinetixseo.com
1•wowinter15•8m ago•0 comments

Rethinking do_action(): Events as objects, hooks as class names

https://developer.wordpress.org/news/2026/08/rethinking-do_action-events-as-objects-hooks-as-clas...
1•firasd•16m ago•0 comments

Tesla Explosion in Auburn, Washington Garage Injures Two Firefighters

https://www.forbes.com/sites/gabrielalinzainescu/2026/08/08/runware-squeezes-a-1mw-ai-data-center...
2•01-_-•17m ago•1 comments

Solve math calculations directly in your Firefox address bar

https://support.mozilla.org/en-US/kb/solve-math-calculations-directly-your-firefox-addr
1•internet_points•17m ago•0 comments

DeepSeek V4 Flash 0731: 82.7% on Terminal-Bench 2.1 with a public harness

https://antigma.ai/eval
2•ubermon•35m ago•1 comments

Shrinking Ruby Hashes

https://byroot.github.io/ruby/performance/2026/08/05/shrinking-ruby-hashes.html
1•fanf2•37m ago•0 comments

S3-Compatible Object Storage. A MinIO Fork Maintained by Pgsty

https://github.com/pgsty/silo
2•EXHades•41m ago•0 comments

Abracadabra: How does Shazam work? (2022)

https://www.cameronmacleod.com/blog/how-does-shazam-work
2•downbad_•47m ago•0 comments

Different meanings of p-value (and how my thinking has changed) (2023)

https://statmodeling.stat.columbia.edu/2023/04/14/4-different-meanings-of-p-value-and-how-my-thin...
2•Tomte•47m ago•0 comments

The Origin of Death (1970)

https://www.elijahwald.com/origin.html
1•downbad_•48m ago•0 comments

Systemd Dynamic Users (2020)

https://ethulhu.co.uk/systemd-dynamicuser
2•birdculture•48m ago•0 comments

Show HN: Open-source binaural-beats engine

https://github.com/txus/farfield
1•txus•49m ago•0 comments

Understanding std:counting_semaphore and std:binary_semaphore from C++20

https://www.cppstories.com/2026/semaphore/
2•ygritte•49m ago•0 comments

How to create electronic Japanese hanko seals for Excel

https://sealkit.app/blog/excel-denshi-inkan-tsukurikata
3•sealkit•54m ago•1 comments

Qwen 3.8 and Claude Opus 5 show why raw benchmark scores don't predict the bill

https://venturebeat.com/orchestration/qwen-3-8-max-and-claude-opus-5-show-why-raw-benchmark-score...
2•ashurandi•56m ago•0 comments

Tracking down a Zsh history data loss bug

https://michael.stapelberg.ch/posts/2026-08-09-zsh-history-truncation-bug/
2•secure•1h ago•0 comments

ByteDance Pretraining 10T Parameter Model

https://arstechnica.com/ai/2026/08/bytedance-trains-massive-ai-model-in-bid-to-rival-anthropic/
4•Gecko4072•1h ago•0 comments

Toxic Media

https://bstgrp.notion.site/Reconverting-Streamer-University-From-Spectacle-to-Education-624f0d565...
1•mohgalastpaidei•1h ago•0 comments

China's Top AI Model Evaded Testing Environment, Researchers Say

https://www.bloomberg.com/news/articles/2026-08-07/china-s-top-ai-model-evaded-testing-environmen...
3•sbulaev•1h ago•1 comments

2025 set a record for global vegetation greenness

https://www.nature.com/articles/s43017-026-00776-0
4•vixen99•1h ago•0 comments

Time has started serving ads to AI agents

https://digiday.com/media/time-has-started-serving-ads-to-ai-agents/
4•theanonymousone•1h ago•1 comments

AI Will Change What It Is to Be Human. Are We Ready? (2025)

https://www.thefp.com/p/ai-will-change-what-it-is-to-be-human
1•ronfriedhaber•1h ago•1 comments

Tape scratching the "Peter Piper" routine, using a homemade tape loop [video]

https://www.youtube.com/watch?v=L6SMyND8hso
2•Tomte•1h ago•0 comments

K3I-Core – Low-level Linux kernel isolation and hardware-level veto switch

https://github.com/Skforge2026/k3i-core
2•ddwie•1h ago•0 comments

Software Giant SAP Stops Most Travel and Hiring Because of AI's Soaring Cost

https://www.404media.co/software-giant-sap-stops-most-travel-and-hiring-because-of-ais-soaring-cost/
7•theanonymousone•1h ago•1 comments

They don't make 'em like Sublime Text anymore

https://dbushell.com/2026/08/07/sublime-text/
3•gsky•1h ago•0 comments

El Niño could push 50M people into acute hunger before end of next year

https://www.theguardian.com/environment/2026/aug/05/el-nino-could-push-50m-people-acute-hunger-ne...
5•littlexsparkee•1h ago•0 comments

I built the AI platform for a company crucial to a small nation's food safety

https://twitter.com/swisscheese4299/status/2086175870146998447
1•tosh•1h ago•0 comments

PON-Beam: Notification-Oriented Beam Erlang VM

https://github.com/matheuscamarques/pon_beam
1•vectorinox•1h ago•0 comments