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?

Elon Approves

https://imgur.com/gallery/De7pvyG
1•stocazzoefwefwe•2m ago•0 comments

The Day Cryptography Changed Forever

https://21ideas.org/en/gf/genesis-intro/
1•kehiy•3m ago•0 comments

How little exercise can you get away with?

https://www.economist.com/science-and-technology/2026/07/03/how-little-exercise-can-you-get-away-...
2•vinni2•3m ago•0 comments

What Is Project Aion? Inside Microsoft's Agentic Copilot OS

https://www.windowscentral.com/microsoft/windows-11/project-aion-copilot-os-faq
1•atan2•7m ago•0 comments

Is 'The College Board' a Nonprofit or a $1.6B Testing Monopoly?

https://www.forbes.com/sites/scottwhite/2025/05/26/the-college-board-exposed-nonprofit-or-16-bill...
1•Baljhin•8m ago•0 comments

Matrix Multiplication on Blackwell

https://www.modular.com/blog/matrix-multiplication-on-nvidias-blackwell-part-1-introduction
1•skidrow•10m ago•0 comments

Toward Better Hip Kernel Generation for AMD GPUs

https://scalingintelligence.stanford.edu/blogs/hipkernels/
1•skidrow•10m ago•0 comments

Show HN: Nimbus - open-source AI agent that operates your AWS and GCP

https://github.com/hritvikgupta/nimbus
1•hritvik29•10m ago•0 comments

Full Writeup of the Windows GDID

https://github.com/SmtimesIWndr/gdid-reversal
2•typeofhuman•10m ago•0 comments

CubeSandbox

https://github.com/tencentcloud/CubeSandbox
1•handfuloflight•12m ago•0 comments

Liftz: Your Gym Buddy

https://apps.apple.com/in/app/liftz-your-gym-buddy/id6779775357
1•linkesh•13m ago•0 comments

Jim's TrueType QR Code Font

https://github.com/jimparis/qr-font
1•gpvos•13m ago•1 comments

Show HN: Autoops – Multi-region data and service mesh operated by a Makefile

https://github.com/neospe/autoops
1•leschak•14m ago•0 comments

The Junior Developer Extinction: 67% Hiring Collapse Reshaping Tech Careers

https://hakia.com/news/junior-developer-crisis-2026/
2•panny•14m ago•0 comments

xAI makes its rebrand to SpaceXAI complete with a new logo

https://www.businessinsider.com/xai-rebrand-spacexai-new-logo-x-handle-spacex-2026-7
2•enlightpixel•15m ago•0 comments

Making a wazuh server in Python from scratch for fun and maybe profit

https://medium.com/@souzo/making-a-wazuh-server-in-python-from-scratch-for-fun-and-maybe-profit-c...
1•souzo•16m ago•0 comments

Current ListenBrainz server issues/high load, Part 2

https://blog.metabrainz.org/2026/07/06/current-listenbrainz-server-issues-high-load-part-2/
2•max-m•18m ago•1 comments

Show HN: Noriento – Train your sense of direction

https://noriento.com/
2•markoberkes•18m ago•0 comments

Show HN: Aestheticscience.net – A website for rating academic papers

https://aestheticscience.net/
3•pswjt•18m ago•0 comments

New app for Harry Potter fans

2•IDIRIS•20m ago•1 comments

How are you measuring Claude Code and Codex performance?

2•achalpandey•20m ago•1 comments

How ChatGPT Picks Sources (I Read the Network Traffic, Not the Outputs)

https://suganthan.com/blog/how-chatgpt-picks-sources/
2•trusche•22m ago•0 comments

Google Apps Script is now a Google Workspace core service

https://workspaceupdates.googleblog.com/2026/06/google-apps-script-workspace-core-service.html
2•kamphey•23m ago•0 comments

Kennel – Keep Your AI Agents Running Between Tasks

https://github.com/eranif/kennel
2•SableDb•24m ago•0 comments

Show HN: Free keyword search volume data

https://www.seodata.dev/
3•alentodorov•26m ago•0 comments

Look mom, no ADCs Scaling ML analog compute to 1000x lower energy than digital

https://sangota.substack.com/p/analog-can-scale-heres-how
2•sango_ta•27m ago•0 comments

x.ai Voice Agent Builder

https://x.ai/voice
2•dawie•29m ago•1 comments

Attribute Knowledge RAG Pattern for Governed AI Agents

https://superml.dev/attribute-knowledge-rag-pattern-llm-governed-attributes
2•bps1418•32m ago•0 comments

Titan's Resources and Their Utilization

https://arxiv.org/abs/2606.06608
5•bookofjoe•34m ago•1 comments

Geocentric Orrery

https://navlist.net/Geocentric-Orrery-TrammellH-jul-2026-g58762
2•helterskelter•36m ago•0 comments