Skip to content
Calcrivo

HAProxy Capacity Calculator

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

Inputs

connections
servers
connections
rps
ms

Effective Session Capacity

4,800

Concurrent Sessions

1,500

Capacity Utilisation

31.3%

Sessions Queued at the Backend

0

Average Queue Wait

0.00ms

Binding Constraint

Backend server maxconn — raise it or add pool members

Step by step

  1. Values used

    Frontend maxconn = 40,000 connections; Backend servers = 12 servers; Per-server maxconn = 400 connections; Requests per second = 25,000 rps; Average session duration = 60 ms

  2. HAProxy Capacity

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

  3. Effective Session Capacity

    = 4,800

  4. Concurrent Sessions

    = 1,500

  5. Capacity Utilisation

    = 31.3

  6. Sessions Queued at the Backend

    = 0

  7. Average Queue Wait

    = 0.00 ms

  8. Binding Constraint

    = Backend server maxconn — raise it or add pool members

How it works

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

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.

You might also need