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?

Show HN: NanoEuler – GPT-2 scale model in pure C/CUDA from scratch

https://github.com/JustVugg/nanoeuler
2•vforno•4m ago•0 comments

TOP500 at ISC'26: We Have a New Number 1 – By George Cozma

https://chipsandcheese.com/p/top500-at-isc26-we-have-a-new-number
2•rbanffy•4m ago•0 comments

Ante: A New Way to Blend Borrow Checking and Reference Counting

https://verdagon.dev/blog/ante-blending-borrowing-rc
1•g0xA52A2A•4m ago•0 comments

Researchers Set Hybrid Bonding Records

https://spectrum.ieee.org/hybrid-bonding-2677022836
1•rbanffy•5m ago•0 comments

Nourish: A New Wayland Compositor Powered by Vulkan with Infinite Scrolling

https://www.phoronix.com/news/Nourish-Wayland-Compositor
1•okso•6m ago•1 comments

Ford rehires 'gray beard' engineers after AI falls short

https://techcrunch.com/2026/06/28/ford-rehires-gray-beard-engineers-after-ai-falls-short/
6•rbanffy•6m ago•0 comments

Enough Numbers to Build a Universe

https://www.stephendiehl.com/posts/universe/
1•tmach32•8m ago•0 comments

Cloudflare cut 1,100 jobs and then grew its engineering team by 45 percent

https://thenextweb.com/news/cloudflare-builders-sellers-measurers-engineering-surge-ai-layoffs
2•karlmush•8m ago•0 comments

Show HN: Use-zerostack – delegate any task to a lightweight coding agent

https://github.com/gi-dellav/use-zerostack/
1•gidellav•9m ago•0 comments

Cold War Erosion Simulation

https://github.com/ajsbsd/ajsbsd-jwst-cli
1•ajsBSDdotnet•10m ago•1 comments

Asciigraph: Go pkg to make lightweight ASCII graph in CLI with zero dependencies

https://github.com/guptarohit/asciigraph
1•atkrad•11m ago•0 comments

Mercury – Open-source, local-first agentic harness for Android

https://github.com/Yene96/Mercury
1•yene96•14m ago•0 comments

Release v1.27.0 · go-delve/delve

https://github.com/go-delve/delve/releases/tag/v1.27.0
1•atkrad•16m ago•0 comments

The Curious Case of Aa.ns.charter.com

https://mikehowells.com/2026/06/21/the-curious-case-of-aa-ns-charter-com/
1•sashk•17m ago•0 comments

A conversation with Marc Andreessen (2000-10-02)

https://charlierose.com/videos/5018
1•andreyazimov•20m ago•0 comments

Show HN: I built an opinionated minimalist ePub/pdf online reader

https://epub.mirror.forum
1•Imustaskforhelp•21m ago•0 comments

A wire-faithful, browser-based re-creation of the Atari ST game MIDI Maze

https://github.com/diegoparrilla/midi-maze-js
5•logronoide•24m ago•0 comments

WinPE as a stateless harness for Windows driver testing and fuzzing

https://bednars.me/blog/winpe-harness
2•piotrbednarsalt•24m ago•0 comments

Your Kids’ School Bus Is About to Become a Roaming Surveillance Vehicle

https://www.thedrive.com/news/your-kids-school-bus-is-about-to-become-a-roaming-surveillance-vehicle
2•voxadam•29m ago•0 comments

Show HN: Snarl – Fast Shacl Validator

https://github.com/trivyn/snarl
1•jcadam•29m ago•0 comments

SISU: The Feeling of Perseverance

https://finland.fi/emoji/sisu/
1•jruohonen•33m ago•1 comments

The US Used to Demand the Best Tech. Now We Ban It

https://www.pcmag.com/opinions/the-us-used-to-demand-the-best-tech-now-we-ban-it
7•mwexler•34m ago•1 comments

What I Do Not Understand, (A)I Cannot Create

https://medium.com/@joshua.sparaga/what-i-do-not-understand-a-i-cannot-create-740d335e33fb
1•psteitz•34m ago•0 comments

Show HN: Prose or Con, can you detect AI writing?

https://prose-or-con.com/
1•SwellJoe•35m ago•1 comments

Keyless, Identity-Aware Access to Any AI

https://netbird.ai/
1•braginini•35m ago•0 comments

Do LLMs pass the mirror test?

https://blog.pascalschuster.de/article/do-llms-pass-the-mirror-test
2•thepasch•36m ago•0 comments

LLDB MCP

https://lldb.llvm.org/use/mcp.html
2•Austin_Conlon•42m ago•0 comments

Computer-Aided Language Development in Nonspeaking Children (1968) [pdf]

https://archive.org/details/colby1968-computer-aided-language-development-in-non-speaking-children
3•dang•42m ago•0 comments

PostgreSQL and ClickHouse as the Open Source unified data stack

https://clickhouse.com/blog/postgres-clickhouse-oss
1•saisrirampur•44m ago•0 comments

EU-Backed DNS Resolver Collects Pirate Site Blocklist, Which It Doesn't Use

https://torrentfreak.com/eu-backed-dns-resolver-collects-pirate-site-blocklist-which-it-doesnt-use/
5•gslin•45m ago•0 comments