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

Ask HN: Any Tradespeople Here?

2•documentorium•4m ago•0 comments

Hold on to Your Hardware

https://xn--gckvb8fzb.com/hold-on-to-your-hardware/
1•LucidLynx•6m ago•0 comments

Ten C64 Demo [video]

https://www.youtube.com/watch?v=QMDE_Sd98cA
1•Fr0styMatt88•7m ago•0 comments

Comparison of two frameworks: 4.0M vs. 2.5M tokens for the same app

https://wasp.sh/blog/2026/03/26/nextjs-vs-wasp-40-percent-less-tokens-same-app
1•Martinsos•8m ago•0 comments

SimpleLogin CLI

https://github.com/mexcool/simplelogin-cli
1•mexcool•10m ago•0 comments

Chronoo – a web-based journaling app where data is stored locally in the browser

https://github.com/altilunium/chronoo
1•altilunium•16m ago•0 comments

Show HN: Walkie-Talkie – Access your terminal from any browser with one command

https://www.walkie-talkie.dev/
1•vochsel•17m ago•0 comments

Noelia Castillo Euthanasia Case

https://en.wikipedia.org/wiki/Noelia_Castillo_euthanasia_case
2•stared•18m ago•0 comments

See what your AI agents are doing (multi-agent observability tool)

https://github.com/hit1001/multiagent-visibility-tool
1•denhit10•19m ago•0 comments

Show HN: Writevoid.com – stop writing, and the void takes it

https://writevoid.com
1•user_timo•20m ago•1 comments

Data centre to be built near planned Polish nuclear power plant

https://world-nuclear-news.org/articles/data-centre-to-be-built-near-planned-polish-nuclear-power...
1•mpweiher•23m ago•0 comments

Ipxlat: a stateless IPv4/IPv6 translation device

https://lore.kernel.org/netdev/20260319151230.655687-1-ralf@mandelbit.com/T/#m6b6603d690f9bd7f85c...
1•argulane•24m ago•0 comments

I built Amazon dynamo in elixir

https://jitesh117.github.io/blog/implementing-amazon-dynamo-in-elixir/
1•Jitesh117•25m ago•0 comments

A discrete-logic solution to the Three-Body Problem (99% compute saving)

https://github.com/alikamp/Parks-Node-Ejection-Protocol
1•kauai1•26m ago•0 comments

Splitflap.org: open-source split-flap display for any screen

https://splitflap.org/
1•mohdmahmodi•27m ago•0 comments

You shall know them by their scams

https://terminaldrift.substack.com/p/you-shall-know-them-by-their-scams
1•limbicsystem•30m ago•0 comments

Show HN: 10 Lines of Python to fix mangled copy-paste from Claude Code

1•collectedparts•31m ago•0 comments

Ronda Rousey Fights Like an Outlier (2015)

https://fivethirtyeight.com/features/ronda-rousey-fights-like-an-outlier/
1•chistev•31m ago•1 comments

Understanding the Go Runtime: The Garbage Collector

https://internals-for-interns.com/posts/go-garbage-collector/
1•valyala•31m ago•0 comments

Proxybase IP Whois Aggregator

https://proxybase.xyz/ip
1•m00dy•32m ago•0 comments

Final analysis of 2025 Iberian blackout: electrical grid operating policies left

https://arstechnica.com/science/2026/03/final-analysis-of-2025-iberian-blackout-policies-left-spa...
1•fanf2•35m ago•0 comments

Rustlings - Small exercises to get you used to reading and writing Rust code

https://rustlings.rust-lang.org/
3•tilt•35m ago•0 comments

I Built My Personal Site with AI in 4 Days

https://www.dhawalshah.net/article/building-personal-site-with-ai
2•djshah•36m ago•0 comments

Open Source Gave Me Everything Until I Had Nothing Left to Give

https://kennethreitz.org/essays/2026-03-18-open_source_gave_me_everything_until_i_had_nothing_lef...
2•rglullis•39m ago•0 comments

Study: Sycophantic AI can undermine human judgment

https://arstechnica.com/science/2026/03/study-sycophantic-ai-can-undermine-human-judgment/
1•Liriel•39m ago•0 comments

Show HN: Web service for writing a log (history) of your company

https://sharedlog.app/
1•keyhell•39m ago•0 comments

Building Kenya's Money Rail with .NET SQL Server and SMS in 2005

https://jkitsao.substack.com/p/inside-the-first-m-pesa-backend-20052013
1•kitsao•46m ago•0 comments

Show HN: Agent Forge, an agent framework, heuristic routing and graph execution

https://github.com/Minns-ai/agent-forge-sdk
4•gooseyGander•47m ago•0 comments

Porting Go's io package to C

https://antonz.org/porting-go-io/
1•valyala•48m ago•0 comments

Switch preferences and chat history from other LLM apps to Gemini

https://blog.google/innovation-and-ai/products/gemini-app/switch-to-gemini-app/
1•Yizahi•51m ago•1 comments