Load Balancing - hash key storage

loadbalancing

#1

I have 2 servers that i wanted to play around with load balancing on.

server1.company.com
server2.company.com

The problem is, when you login currently, we store a hash key that is passed back and forth in order to determine who you are and what database you’re currently connecting to. The browser passes this key based on your domain and when I turn on load balancing I’m supposing the browser is getting confused as to what is going on and keeps logging me out.

Is there something I’m missing that might get this working properly?

Thanks,

Glenn


#2

Hi @glennh - sorry for the delayed response. Not sure if you are still working on this but I can try to help. Unfortunately we would need more detail on how you are storing/passing the hashed key and we probably shouldn’t get into that kind of detail here. One thing to try would be turning on Session Affinity, if you haven’t already.

Otherwise, it would be best to submit a ticket to support for investigation. They can get into more detailed information via email.


#3

Yeah, I have Affinity turned on and I can explain the basic process.

We use sessions on the servers but nothing else. The session key is used on the server in order to validate a hash key each user gets when they login. This is a temporary key and with it we’re able to determine what database they are accessing and who they are.

Each server has a path file that goes with it to provide its unique domain name. This is where the first step of the problem comes in because we can’t turn on the load balancer without telling each server that they are part of the load balancer domain. Once you do this, you can’t access the servers directly. So they are either part of the load balancer or not.

So a user logs in to load balancer, they get pointed to specific server. That server then knows to direct any calls back through the load balancer which should identify the IP of client and send back to this same server. This seems to be working as I can login and go about my business without missing a beat. However, when things start to get a little loaded, all of the sudden people start getting logged out. The only thing I can think of is that the load balancer has all the sudden decided they should be sent to server 2 instead of server 1 and that server has no active session running and logs them out.

This is totally random but the tickets start coming in quickly. Another complaint we get almost immediately upon turning on the load balancer is how slow everything has started responding. I don’t see this on my end but every customer to a T opened tickets about it and the ones I spoke to commented about it even before they had any real issues.

So we appear to have 2 separate issues with the load balancer and not real sure what we can do about it. Testing it requires me to turn it on and turning it on means all of my customers are going to be upset with me within a few minutes.

Thanks,

Glenn


#4

Hi Glenn,

Would you mind opening a support ticket about this issue so that we can hash out the details? This issue would be better worked in a ticket as we have further questions around your setup and how you are utilizing the session key and also when you last experienced the issue to confirm your theory about the load balancer sending the traffic to a different server (due to some origin being marked down). Also, we will need to work together to understand the speed difference you are observing by coordinating to gather metrics both with and without Cloudflare load balancing for comparison.

After we start reaching a conclusion through the support ticket, we can then post a summary back to this thread for others to see which would be more beneficial than trying to hash out all details and troubleshooting through the community forum. Please let us know when you open the ticket.


#5

I have a support ticket open but not getting near this level of interest on it :slight_smile:
Glenn