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: My Terminal Themes Web App Is Live

1•bado•32s ago•0 comments

Mini organs launching to space may help future astronauts

https://abcnews.com/Health/mini-organs-launching-space-future-astronauts-humans-earth/story?id=13...
1•lxm•50s ago•0 comments

Kitty-GPT

https://kittygpt.org/
1•ayaros•2m ago•0 comments

Tired of agents' walls of text, so I made them answer in HTML

https://github.com/QingYunA/answer-me-with-html
1•sorlia7z•3m ago•0 comments

Asia chip stocks fall, AI funding worries

https://www.cnbc.com/2026/10/15/sk-hynix-samsung-softbank-stocks-asia-tech-rout-ai-funding-worrie...
3•kristianp•4m ago•0 comments

Why Andrew Ng believes AI won't destroy humanity

https://www.economist.com/insider/inside-tech/why-one-of-the-worlds-most-influential-computer-sci...
2•andsoitis•4m ago•0 comments

BeeLLM

https://bee.pleroma.nexus/
1•davikr•4m ago•0 comments

Step 5 Preview: StepFun's flagship model for agentic work

https://huggingface.co/stepfun-ai/Step-5-Preview
2•Philpax•9m ago•0 comments

FBI disrupts North Korean 'laptop farm' used to infiltrate US companies

https://www.nextgov.com/cybersecurity/2026/10/fbi-disrupts-north-korean-laptop-farm-used-infiltra...
2•WaitWaitWha•10m ago•0 comments

Is this the best inference for agents?

https://runinfra.ai
2•OsamaJaber•10m ago•0 comments

The Grid Died of Too Much Voltage

https://omnilenscodex.substack.com/p/the-grid-died-of-too-much-voltage
1•brandonshinnamo•10m ago•0 comments

DeepSeek Outage

https://status.deepseek.com/incidents/7116348214287
1•ksymph•13m ago•0 comments

Show HN: Bokal – Open-source cookie editor without the "tabs" permission

https://github.com/yuvibabbar-dev/bokal
1•bolalapp•15m ago•0 comments

2026.3 release in November, Air will ship as part of JetBrains IDEs

https://blog.jetbrains.com/ai/2026/10/air-in-ides-eap/
1•Sn0wCoder•16m ago•1 comments

Local AI Benchmarking, Minisforum MS-S1

https://www.meauxsoft.com/News/AI_Benchmark.html
1•dyslexicthumbs•17m ago•1 comments

SK Hynix conditions new US factory on more US chip equipment exports to China

https://www.reuters.com/world/asia-pacific/sk-hynix-conditions-new-us-factory-more-us-chip-equipm...
3•mfiguiere•18m ago•0 comments

The Verifiability Gap in Quantized LLM Supply Chains

https://arxiv.org/abs/2610.19498
1•msgchainhq•20m ago•0 comments

Nvidia CEO Says He Would Cut Off Buyers Who Build Unsafe AI

https://www.bloomberg.com/news/articles/2026-10-14/nvidia-ceo-says-he-would-cut-off-customers-who...
2•mfiguiere•23m ago•0 comments

Symmetries in Boolean Scan

https://ap29600.github.io/boolean_scans.html
2•g0xA52A2A•26m ago•0 comments

Show HN: Visual Scripting for Golang

https://symphony.q3k.app
1•jaitaiwan•27m ago•0 comments

The Double Headed Stack Allocator

https://blog.demofox.org/2026/10/03/the-double-headed-stack-allocator/
7•g0xA52A2A•27m ago•0 comments

Show HN: TowerPanic – a family party game on a small FastAPI realtime engine

https://towerpanic.com/
2•ms209495•31m ago•1 comments

Performance Goals That Survive the Roadmap

https://wakamoleguy.com/p/performance-goals-2026
1•wakamoleguy•34m ago•0 comments

Kalshi CEO says state-led oversight of US prediction markets would push them out

https://www.coindesk.com/policy/2026/10/14/kalshi-ceo-says-state-led-oversight-of-u-s-prediction-...
1•WaitWaitWha•35m ago•0 comments

Bipartisan coalition of states sues OpenAI over user safety

https://www.politico.com/news/2026/10/14/openai-user-safety-lawsuits-01119138
2•reasonableklout•35m ago•0 comments

State attorneys general seize on AI as Washington stalls

https://www.politico.com/news/2026/10/09/attorneys-general-ai-regulation-01112328
2•reasonableklout•36m ago•0 comments

DOJ announces charges in first nationwide tax fraud enforcement operation [video]

https://www.youtube.com/watch?v=s4sAQPXj0MU
2•Bender•37m ago•0 comments

Ask HN: How do you find good developer tools quickly?

1•ritualdevin•38m ago•1 comments

Show HN: Give (low vRAM) local sLLMs codebase-wide context with SQLite (attempt)

https://github.com/govindgcoder/arcKode
2•iamgovindg•38m ago•0 comments

US arrests Saudi employee of OpenAI for allegedly bugging its offices

https://www.ft.com/content/2c3b583a-3ddc-4920-a350-9698c119435c
1•Alien1Being•38m ago•0 comments