Skip to content
ENExplore Calculators

HAProxy Capacity Calculator

Find whether HAProxy is limited by frontend maxconn or backend server maxconn, and how long sessions wait in the queue.

About HAProxy Capacity Calculator

HAProxy accepts up to the frontend maxconn but can only hand a session to a backend server with a free slot; anything beyond that waits in the backend queue. The queue wait follows from queue length divided by the pool's service rate. The binding constraint is almost always per-server maxconn rather than the frontend figure, so raising the global maxconn does nothing except turn refused connections into queued ones that eventually hit the queue timeout.

Formula

HAProxy Capacity

effective capacity = min(frontend maxconn, servers × per-server maxconn); queued sessions = concurrent sessions − backend capacity.

backCapacity
Total concurrent sessions the pool will accept before queueing
queueWaitMs
Queued sessions × service time ÷ backend capacity

Worked example

With the default values below, HAProxy Capacity Calculator returns Effective Session Capacity of 4,800. Change any input above and every figure here is recalculated in your browser.

Inputs used

Frontend maxconnaccepts 1–10,000,000 connections
40,000 connections
Backend serversaccepts 1–1,024 servers
12 servers
Per-server maxconnaccepts 1–1,000,000 connections
400 connections
Requests per secondaccepts 1–10,000,000 rps
25,000 rps
Average session durationaccepts 0.1–600,000 ms
60 ms

Results

Effective Session Capacity
4,800
Concurrent Sessions
1,500
Capacity Utilisation
31.3%
Sessions Queued at the Backend
0
Average Queue Wait
0.00 ms
Binding Constraint
Backend server maxconn — raise it or add pool members

Step by step

  1. 1Values used
  2. 2HAProxy Capacity
  3. 3Effective Session Capacity= 4,800
  4. 4Concurrent Sessions= 1,500
  5. 5Capacity Utilisation= 31.3
  6. 6Sessions Queued at the Backend= 0
  7. 7Average Queue Wait= 0.00 ms
  8. 8Binding Constraint= Backend server maxconn — raise it or add pool members

Assumptions and limits

  • The result is derived only from the 5 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How is HAProxy Capacity calculated?

effective capacity = min(frontend maxconn, servers × per-server maxconn); queued sessions = concurrent sessions − backend capacity. HAProxy accepts up to the frontend maxconn but can only hand a session to a backend server with a free slot; anything beyond that waits in the backend queue. The queue wait follows from queue length divided by the pool's service rate.

Why does HAProxy Capacity matter?

The binding constraint is almost always per-server maxconn rather than the frontend figure, so raising the global maxconn does nothing except turn refused connections into queued ones that eventually hit the queue timeout.

What values do I need to enter?

This calculator takes 5 inputs: Frontend maxconn, Backend servers, Per-server maxconn, Requests per second, Average session duration. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

HAProxy Capacity Calculator | Calcrivo