Alerts and monitoring
Statistics dashboard
The HAProxy Statistics dashboard provides a near real-time feed of information that you can use to troubleshoot proxied services, get insights about your traffic, monitor the load on servers, and even perform administrative actions such as placing a server in maintenance mode or enabling health checks.
Enable the dashboard Jump to heading
HAProxy Fusion
In HAProxy Fusion, the Statistics dashboard is already enabled. Access it via Overview > Stats.
HAProxy ALOHA
In HAProxy ALOHA, statistics also appear on the Stats tab.
To enable the Statistics dashboard, add the following frontend to the load balancer configuration. This will serve the dashboard at http://<IP ADDRESS>:8404/stats
.
haproxy
frontend statsmode httpbind :8404stats enablestats refresh 10sstats uri /statsstats show-modules
haproxy
frontend statsmode httpbind :8404stats enablestats refresh 10sstats uri /statsstats show-modules
In this frontend:
bind
sets which address and port you’ll use to access the dashboard.stats enable
is required to define this frontend as an active statistics dashboard.stats refresh
configures how often the dashboard will automatically refresh within your browser.stats uri
(optional) changes the URL’s path.stats show-modules
Available since HAProxy 2.3 / HAProxy Enterprise 2.3r1 / HAProxy ALOHA 13.0 (optional) adds statistics for SSL, HTTP/1, HTTP/2, HTTP/3, and QUIC modules.
For more information, see stats enable.
Enable administrative actions Jump to heading
From the dashboard, you can perform some administrative actions. When administrative actions are enabled, a dropdown menu appears at the bottom of the page with actions you can apply. To perform an action, select rows, then select the action from the drop-down menu, and then click Apply.
To enable administrative actions, add the stats admin
line to the stats
frontend:
haproxy
frontend statsmode httpbind :8404stats enablestats refresh 10sstats uri /statsstats show-modulesstats admin if TRUE
haproxy
frontend statsmode httpbind :8404stats enablestats refresh 10sstats uri /statsstats show-modulesstats admin if TRUE
where:
stats admin
allows users to perform administrative actions.
You can control who gets administrative privileges:
- Use an ACL statement to restrict who can access administrative actions. For example, the statement
if TRUE
gives all users access, but you could also create a condition that checks the client’s source IP address. - Specify
stats auth <username>:<password>
to enforce Basic authentication.
Actions include:
Administrative Action | Description |
---|---|
Set state to READY |
The selected server will receive traffic. The final status of the server will be determined based on its configured health check. |
Set state to DRAIN |
The selected server won’t accept any new connections other than those accepted through session persistence. |
Set state to MAINT |
The selected server won’t accept any new connections at all and health checks will be stopped. |
Health: disable checks | Disable a server’s health checks. |
Health: enable checks | Enable a server’s health checks. |
Health: force UP |
Force a server’s health check status immediately to UP. |
Health: force NOLB |
Force a server’s health check status to NOLB. This stops the server from accepting new, non-persistent connections. |
Health: force DOWN |
Force a server’s health check status immediately to DOWN. |
Agent: disable checks | Disable a server’s agent checks. |
Agent: enable checks | Enable a server’s agent checks. |
What the dashboard displays Jump to heading
The dashboard shows information for the load balancer process, frontends, and backends. At the top of the screen you’ll find general process information, a color legend, display options, and helpful links to external resources.
General process information Jump to heading
The General process information section provides details about the load balancer process itself, along with settings from the global section of the configuration such as global maxconn
.
Color legend Jump to heading
The color legend shows what colors are used to indicate server state:
Display options Jump to heading
The Display options allow you to customize the display.
where:
Option | Function |
---|---|
Scope | Display only frontend, backend, and listen sections whose names contain the specified text. |
Hide ‘DOWN’ servers | Show only UP servers. |
Disable refresh | Stop refreshing of the page. |
Refresh now | Trigger a page refresh. |
CSV export | Export statistics to file as comma-separated-values. |
JSON export (schema) | Export statistics to file as JSON schema. |
External resources Jump to heading
The External resources section provides helpful links.
Frontend statistics Jump to heading
A frontend is what a client connects to. As requests enter the load balancer, and as responses are returned to the client, they pass through the frontend. So, it has access to end-to-end timings, message sizes, and health indicators that encompass the whole request/response lifecycle. Below we explore the statistics related to frontends.
Statistic | Description |
---|---|
Queue | The Queue section is not used for frontends. |
Session rate | The Session rate section, in the context of a frontend, describes the rate at which clients are connecting to the load balancer. The Cur column shows the current rate at which client sessions, or fully established connections between client and server, are being created. If you hover over this field, the page displays the following drilldown metrics:
The Max column shows the most sessions that have ever been in use simultaneously. If you hover over this field, the page displays the following drilldown metrics:
The Limit column shows the maximum number of sessions per second that the frontend will accept, as set by the rate-limit sessions setting. If this limit is exceeded, additional connections are kept pending in the socket’s backlog (in system buffers). |
Sessions | In the context of a frontend, the Sessions section counts the number of sessions, or full client-to-server connections, in use on the load balancer. The Cur column shows the current number of established sessions. The Max column shows the most sessions that have ever been simultaneously established. The Limit column shows the most simultaneous sessions that are allowed, as defined by the When you hover over the Total column, the page displays the following drilldown metrics:
The LbTot and Last columns are not used in the Sessions section. |
Bytes | In the context of a frontend, the Bytes section displays the cumulative amount of data sent and received between the load balancer and downstream clients.
|
Denied | The Denied section shows the number of requests and responses that were rejected because of security concerns. The Req column shows the number of requests that were denied due to any of the following configuration directives placed in the frontend or listen section:
The Resp column shows the number of responses that were denied by an |
Errors | In the context of a frontend, only the Req column is used in the Errors section. It shows the number of requests that encountered an error. Possible causes include:
|
Warnings | The Warnings section is not used for frontends. |
Server | The only field from the Server section that applies to a frontend is the Status field. When Status is |
Backend statistics Jump to heading
A backend is a pool of load-balanced servers. The load balancer sends requests to a backend and then receives a response from one of the active servers. Statistics here include information about the health of each server, timings related to queuing, connecting, receiving responses, and request rates.
Statistic | Description |
---|---|
Queue | The Queue section applies only to backends and shows how long clients are waiting for a server to become available. The load balancer is able to queue connections when you use the
|
Session rate | In the context of a backend server, a session means the same as a connection. These statistics show the rate at which connections are being made to a server.
|
Sessions | In the context of a backend, the Sessions section shows the number of current connections to any of the active servers.
|
Bytes | In the context of a backend, the Bytes section displays the amount of data sent and received between the load balancer and the upstream server.
|
Denied | The Denied section shows the number of requests and responses that were rejected because of security concerns.
The bottom row shows the sum of these individual server metrics. |
Errors | The Errors section shows the number of errors related to communicating with a backend server.
|
Warnings | The Warnings section in a backend displays the number of retries and redispatches.
|
Server | In the context of a backend, the Server section shows various details about the status, health, and weight of each server.
|
See also Jump to heading
- Backend core concepts
- disable frontend
- enable frontend
- Frontend core concepts
- Health checks
- maxconn reference
- maxqueue reference
- option redispatch reference
- rate-limit sessions reference
- slowstart reference
- stats admin reference
- stats auth reference
- stats enable reference
- stats show-modules reference
- stats uri reference
- timeout queue reference
Do you have any suggestions on how we can improve the content of this page?