"Stress Less: Easy Database Load Testing Using Python and Locust"
summary
Uses Locust plus psycopg3 to send SQL directly to PostgreSQL instead of HTTP endpoints, instrumenting calls with Locust’s request event so response times and failures are recorded. Demo runs up to ~100 concurrent users with a 75/25 weighted tasks mix of updates vs selects, spawns users at a set rate, and hits Postgres until max_connections becomes a bottleneck. Uses gevent concurrency, produces live charts and a downloadable HTML report and CSV, and the approach works end-to-end in the demo.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 0:15Miguels background
- 1:12Agenda
- 2:39What is Locust
- 3:46How is Locust used
- 4:21Locust code
- 5:54Running a test
- 6:58Low testing
- 7:27Postgress client
- 8:09User class
- 8:40Task set
- 9:47Demo
related talks
49mLoad Testing with Python and Locust
21mUnleashing the Eighth Plague: An Intro to Load Testing with Locust and Python
36mAutomated Performance Testing of Postgres
43mOptimize Python & Django apps with Postgres superpowers
45mBeat the rush! Designing effective load tests for your web application
27mCan your backend really handle 100k concurrent users?
30mBuilding modern Python web apps with PostgreSQL
28mUsing a database in a data science project - Lessons learned in production
