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?

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

https://56k.rip/
1•thunderbong•1m ago•0 comments

The Multiplayer AI Manifesto

https://multiplayer-ai.com/
3•ibrahima•2m ago•0 comments

Show HN: Chrome tab group cleaner for Claude Code created tab groups

https://github.com/franzenzenhofer/chrome-tab-group-cleaner
1•franze•10m ago•0 comments

NYC mayor Mamdani imposes 1 year ban on AI for schools through 8th grade

https://www.nyc.gov/mayors-office/news/2026/09/mayor-mamdani-and-chancellor-samuels-put-students-...
6•DeepLogin•12m ago•1 comments

GTP-6 Astra

https://www.youtube.com/watch?v=1QNsdr-Qx_I
1•htk•15m ago•0 comments

Show HN: If I had to design a nuclear fusion power plant(Idea Sketch)

https://github.com/PJHkorea/discrete-filament-router
2•PJHkorea•15m ago•0 comments

4K Analog Video Feedback Device

https://www.youtube.com/watch?v=koDCabeh5kQ
1•CharlesW•15m ago•0 comments

macOS 27 Simulator by OpenAI Astra

https://macos-27-simulator.mweinbach.chatgpt.site/
2•tristanj•15m ago•2 comments

Coder's registry infrastructure compromised to push malicious modules

https://www.bleepingcomputer.com/news/security/coders-registry-infrastructure-compromised-to-push...
2•sbulaev•19m ago•0 comments

(George) Lucas Museum of Narrative Arts

https://lucasmuseum.org
2•rawgabbit•19m ago•0 comments

Star Trek S01e20 "Court Marshall"

https://en.wikipedia.org/wiki/Court_Martial_(Star_Trek:_The_Original_Series)
1•Jimmc414•20m ago•0 comments

Protecting Engineers' Skills in the AI Era

https://spectrum.ieee.org/ai-engineer-skills
9•rbanffy•26m ago•3 comments

There are many agent harnesses, but this one is mine

https://earendil.com/posts/there-are-many-agent-harnesses-but-this-one-is-mine/
1•zdw•29m ago•0 comments

Anxious or outgoing? Study links Big Five personality traits to genetic variants

https://www.nature.com/articles/d41586-026-02761-5
2•geneticdrifts•30m ago•0 comments

Spending deal comes with a bonus: Blocking political control of grants

https://arstechnica.com/science/2026/09/budget-deal-puts-political-control-of-grants-on-hold-unti...
1•rbanffy•30m ago•0 comments

I found an AI-driven browser that builds workflows from playbooks

https://www.browserargus.com/blog/two-lanes-for-cold-email
1•akimmaimedow•30m ago•0 comments

Oura S-1

https://www.sec.gov/Archives/edgar/data/2133022/000119312526381855/d119865ds1.htm
3•firexcy•32m ago•0 comments

The Unsung Inventor Who Chased the LED Rainbow

https://spectrum.ieee.org/yellow-led-inventor
1•rbanffy•35m ago•0 comments

Modal's rise: sandboxes, cold starts, and what the SEC paperwork reveals

https://henrymichaelson1.substack.com/p/inside-modals-rise-sandboxes-sub
3•hmichaelson20•38m ago•0 comments

Dash for Windows: Now in Beta

https://blog.kapeli.com/dash-for-windows-beta
2•frou_dh•39m ago•0 comments

ZJIT GC: Inlining GC Fastpath in ZJIT (Ruby)

https://railsatscale.com/2026-09-01-zjit-gc-fastpath/
1•weatherlight•39m ago•1 comments

Show HN: Generate a Claude Code or Codex agent fleet from one HTML file

https://github.com/bob-codedaptive/fleet-generator
2•survivor0xb0b•40m ago•0 comments

here is how We're All Going to Die

https://www.noahpinion.blog/p/heres-how-were-all-going-to-die
2•paulpauper•41m ago•0 comments

Bitcoinica

https://en.bitcoin.it/wiki/Bitcoinica
1•chistev•42m ago•1 comments

SpaceXAI apologizes for outage that affected Grok and other 'compute partners'

https://www.engadget.com/2250789/spacexai-apologizes-for-outage-that-affected-grok-and-other-comp...
2•cdrnsf•46m ago•0 comments

I tracked 7,022 MCP tool definitions. 14 servers changed within 27 hours

https://github.com/GautamTalksDev/mcp-pin/blob/main/docs/findings/2026-09-03-schema-drift.md
1•GautamTalksDev•47m ago•0 comments

GLP-1s Are Being Linked to Fewer Serious Infections, Including TB

https://gizmodo.com/ozempic-and-other-glp-1s-are-being-linked-to-fewer-serious-infections-includi...
10•gumby•48m ago•5 comments

Rich vs. King in the Real World: Why I sold my company

https://longform.asmartbear.com/rich-vs-king-sold-company/
2•gmays•50m ago•0 comments

Matching Features, Not Tokens: Energy-Based Fine-Tuning of Language Models

https://energy-based-fine-tuning.github.io/
1•E-Reverance•51m ago•0 comments

Blockchain und Bitcoin erklärt in 6 Episoden – Episode 4

https://medium.com/@chris.ahrweiler/blockchain-und-bitcoin-erkl%C3%A4rt-in-6-episoden-episode-4-e...
1•docjojo•52m ago•0 comments