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

EU threatens temporary measures to stop Meta blocking AI rivals from WhatsApp

https://www.reuters.com/world/eu-threatens-meta-with-interim-measure-blocking-ai-rivals-whatsapp-...
1•giuliomagnifico•52s ago•0 comments

Show HN: Memy – track and find directories and files you use frequently [video]

https://www.youtube.com/watch?v=YKfYz_56nkg
1•andrewf99•1m ago•0 comments

Using Claude Code as a general agent

https://www.raahelbaig.com/entry/claude-code-as-a-general-agent/
1•raahelb•2m ago•0 comments

Matrix messaging gaining ground in government IT

https://www.theregister.com/2026/02/09/matrix_element_secure_chat/
2•rbanffy•5m ago•0 comments

Taiwan says 40% shift of chip capacity to US is 'impossible'

https://www.reuters.com/world/china/taiwan-says-40-shift-chip-capacity-us-is-impossible-2026-02-09/
2•c420•8m ago•0 comments

Show HN: OpenClaw Self-Healing v2.0 – AI that diagnoses and repairs itself

https://github.com/Ramsbaby/openclaw-self-healing
1•ramsbaby•8m ago•0 comments

Recursive Self-Improvement (Part I)

https://www.hyperdimensional.co/p/on-recursive-self-improvement-part
1•energy123•12m ago•0 comments

Show HN: MadLab – A standalone desktop app for local LLM fine-tuning

https://github.com/Archimedes1618/Madlab/releases/tag/v0.5.0
1•Archimedes1618•15m ago•0 comments

Opus 4.6 Fast Mode – 2.5x better token throughput in Copilot

https://github.blog/changelog/2026-02-07-claude-opus-4-6-fast-is-now-in-public-preview-for-github...
1•summarity•15m ago•0 comments

Architecture as Science – Barry O'Reilly – NDC Oslo 2025

https://www.youtube.com/watch?v=hUNuHQdMG2Y
1•aivarsk•16m ago•0 comments

Copy Top Polymarket Wallets

https://www.holypoly.io/
1•alexanderstahl2•16m ago•0 comments

Review: Why the Lucky Stiff

https://tmewett.com/whytheluckystiff/
2•tmewett•20m ago•0 comments

Show HN: A website that proves you are richer than everyone else

https://iamthericher.com
1•hjotha•21m ago•1 comments

Show HN: Kodus – Open-Source Alternative to CodeRabbit

https://github.com/kodustech/kodus-ai
1•eddelgado•21m ago•0 comments

Cuba warns airlines that it will run out of fuel for planes within 24 hours

https://en.cibercuba.com/noticias/2026-02-09-u1-e13-s27061-nid320369-cuba-advierte-aerolineas-24-...
2•belter•22m ago•0 comments

Avoiding Modern C++ – Anton Mikhailov (YouTube) [video]

https://www.youtube.com/watch?v=ShSGHb65f3M
1•krstffr•23m ago•0 comments

Mapping the Moon: The Apollo Transforming Printer

https://blogs.loc.gov/maps/2025/12/mapping-the-moon-the-apollo-transforming-printer/
1•bryanrasmussen•24m ago•0 comments

Show HN: Busted – eBPF tool that monitors what your AI agents send

https://github.com/barakber/busted
1•barakber•24m ago•0 comments

Rule #1 for coding with AI agents

https://zknill.io/posts/only-ai-tasks-you-know-how-to-do/
1•zknill•25m ago•0 comments

A New Kind of Wireless [video]

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

Show HN: xllify: Turn formulas, VBA, or plain English into Excel add-ins

https://xllify.com/
2•alexjreid•25m ago•2 comments

AppSecMaster – Learn web hacking with hands-on challenges

https://www.appsecmaster.net/en
4•aqeisi•27m ago•1 comments

FRTMProxy, free, open source alternative to Proxyman and Charles

https://github.com/ValentinoPalomba/FRTMProxy
1•fratm•27m ago•1 comments

Show HN: Minimal NIST/OWASP-compliant auth implementation for Cloudflare Workers

https://github.com/vhscom/private-landing
1•vhsdev•28m ago•1 comments

I Am an Anarcho Pacifist, Opposing the Deep State Center of Power, The Pentagon

3•pcwir•29m ago•2 comments

A daily word puzzle my 9-year-old daughter designed

https://wordpizza.com
1•tryanythingonce•29m ago•2 comments

Thinkst citation: collection of infosec talks

https://citation.thinkst.com
1•serhack_•32m ago•0 comments

Thinkst Scapes

https://thinkst.com/ts/
1•serhack_•33m ago•0 comments

Roll with Advantage: Hacking Lenovo Vantage

https://mkiesel.ch/posts/lenovo-vantage/
1•xn--yt9h•34m ago•0 comments

Technology Radar Volume 33

https://www.thoughtworks.com/radar
1•samuel246•35m ago•0 comments