When I open the haproxy statistics report page of my http proxy server, I saw something like this:
Cum. connections: 280073
Cum. sessions : 3802
Cum. HTTP requests: 24245
I'm not using 'appsession' and any other cookie related command in the configuration. So what's 'session' means here?
I guess haproxy identify http session by this order:
Am I Right?
Implement sticky sessions with a cookie HAProxy can save a cookie in the user's browser to remember which server to send them back to. The cookie, which contains the server's unique ID, offers the most accurate way to implement sticky sessions because a cookie is guaranteed to belong to only one user.
HAProxy supports 4 connection modes : - keep alive : all requests and responses are processed (default) - tunnel : only the first request and response are processed, everything else is forwarded with no analysis (deprecated). - server close : the server-facing connection is closed after the response.
Use this systemctl command to examine HAProxy's status on any Linux distribution: sudo systemctl status haproxy.
defaults mode http log global balance roundrobin timeout client 30s frontend public_web_servers bind *:80 default_backend public_web_servers frontend api_servers bind *:8000 default_backend api_servers backend public_web_servers server s1 192.168.1.25:80 server s2 192.168.1.26:80 backend api_servers server s1 192.168. ...
I was asking myself the very same question this morning.
Searching through http://www.haproxy.org/download/1.5/doc/configuration.txt I came accross this very short definition (hidden in a parameter description) :
A session is a connection that was accepted by the layer 4 rules.
In your case, you're obviously using Haproxy as a layer7/HTTP loadbalancer. If a session is a TCP connection, due to client-side / frontend Keep-Alive, it's normal to have more HTTP reqs than sessions.
Then I guess the high connection number shows that a lot of incoming connections were rejected even before being considered by the HTTP layer. For instance via IP-based ACLs.
As a far as I understand, the 'session' word was introduced to make sure two different concepts were not mixed :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With