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: ForcePush – Commits vs. Push-Ups

https://forcepush.fit/
1•thedevtimeline•2m ago•0 comments

Datamimic – don't let your coding agent invent its own test world

https://github.com/rapiddweller/datamimic
1•ake2l•4m ago•0 comments

Ask HN: How do you put together a technical engineering team?

1•timontoadnix•8m ago•0 comments

Is pasta a type of noodle? The surprisingly serious debate over beloved carbs

https://theconversation.com/is-pasta-a-type-of-noodle-the-surprisingly-serious-debate-over-two-be...
1•rdmuser•9m ago•0 comments

Deep Seek v4.1 M5 Max at 17 tokens/s

https://github.com/argonautlabsai/argodrive
1•Argonautlabs•10m ago•0 comments

The Apple IIGS was introduced 40 years ago today

https://twitter.com/stlhood/status/2100080615924420913
1•stlhood•10m ago•0 comments

SGLang and Miles Add Day-0 Support for DeepSeek-v4.1

https://www.lmsys.org/blog/2026-09-10-deepseek-v41/
1•aray07•11m ago•0 comments

GLiClass: Open-Source JEV

https://github.com/knowledgator/gliclass
1•handfuloflight•16m ago•0 comments

The Arrival of Java 27

https://inside.java/2026/09/15/jdk-27-available/
3•ejboy•19m ago•0 comments

EU approves sending mountains of trash to Turkey despite environmental fears

https://www.politico.eu/article/eu-trash-turkey-environment-plastic-recycle/
2•leonidasrup•22m ago•0 comments

Verification of a Generational Garbage Collector

https://arxiv.org/abs/2609.13186
2•matt_d•24m ago•0 comments

Salesforce and Nvidia launch Koa, a CRM reasoning model

https://www.salesforce.com/news/press-releases/2026/09/15/koa-reasoning-model/?bc=HL
2•snikolaev•30m ago•0 comments

Antonio Gramsci: How Language Makes Power Feel Like Common Sense

https://linguistically.substack.com/p/antonio-gramsci-how-language-makes
1•akbarnama•31m ago•0 comments

Replicating Jev with Qwen-2.5

https://nitter.perennialte.ch/harshagundal/status/2100044305536889015
2•E-Reverance•34m ago•0 comments

Revisiting Soundness for Occurrence Typing, Semantically

https://arxiv.org/abs/2609.16299
1•matt_d•35m ago•0 comments

Black Holes or Black Hole Stars?

https://www.quantamagazine.org/black-holes-or-black-hole-stars-astronomers-spar-over-webb-telesco...
1•the-mitr•35m ago•0 comments

GPT-6 Astra vs. GPT-5.6 Sol: Is a 1.6x Higher Cost Worth It per Verified Bug?

https://ent-website-gamma.vercel.app/blogs/gpt-6-astra-cost-1.6x-more-per-verified-bug-than-gpt-5...
1•Entelligence25•37m ago•0 comments

Reclaim the Terminal

https://nishantjosh.dev/blogs/reclaim-the-terminal/
1•ballanitesh•39m ago•0 comments

Nature Is Our Learning Environment

https://periodic.com/news/nature-is-our-learning-environment
1•EvgeniyZh•43m ago•0 comments

Hello HN

1•Mohamed_Amineio•43m ago•0 comments

The Chemistry of Cookery XVII (1884)

https://en.wikisource.org/wiki/Popular_Science_Monthly/Volume_26/November_1884/The_Chemistry_of_C...
1•wmchen•47m ago•0 comments

Bug Bounty Operating Principles

https://medium.com/@JasonPuglisi/bug-bounty-principles-c379a2062614
1•smurda•51m ago•0 comments

CodeProject in read-only mode since October 2024

https://en.wikipedia.org/wiki/CodeProject
1•vismit2000•51m ago•0 comments

What's New in macOS 27 for Developers?

https://www.freecodecamp.org/news/whats-new-in-macos-27-for-developers/
1•DanielKehoe•51m ago•0 comments

Effectively Does a Model Use Its Memory (2025)

https://www.liquid.ai/blog/how-effectively-does-a-model-use-its-memory
1•eigenBasis•54m ago•1 comments

OpenAI breakthrough triggers 'existential crisis' in math

https://www.science.org/content/article/openai-breakthrough-triggers-existential-crisis-math
3•sbulaev•56m ago•0 comments

Show HN: 2049 - a roguelike that fuses 2048 and Minesweeper

https://github.com/skorotkiewicz/2049
1•modinfo•56m ago•0 comments

Why Scheme?

https://goeteia.dev/why
1•edfsadfer•59m ago•0 comments

Symbolic Artificial Intelligence

https://en.wikipedia.org/wiki/Symbolic_artificial_intelligence
1•ijidak•59m ago•0 comments

AI models in 'surreal' dialect mixing poetic language and tech bro jargon

https://www.theguardian.com/technology/2026/sep/15/syd-barrett-ai-chat-language-poetic-tech-bro-j...
3•danielmorozoff•1h ago•0 comments