Showing results for 
Search instead for 
Did you mean: 

HAProxy creates sessions

Former Member
0 Kudos

Our load balancer is set up with health checks against all nodes in our Hybris Commerce cluster. The checks are done very regularly and creates a lot of sessions, which eventually time out. But the servers have to maintain a fairly large number of sessions, cause by the health checks.

Is it recommended to do this in a different way? One could of course make the health check work on the TCP layer, but that reduces the confidence of the result. Is there a URL or argument suitable for this?

Accepted Solutions (1)

Accepted Solutions (1)

Active Contributor
0 Kudos

You can stop your health check creating sessions by not letting it run through the storefront filter chain. One way to do this is to healthcheck against a static resource (caught by the ResourceFilter or a jsp in your webroot folder.

Although this is just tests whether Hybris is up not whether it can connect to the db etc.

If you put a filter-mapping into the chain in web.xml before the mapping for storefrontTenantFilterChain and make sure your healthCheck filter is only mapped to /healthcheck (or whatever url you want) and returns rather then continuing the chain then it will never create a session but will just return whatever you add to the response in your health check filter. You can do checks against the db using the Spring jdbcTemplate.

Alternatively look at something like the Crawler Session Manager Valve to make sure that all request from your load balancer's ip or user agent use a single session.

Answers (0)