k6 Load Testing Identifies PostgreSQL Foreign-Key Index Bottleneckk6 Load Testing Identifies PostgreSQL Foreign-Key Index Bottleneck
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
I load-tested a small parcel tracking API with k6: 200,000 parcels, about 3 million tracking events in Postgres.
Under stress, p95 hit the 10-second timeout and half the requests failed at 300 virtual users. The cause was one missing index on a foreign key. Postgres doesn't create those for you.
Same scenarios after the fix: p95 around 3 ms, zero errors. The hot endpoint got 4,061x faster. Every number in the README is generated from the k6 output files, not typed.
https://github.com/murillovskfilho/k6-load-testing
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started