I have load balancer setup infront of couple of SapphireIMS application server with least connection technique. I am frequently getting redirected to login page. Why?

SapphireIMS application works with user sessions. Initially when user logs in to SapphireIMS application server, the traffic might have been handled by instance-1 and if subsequent request is made by client( browsers), if load balancer routes new request to instance-2, the user session will be invalid and hence SapphireIMS application will ask you to login again.

To handle this, there is a option to use sticky session( also known as session affinity) at load balancer level to bind user session’s to specific instance until session expires or user logs out. This ensures that all requests from the user during the session are sent to the same instance.

Please note that SapphireIMS provided its own session cookie which should be used so that the session cookie follows the duration specified by the application’s session cookie .

SapphireIMS agent uses REST protocol to push the data to SapphireIMS data collector service which is stateless and it doesn’t need any session handling as application takes care even the requests are routed between instance 1 or instance-2.

In case of L4 load balancer, we will not be able to use sticky sessions and we need to live with source IP hash as affinity to maintain the sessions though it has some cons like source IP changes in between the sessions.