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?

The Failed Fight to Unionize One of Gaming's Most Idealized Studios

https://kotaku.com/inside-the-failed-fight-to-unionize-one-of-gamings-most-idealized-studios-2000...
1•schrototo•16s ago•0 comments

Writing a Demoscene Intro for the ZX Spectrum

https://www.markround.com/blog/2026/zx-spectrum-intro
1•signa11•2m ago•0 comments

Show HN: I built a banking demo with LavinMQ to test messaging failures

https://github.com/cloudamqp/lavinmq-demos/tree/main/nodejs-clients-demo
1•hailay•3m ago•0 comments

Formally Verifying a Compiler Using Automated Research

https://www.paradigm.xyz/writing/solidus
1•ronfriedhaber•4m ago•0 comments

Show HN: Figranium – Build browser automations visually and run them as APIs

https://github.com/figranium/figranium
1•asernasr•5m ago•0 comments

Evidence theater: how AI fooled smart entrepreneurs

https://mcastenfors.substack.com/p/evidence-theater-how-ai-fooled-smart
1•mcastenfors•5m ago•0 comments

The Name Is the Spec

https://fromautomation.co/p/the-name-is-the-spec
1•ghels1444•5m ago•0 comments

Anatomy · a Skill for Claude Code

https://skills.wheresryan.sh/anatomy
1•handfuloflight•6m ago•0 comments

Show HN: An open source AI leaderboard of the best models your machine can run

https://whatmodel.sh
1•jakemanger•8m ago•0 comments

Rackspace Email Issues

https://status.apps.rackspace.com/index/viewincidents?group=100&start=1791777600
1•Betelbuddy•11m ago•0 comments

Britain to get first look at new AI systems after White House U-turn

https://www.telegraph.co.uk/news/2026/10/11/britain-get-first-look-ai-systems-after-white-house-u...
1•snikolaev•12m ago•0 comments

Visualizing Crossbeam Epoch Based Reclamation

https://sofiabelen.github.io/projects/visualizing-crossbeam-epoch-based-reclamation/
1•sofiabelenlopez•12m ago•0 comments

900-Page Pre-Pantone Guide to Color from 1692 (With Complete High-Res Scan)

https://www.openculture.com/2026/10/a-900-page-pre-pantone-guide-to-color-from-1692.html
2•mdp2021•21m ago•0 comments

Show HN: I made an AI free version of my directory of open-source alternatives

https://noai.openaltfinder.com/
2•woutr_be•25m ago•0 comments

The Role of Nuclear in the Energy Transition: Complementary but Limited

https://www.energy-transitions.org/publications/nuclear-in-the-energy-transition/
1•ZeroGravitas•27m ago•0 comments

I posted 100 tiktoks as introverted engineer

1•weekendViper•28m ago•0 comments

X Once Again Marks the Spot

https://daringfireball.net/2026/10/x_once_again_marks_the_spot
1•tosh•29m ago•0 comments

Fake reviews on the Google Play store

1•lo0dot0•29m ago•0 comments

Ask HN: What desk chair would you recommend for a home office?

1•ap11071•30m ago•1 comments

Slop City

https://slopcity.org/
2•logn•30m ago•0 comments

Show HN: Test UI Hypotheses for Mobile Paywalls

https://onlang.io/login?next=%2Fapp
3•sovkov•32m ago•0 comments

Building my own expense tracker

https://sungatae.com/posts/building-my-own-expense-tracker/
1•visujosh•34m ago•0 comments

Catch a Bird – I made it for my own sanity

https://catchabird.com
2•eduardsik•35m ago•0 comments

Heldearly

https://heldearly.com
1•sarcfd•38m ago•0 comments

Whacky Japanese moving keyboard may be the future or not

https://www.t3.com/tech/computers-pcs/this-whacky-japanese-moving-keyboard-may-be-the-future-or-not
2•mushstory•39m ago•0 comments

DraftKings Says It Doesn't Want Problem Gamblers. I Bet $22K to find out [video]

https://www.youtube.com/watch?v=l8IyGjdY1sg
2•xbmcuser•40m ago•0 comments

Trump Mobile hack and apparent lack of FCC authorization raise security alarms

https://arstechnica.com/tech-policy/2026/10/trump-mobile-doesnt-seem-to-have-fcc-authorization-fo...
3•rbanffy•41m ago•0 comments

Ask HN: How are you handling auth token storage in React Native in 2026?

1•smichloe01•42m ago•0 comments

Leading Chinese mathematicians unite behind use of AI in research

https://www.scmp.com/news/china/science/article/3370492/leading-chinese-mathematicians-unite-behi...
2•ChickeNES•42m ago•0 comments

Videopowers – A factory plugin for making YouTube videos with Claude Code

https://github.com/vinit-agr/videopowers
2•vinitagr•44m ago•0 comments