Load test a test

Run one test many times at once and read the latency distribution.

In short

A load test runs one test, or ad-hoc SQL, many times at once. It keeps the timing distribution: p50 to p99, executions per second and a histogram, plus how many runs failed, deadlocked or timed out. Load testing is included in Pro, Business and Enterprise.

Before you start

Run a load test

  1. Open the "Load testing" tab and choose an environment.
  2. Choose a "Saved test", or switch to "Ad-hoc SQL" and paste a statement.
  3. Set "Concurrency" - how many run at once (1 to 50, default 5).
  4. Set "Executions" - the total (1 to 5,000, default 50) - and a Timeout per execution (1 to 300 seconds, default 30).
  5. Press "Run load test" and wait for the Results card and the Latency histogram.

Good to know

This is real traffic 50 concurrent executions of a heavy query slow the database for everyone, and open transactions hold locks. Start with Concurrency 5 and Executions 50, on a database set aside for it. A Production load test is read-only, but its read load reaches paying customers - treat it as a change that needs approval.

Example: find a deadlock

Invoice creation sometimes fails at month end. You run Create invoice on QA at Concurrency 20 and Executions 500: 16 deadlocks, p95 410 ms. At Concurrency 5 there are none. The procedure locks two tables in a different order on two code paths. After the fix, Concurrency 20 shows zero deadlocks, and both results sit side by side in Recent load tests.

If something goes wrong

Related