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?

CVE-2026-86950: An in-the-wild iOS bug with a possible WhatsApp zero-click path

https://calif.io/research/the-great-glyph-grift
1•ni5arga•1m ago•0 comments

Ban Kids from Social Media and They'll Chat in Public Radio Podcast Comments

https://www.techdirt.com/2026/09/30/ban-kids-from-social-media-and-theyll-just-chat-in-public-rad...
1•hn_acker•3m ago•2 comments

LLM library that builds itself, a converter for nearly every file

https://medium.com/@vektormemory/vektor-v1-9-8-b023b9b8a654
1•vektormemory•5m ago•0 comments

Thinking Before Thinking: Scaling Agentic Inference Through Meta-Reasoning

https://arxiv.org/abs/2609.38147
1•matt_d•6m ago•0 comments

Factory CEO just accused his VC board advisor of spying for Cognition

https://techcrunch.com/2026/09/30/factory-ceo-just-accused-his-vc-board-advisor-of-spying-for-cog...
2•reenorap•10m ago•0 comments

Model with metacognitive guidance identifies zero-click full-chain RCE in BlueZ

https://twitter.com/autopoiesislab/status/2083221810171224416
1•car•10m ago•0 comments

AI as a Compiler: Compiling Triton kernels without the Triton compiler

https://arxiv.org/abs/2609.36800
1•matt_d•10m ago•0 comments

The data center buildout, county by county

https://pressaudit.org/blog/datacenters
1•SLHamlet•11m ago•1 comments

Can Agents Design Libraries for Agents?

https://gabeorlanski.github.io/posts/library-design-bench/
1•matt_d•14m ago•0 comments

Scott Aaronson interview, on the impact of AI on science and mathematics [video]

https://www.youtube.com/watch?v=Qjgc9Hs5GKs
1•calf•15m ago•1 comments

How many hats are in the world?

https://hat.observer/
1•civilchaos•16m ago•0 comments

Context Language Models (CLMs)

https://github.com/facebookresearch/context-language-models
1•handfuloflight•17m ago•0 comments

Apple's first employee: The remarkable odyssey of Bill Fernandez (2014)

https://www.techrepublic.com/article/apples-first-employee-the-remarkable-odyssey-of-bill-fernandez/
1•bananaboy•19m ago•0 comments

Configurable Indent Levels?

https://github.com/psf/black/issues/378
1•jerlendds•22m ago•0 comments

EDG C++ Compiler is open source

https://github.com/edgcpp/compiler
2•zx2c4•23m ago•0 comments

The Scientific Case for Being Less in Touch with Your Friends

https://www.nytimes.com/2026/09/30/opinion/friendship-frequency-interaction.html
1•gumby•28m ago•0 comments

Google figures out how to watermark AI-designed proteins

https://arstechnica.com/science/2026/09/google-figures-out-how-to-watermark-ai-designed-proteins/
3•gumby•29m ago•1 comments

Readable Regular Expressions for JavaScript/TypeScript, Inspired by Emacs' Rx

https://rahuljuliato.com/posts/emacs-rx-in-typescript
1•RahulMJ•34m ago•1 comments

Building big things in the U.S. is hard. A Senate deal aims to fix that

https://www.washingtonpost.com/politics/2026/09/30/building-big-things-us-is-too-hard-senate-deal...
2•scythe•36m ago•0 comments

OpenJDK vs. GraalVM vs. Eclipse Temurin vs. Semeru Java Performance

https://www.phoronix.com/review/openjdk-graalvm-temurin-semeru
1•ejboy•36m ago•0 comments

The AI Pascal's Wager

https://ploum.net/2026-10-01-pascal_wager.html
2•frizlab•39m ago•1 comments

Growth.engineer – Vetted, open-source growth workflows for AI agents

https://www.growth.engineer
1•Soerensen•39m ago•1 comments

Nine – single binary, WASM tools and persistent AI harness/runtime

https://github.com/djordlucas/nine
1•jojolatulipe•45m ago•1 comments

How to Calibrate Jev (and Related)

https://pypi.org/project/reexpress-sdm/
1•reexpressionist•53m ago•0 comments

Turbo Haskell

https://www.reddit.com/r/haskell/comments/1wu24oe/turbo_haskell/
9•simonmic•1h ago•0 comments

Stacking Oranges in 24 Dimensions

https://www.empirical.health/blog/ai-math-sphere-packing/
1•brandonb•1h ago•0 comments

Rivian: LiDAR R2 reaches customers in 2027, employees get it this year

https://electrek.co/2026/09/30/rivian-lidar-r2-customers-2027-autonomy-update/
3•cisc•1h ago•0 comments

56k.rip – the 1996 dial-up internet experience

https://56k.rip/
2•adunk•1h ago•0 comments

Automating Wi-Fi setup testing on the ESP32

https://groundrun.io/blog/automating-wi-fi-setup-testing-on-the-esp32/
6•adunk•1h ago•0 comments

MailDeskt v1.4.0 – A simple, fast desktop inbox for Resend, Gmail, Outlook, more

https://www.maildeskt.com/
1•jimmy_lee•1h ago•0 comments