frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

1•LawZiL•10mo 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•10mo 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•10mo 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•10mo 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•10mo ago
Load test against a clone instead of a DB whose contents you care about?

Tracking and analysis of a hidden mesh network operating across iOS devices

https://lists.nanog.org/archives/list/nanog@lists.nanog.org/thread/YDTTFIWTVGTLOUNLUXL6VNKWOIEDJ37Q/
1•speckx•2m ago•0 comments

2025 State of Rust Survey Results

https://blog.rust-lang.org/2026/03/02/2025-State-Of-Rust-Survey-results/
1•olalonde•6m ago•0 comments

Lenovo ThinkStation PGX Review: The Nvidia GB10 128GB AI Workstation

https://www.servethehome.com/lenovo-thinkstation-pgx-review-the-nvidia-gb10-128gb-ai-workstation-...
1•teleforce•9m ago•0 comments

We are not alone: Our sun escaped together with stellar 'twins' from galaxy cent

https://phys.org/news/2026-03-sun-stellar-twins-galaxy-center.html
1•bookmtn•11m ago•0 comments

Dennis Ritchie, Ken Thompson And others on the Unix system [video]

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

GitHub – REST API version 2026-03-10 is now available

https://github.blog/changelog/2026-03-12-rest-api-version-2026-03-10-is-now-available/
1•stevehipwell•16m ago•0 comments

AutoExp: One-liner turn any traning code to autoresearch

https://github.com/wizwand/autoexp
1•allanhahaha•19m ago•0 comments

HP has new incentive to stop blocking third-party ink in its printers

https://arstechnica.com/gadgets/2026/03/hp-has-new-incentive-to-stop-blocking-third-party-ink-in-...
1•XzetaU8•25m ago•0 comments

What if compiler errors were an API? (AI-native language demo)

https://asciinema.org/a/834560
1•hvoetsch•26m ago•1 comments

Show HN: YAOS – A 1-click deploy, real-time sync engine for Obsidian

1•kavinsood•27m ago•0 comments

Shiny Object Syndrome

https://en.wikipedia.org/wiki/Shiny_object_syndrome
1•esher•31m ago•0 comments

I ran /autoresearch on liquid codebase. 53% faster combined parse+render time

https://twitter.com/tobi/status/2032212531846971413
2•tosh•33m ago•0 comments

The parasite continues to eat the host. The cancer is trying to spread

https://twitter.com/wordpress/status/2032291317871468554
1•docdeek•42m ago•0 comments

NVFP4: Efficient and Accurate Low-Precision Inference

https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-infe...
1•tosh•43m ago•0 comments

Chicken Nuget

https://daniel.haxx.se/blog/2026/03/12/chicken-nuget/
2•HieronymusBosch•44m ago•0 comments

Private LLM Inference on Consumer Blackwell GPUs

https://arxiv.org/abs/2601.09527
1•rohansood15•47m ago•0 comments

Show HN: ROI-first AI automation framework for B2B companies

https://roihacking.ai/
1•roihacking•53m ago•1 comments

Ask HN: What benchmarks do you trust most when comparing large LLMs?

1•QubridAI•58m ago•0 comments

LLMs: Using a single Unix-style tool instead of multiple tools/function calling

https://old.reddit.com/r/LocalLLaMA/comments/1rrisqn/i_was_backend_lead_at_manus_after_building_a...
4•drtse4•1h ago•0 comments

Atlassian Is Not Collapsing – But Its Business Model Might Be

https://www.ctol.digital/news/atlassian-credibility-crisis-not-a-collapse/
1•donutshop•1h ago•0 comments

Ask HN: Resources for a conceptual model of LLMs as applicable to coding?

2•pramodbiligiri•1h ago•0 comments

Cockroach Milk: Yes. You Read That Right

https://www.npr.org/sections/thesalt/2016/08/06/488861223/cockroach-milk-yes-you-read-that-right
2•thunderbong•1h ago•0 comments

Same Chat App, 4 Frameworks: Pydantic AI vs. LangChain vs. LangGraph vs. CrewAI

https://oss.vstorm.co/blog/same-chat-app-4-frameworks/
1•kacper-vstorm•1h ago•1 comments

World Vibe Web: a distributed, open-source app store

https://wvw.dev
3•semioz•1h ago•0 comments

Country Filter for X/Twitter

https://geofilterx.com/
1•hgarg•1h ago•0 comments

Shopify/liquid: Performance: 53% faster parse+render, 61% fewer allocations

https://simonwillison.net/2026/Mar/13/liquid/
1•duck•1h ago•0 comments

Agentic, fully-automated reverse engineering

https://github.com/amruth-sn/kong
1•amruth-•1h ago•0 comments

A record number of objects went into space in 2025

https://ourworldindata.org/data-insights/a-record-number-of-objects-went-into-space-in-2023
1•jonbaer•1h ago•0 comments

National Dex

https://nationaldex.io/
2•timlang1024•1h ago•0 comments

Waller – Game that teaches the fundamentals of drystone walling

https://www.orthodoxmasonry.com/waller
1•helloplanets•1h ago•0 comments