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

Writing Liveness

https://contraptions.venkateshrao.com/p/writing-liveness
1•jger15•30s ago•0 comments

AI agent called every pub in Ireland to index the cost of a Guinness

https://guinndex.ai
1•bilekas•3m ago•0 comments

Show HN: Building compiler from scratch without the help of LLMs [video]

https://www.youtube.com/watch?v=THIkjQnqsbw
2•aarnphm•3m ago•0 comments

Global freedom declined for the 20th consecutive year in 2025

https://freedomhouse.org/report/freedom-world/2026/growing-shadow-autocracy
1•Cider9986•4m ago•0 comments

Show HN: Mac-computer-use, an open-source clone of Codex Computer Use

https://github.com/TheGuyWithoutH/mac-computer-use
1•guywithnoh•7m ago•0 comments

Colombia will euthanize Pablo Escobar's invasive 'cocaine hippos'

https://www.scientificamerican.com/article/colombia-will-euthanize-pablo-escobars-invasive-cocain...
1•zdw•10m ago•0 comments

Fatal Accident Occurs in Nurburgring Langstrecken-Serie (NLS)

https://www.bbc.com/sport/motorsport/articles/crl1wwdegkno
1•linzhangrun•12m ago•0 comments

Bounce Off the Atmosphere at Reentry? (2016)

https://space.stackexchange.com/questions/19296/bounce-off-the-atmosphere-at-reentry
1•susam•13m ago•0 comments

F-14 Central Air Data Computer

https://en.wikipedia.org/wiki/F-14_CADC
1•unsnap_biceps•14m ago•1 comments

Verkada Deceives School That Verkada Cameras Would Not "Brick"

https://ipvm.com/reports/verkada-school-brick
2•jhonovich•16m ago•0 comments

CTX is a cognitive memory layer for AI systems

https://github.com/diegoxtr/ctx-open
2•diegoxtr•17m ago•0 comments

Show HN: FluxTest for testing network performance of self-hosted infrastructure

https://github.com/siddheshgunjal/flux-test
1•siddheshgunjal•18m ago•0 comments

NASA selects Falcon Heavy to launch ESA Mars rover mission despite budget threat

https://spacenews.com/nasa-selects-falcon-heavy-to-launch-esa-mars-rover-mission-despite-budget-t...
1•bookmtn•19m ago•0 comments

Show HN: Hyprmark – Markdown viewer for the Hyprland ecosystem

https://github.com/robinduckett/hyprmark
1•robinduckett•25m ago•1 comments

A resume builder for pets, for those who need to prove their animal isn't feral

https://petresume.co/
2•droopyKnees•37m ago•1 comments

The Khan Ted Institute

https://khanted.org/Home
3•capex•44m ago•0 comments

Ask HN: API Request for Feedback OK in Show HN?

2•casefile_dev•44m ago•2 comments

Opentargets-py – Python SDK for the Open Targets drug discovery database

https://pypi.org/project/opentargets-py/
2•goknurarican•48m ago•0 comments

Old Computers Sucked

https://oldcomputerssucked.com/
2•st_goliath•49m ago•0 comments

Is ChatGPT's web front end being intentionally degraded?

https://chatgpt.com
2•linzhangrun•52m ago•6 comments

Rise against the Machines: The Luddites [video]

https://www.youtube.com/watch?v=oeFTuD4Mnug
1•linsomniac•54m ago•0 comments

At the HumanX conference, everyone was talking about Claude

https://techcrunch.com/2026/04/12/at-the-humanx-conference-everyone-was-talking-about-claude/
1•Rafsark•54m ago•0 comments

The Cost of Cheap Clone Boards: Streaming Video on an STM32H750

https://msj.prose.sh/debug_streaming_weact_stm32h750
1•melastmohican•56m ago•1 comments

Robotaxi is now rolling out in Dallas and Houston

https://twitter.com/robotaxi/status/2045564609504116771
2•iknowstuff•58m ago•2 comments

AI chip startup Cerebras files for IPO

https://techcrunch.com/2026/04/18/ai-chip-startup-cerebras-files-for-ipo/
2•AnhTho_FR•58m ago•0 comments

Show HN: I built a CLI to fake Git commits

https://github.com/TDiblik/git-forge
2•TDiblik•1h ago•0 comments

No more bill shocks budget alerts comes to Cloudflare

https://projektisle.com/2026/04/no-more-bill-shocks-budget-alerts-comes-to-cloudflare/
1•todotask2•1h ago•0 comments

PostgreSQL Just Got Its Biggest Upgrade That Will Change DB Performance in 2026

https://medium.com/@CodingWithAbhi/postgresql-17-performance-upgrade-2026-f4222e71f577
1•breve•1h ago•0 comments

That 90s Chat Program You Don't Remember

https://www.youtube.com/watch?v=fMKiz7KTSz4
1•1o1o1o1o1•1h ago•0 comments

Deutsche Telekom has a bad DKIM key

https://infosec.exchange/@badkeys/116407565746342278
4•icco•1h ago•0 comments