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

Myths about correct posture [video]

https://www.youtube.com/watch?v=n7h8H4nGeMw
1•sanbor•26s ago•0 comments

Introduction to Ft Linux Administration

https://stratadoc.stratus.com/linux/2.1.0/r003l-00/wwhelp/wwhimpl/js/html/wwhelp.htm?context=r003...
1•doener•1m ago•0 comments

Urban Expansion in the Age of Liberalism

https://worksinprogress.co/issue/urban-expansion-in-the-age-of-liberalism/
1•barry-cotter•2m ago•1 comments

NonStop (Server Computers)

https://en.wikipedia.org/wiki/NonStop_(server_computers)
1•doener•2m ago•0 comments

Halide co-founder joins Apple's design team

https://www.engadget.com/big-tech/halide-co-founder-joins-apples-design-team-235023416.html
1•qingcharles•4m ago•0 comments

Google DeepMind will introduce Genie 3 to the public soon

https://twitter.com/OfficialLoganK/status/2016756742735221001
1•dvrp•6m ago•0 comments

Anti-immigration AfD party wants to bring ICE to Germany

https://www.thelocal.de/20260128/anti-immigration-afd-party-wants-to-bring-ice-to-germany
1•vinni2•6m ago•0 comments

GitHub Skills

https://github.com/skills
1•saikatsg•7m ago•0 comments

Users flock to open source Moltbot for always-on AI, despite major risks

https://arstechnica.com/ai/2026/01/viral-ai-assistant-moltbot-rapidly-gains-popularity-but-poses-...
1•TMWNN•8m ago•0 comments

Inside the IPIDEA residential proxy network disrupted by Google

https://deviceandbrowserinfo.com/learning_zone/articles/inside-ipidea-residential-proxy-network
1•avastel•10m ago•0 comments

ScanAPI: Automated Integration Testing and Live Documentation for your API

https://github.com/scanapi/scanapi
1•saikatsg•11m ago•0 comments

A simple HTTP tunnel ngrok alternative (2024)

https://github.com/peter-leonov/webhooks-proxy-tunnel
1•todsacerdoti•11m ago•0 comments

Ask HN: How far has "vibe coding" come?

2•pigon1002•12m ago•2 comments

Fuzzing 101

https://github.com/antonio-morales/Fuzzing101
2•saikatsg•15m ago•0 comments

How to, mostly, guarantee success in your career

https://www.elliotcsmith.com/how-to-mostly-guarantee-success-in-your-career/
1•smitec•19m ago•0 comments

Australia hits power demand record as renewables pass 50pc milestone

https://www.abc.net.au/news/2026-01-29/australia-hits-power-demand-record-as-renewables-pass-50pc...
2•flgb•19m ago•0 comments

Internet Archive web. partial outage

https://web.archive.org/web/20040609220929/http://home.att.net/~stickworks/
2•burnt-resistor•21m ago•2 comments

Dark Software Engineering

https://www.julianmwagner.com/articles/dark-software-fabric
1•jwpapi•28m ago•0 comments

MCP Apps are here after OpenAI apps SDK

http://blog.modelcontextprotocol.io/posts/2026-01-26-mcp-apps/
1•astro_09•29m ago•0 comments

OpenAI's Unit Economics

https://www.exponentialview.co/p/inside-openais-unit-economics-epoch-exponentialview
1•swolpers•29m ago•0 comments

Show HN: Introducing: HTTPS://nicer.app/wiki/frontpage

https://nicer.app/wiki/frontpage
1•rene-veerman•36m ago•0 comments

A knowledge management system inspired by plain-text accounting

https://thalo.rejot.dev/blog/plain-text-knowledge-management
1•WilcoKruijer•37m ago•0 comments

Crucible of the Cascade: The crash of Gazpromavia flight 9608 (2025)

https://admiralcloudberg.medium.com/crucible-of-the-cascade-the-crash-of-gazpromavia-flight-9608-...
1•hahahahhaah•39m ago•0 comments

Deep Dive on HBM

https://www.nomadsemi.com/p/deep-dive-on-hbm
2•walterbell•41m ago•0 comments

Show HN: My workflow for editing and compiling videos as a programmer

https://initcoder.com/posts/my-workflow-for-editing-video-as-a-programmer/
2•chbkall•41m ago•0 comments

A TODO List that works (2023)

https://www.softwaredesign.ing/blog/todo-list-that-actually-works
2•cachius•42m ago•0 comments

Show HN: Selling New Era Calculator

2•sandeepkd•44m ago•0 comments

Adding structure once you find PMF

https://holenventures.substack.com/p/adding-structure-to-a-spike
2•hholen•44m ago•0 comments

How to Build an Agent

https://ampcode.com/how-to-build-an-agent
2•jen20•47m ago•0 comments

SQLite in Production? Not So Fast for Complex Queries

https://yyhh.org/blog/2026/01/sqlite-in-production-not-so-fast-for-complex-queries/
3•dimitar•50m ago•0 comments