i HAProxy community,

As a new user of HAproxy, I'm puzzled by the definition of "sessions"
in HAproxy. I can't seem to find it anywhere in docs.

Test setup:-

- HAproxy instance with one frontend, one backend and a stats frontend.
- Backend connects to a custom Go program that supports persistent connections.
- Load-testing program "hey" doing "1 req per sec" over "1 tcp connection".

Full configs are available here:
https://gist.github.com/shadyabhi/fc511449600092364b08e58e2b07079f

After 10s of starting the experiment, this is what I see on stats page:-

- On "http frontend", the stats page shows "0 session rate", which
makes sense because "hey" is reusing TCP connections for multiple HTTP
requests.
- On "default_backend backend", it appears that the session is
incremented on each HTTP transaction. Wait, does a session on frontend
doesn't mean the same session at backend?
- Session reuse seems to be 90%, so it's unlikely that the backend is
creating a new TCP connection (aka session??) to serve every request
initiated by "hey".

I see sessions being used here
(https://www.haproxy.com/documentation/hapee/latest/configuration/variables/syntax/#scoping),
and it seems to suggest that session signifies a "tcp session". That
holds true for frontend, but not for backend as per the above
experiment. So, what really is a session?

Stats page link:
https://gist.github.com/shadyabhi/fc511449600092364b08e58e2b07079f

-- 
Cheers,
Abhijeet (https://abhi.host)

Reply via email to