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?

Muse Spark 1.2 (Meta) is reportedly becoming open-weight

https://twitter.com/alexandr_wang/status/2086756152034066792
1•MurizS•39s ago•0 comments

Parametron: 50s Japanese computer that uses neither transistors nor vacuum tubes

https://ethw.org/Milestones:Parametron,_1954
1•xeonmc•3m ago•0 comments

Meta releases a 30B agent model that fits in ~17GB

https://huggingface.co/meta-models
2•MihaiSandor•3m ago•0 comments

EU Study: Block Live Sports Piracy in 30 Minutes

https://torrentfreak.com/eu-study-block-live-sports-piracy-in-30-minutes-across-dns-resolvers-vpn...
2•pawal•3m ago•0 comments

Eight Books That Puncture the Myths of Silicon Valley

https://lithub.com/eight-books-that-puncture-the-myths-of-silicon-valley/
1•spy888•7m ago•0 comments

Linus Torvalds says AI has made Linux kernel updates the new normal

https://www.theregister.com/os-platforms/2026/08/10/linus-torvalds-says-ai-has-made-huge-linux-ke...
3•mdp2021•8m ago•0 comments

Karl Marx, for the NY Daily Tribune: "The American Question in England" (1861)

https://marxists.org/archive/marx/works/1861/10/11.htm
1•thomassmith65•10m ago•1 comments

'adversarial' pattern can prevent surveillance cameras from detecting you

https://techcrunch.com/2026/08/09/this-adversarial-pattern-can-prevent-surveillance-cameras-from-...
1•caruasdo•10m ago•0 comments

Secure Capability-Based Generative UI with WASM Components [video]

https://www.youtube.com/watch?v=RoYFUomDwp8
1•marianoguerra•10m ago•0 comments

ChatTJB

https://chattjb.org/
1•thazework•11m ago•1 comments

Meta releases Muse Glimmer, 30B parameter open-weight edge model

https://twitter.com/finkd/status/2086755195535413696
4•tejus_vignesh•11m ago•0 comments

Quasipolynomial Cryptanalysis of the McEliece Cryptosystem (PIR Meets McEliece)

https://eprint.iacr.org/2026/1630
1•cbzbc•11m ago•0 comments

Muse Glimmer: Meta's open model built for always-on local agents. 30B parameters

https://developer.meta.com/ai/models/muse-glimmer/
5•helsinkiandrew•13m ago•1 comments

Gonemaster checks the DNS health of a domain

https://gonemaster.evilbit.de/
1•pawal•15m ago•1 comments

Ant teams beat gravity-based puzzle solvers

https://phys.org/news/2026-08-ant-teams-gravity-based-puzzle.html
2•wjSgoWPm5bWAhXB•15m ago•0 comments

The Future Is for Everyone – The Path to a Positive AI Future

https://www.meta.com/thefutureisforeveryone/
3•insumanth•16m ago•1 comments

Navy drone boats 'were sending data to China'

https://www.thetimes.com/uk/defence/article/navy-drone-boats-sending-data-china-k3-rcqd2jcfl
3•josephcsible•20m ago•0 comments

GST Notices: Types, Reasons and Response Guide – SMFG India Credit

https://www.smfgindiacredit.com/knowledge-center/gst-notices.aspx
1•saumyaraut11•20m ago•0 comments

Meta Muse Glimmer – open weights 30B local coding model

https://research.meta.ai/blog/introducing-muse-glimmer-open-agentic-model
7•riordan•22m ago•0 comments

V2X Technology Gets a 5G Cellphone Network Solution

https://spectrum.ieee.org/v2x-technology-5g-open-ran
2•rbanffy•23m ago•0 comments

Getting Off the Modernization Treadmill

https://unplannedobsolescence.com/talks/getting-off-the-modernization-treadmill/
2•ggaughan•25m ago•1 comments

A.I.-Driven Chip Crunch Leads to New Rush of Lobbying in Washington

https://www.nytimes.com/2026/08/10/technology/memory-chip-shortage-ai.html
2•giuliomagnifico•26m ago•0 comments

The dumbest ransomware I've ever seen

https://mrunix.me/posts/ransomware/
1•mrunix•27m ago•0 comments

Show HN: Northstar Browser 1.0.7

3•roschdal•27m ago•0 comments

I built a directory to find every indoor dog park in the US

https://www.indoordogpark.org
1•mabalal•29m ago•0 comments

ETQW: Open-Source Reimplementation of Enemy Territory: Quake Wars

https://github.com/jmarshall23/ETQW
1•klaussilveira•29m ago•0 comments

One Email, Three Identities: SPF, DKIM and DMARC Explained

https://senderledger.com/articles/one-email-three-identities-spf-dkim-dmarc
2•adulion•36m ago•0 comments

Study Finds Short AI Chats Reduced Belief in New Conspiracies

https://aiunderstanding.org/news/ai-chats-emerging-conspiracy-beliefs-study
1•ashurandi•37m ago•0 comments

Tech leaders say AI means less work – staff say they work up to 90 hours a week

https://www.bbc.com/news/articles/cvgx4yd1gl2o
3•dijksterhuis•38m ago•0 comments

Robot Videos: Heavy Lift Cargo Drones, Grippers, More

https://spectrum.ieee.org/video-friday-heavy-lift-drone
1•rbanffy•40m ago•0 comments