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: Widefleet – Open-source platform for agent-built apps and workflows

https://github.com/widefleet/widefleet
2•jonathan_laib•1m ago•1 comments

Hi Fellow Furries

1•Illoko•4m ago•0 comments

Swarmfile: A streaming version-control system

https://swarmfile.com/blog/swarmfile-a-streaming-version-control-system/
1•EngineeringStuf•5m ago•0 comments

Pierre Brassau, Monkey Artist

https://hoaxes.org/archive/permalink/pierre_brassau_monkey_artist
1•fallinditch•5m ago•0 comments

Jonathan Blow Made 500 Hours of Puzzles to Explode Your Mind

https://www.nytimes.com/2026/10/09/arts/jonathan-blow-order-of-the-sinking-star.html
1•jonas21•6m ago•0 comments

Show HN: This hotel is hella AI-ready. Book directly from AI without MCPs

https://cadent.studio/
1•eddyariki•7m ago•0 comments

Open Codenames: a new way to benchmark LLMs

https://github.com/attilatorda/open-codenames
1•AttilaT•7m ago•1 comments

What Will Happen to Indian IT?

https://asteriskmag.com/issues/15/what-will-happen-to-indian-it
1•indiantinker•8m ago•0 comments

Show HN: Fabrika, Opinionated Software Factory

https://tatiyants.com/fabrika/
2•atatiyan•9m ago•0 comments

Contentful Agent Template

https://github.com/vercel-labs/eve-contentful-agent-template
1•flashbrew•10m ago•0 comments

Ely Office: An office suite built in Rust based on LibreOfficeKit

https://github.com/ZacharyZhang-NY/ElyOffice
1•nogajun•11m ago•0 comments

An Ion Storm, Part 1: The Ascent to Gamer Paradise

https://www.filfre.net/2026/10/an-ion-storm-part-1-the-gamers-penthouse/
1•doppp•14m ago•0 comments

Several major bugs in OpenAI's Math release

https://blog.ohaithe.re/post/829974396980641792/id-like-to-alert-people-that-several-of-the
1•unprovable•16m ago•1 comments

We gave an AI a phone and asked 1000 SF businesses a question

2•ymarkov•16m ago•1 comments

Spec-Forge – Zero-config OpenAPI mock server with strict validation&MCP stdio

https://spec-forge.dev2share.com
1•gorlak-town•17m ago•0 comments

Spotify Technology

https://technology.spotify.com
2•dovyski•17m ago•0 comments

Gaia Sky – open-source 3D Universe visualization platform

https://gaiasky.space/
1•ghgr•18m ago•0 comments

Netflix trailer for miniseries about Sam Bankman-Fried's crypto exchange

https://www.engadget.com/2281997/netflix-the-altruists-sam-bankman-fried-trailer/
1•andsoitis•19m ago•0 comments

Show HN: Pulsar – Qwen3.8-27B at 148 tok/s writing code on M5 Max

https://github.com/loopai-hq/pulsar
1•darkbatman•19m ago•0 comments

Design for Agent GUIs

https://lexifina.com/blog/agent-guis
1•alansaber•19m ago•0 comments

Maryland law requires radiologists inform patients of heart disease warning sign

https://www.npr.org/2026/10/08/nx-s1-5993782/new-maryland-law-requires-radiologists-inform-patien...
1•bookofjoe•19m ago•0 comments

Republican data center support collapses locally when sites are in GOP counties

https://pressaudit.org/f/community/posts/9c163c6e-53b7-46a3-b052-2e3c6954c04f
3•SLHamlet•21m ago•0 comments

Show HN: Fix for Xbox controllers that connect but don't work in Bevy on macOS

https://github.com/angx1/bevy_apple_gamepad/tree/main
1•angxl•22m ago•0 comments

Senator Demands Info About White House's License Plate Surveillance Program

https://www.404media.co/following-404-media-investigation-senator-demands-info-about-white-houses...
4•mikelgan•24m ago•0 comments

Cloudping: Measure latency from the browser to various cloud provider regions

https://www.cloudping.info/
1•bobbiechen•25m ago•0 comments

City Regrets New Religious Liberty Law Allowing Prayer at City Council Meeting

https://www.404media.co/it-is-done-hail-satan-city-immediately-regrets-new-religious-liberty-law-...
4•Refreeze5224•25m ago•1 comments

Show HN: A daily F1 quiz: 10 questions, 12 seconds each

https://the-daily-grid.vercel.app/l/CKAU3G4
1•leonagano•27m ago•0 comments

Max severity SonicWall SMA1000 flaw now exploited in attacks

https://www.bleepingcomputer.com/news/security/max-severity-sonicwall-sma1000-flaw-now-exploited-...
1•sbulaev•27m ago•0 comments

Two-Way Doors: Don't Code Yourself into a Corner

https://testing.googleblog.com/2026/10/two-way-doors-dont-code-yourself-into.html
1•birdculture•28m ago•0 comments

Show HN: Coolphabets – Teaching kids to read and write in their mother tongue

2•samdung•29m ago•0 comments