Skip to main content

How to maintain session persistence and file sync in load balancing? [Resolved]

I'm not very educated when it comes to distributed systems. I have a website hosted currently on a windows server and I want to load balance to 2-3 servers. But I have some problems in mind, and I want to know what I need to do about them.

1- Session persistence. I thought about using nginx open source but found out that the only way to do sticky sessions is ip_hash which causes uneven distribution among the servers. I don't want this, are there any free alternatives for windows that allow sticky sessions without IP Hashing?

2- Updating and downloading files. When I need to update/copy/create files, do I need to do it on all servers? Is there any easier way?


Question Credit: Markus Pauli
Question Reference
Asked March 17, 2019
Posted Under: Network
38 views
1 Answers

  1. When you have many users, IP hashing will statistically give you almost uniform distribution across servers. I would suggest to stay with sticky sessions with ip_hash. That is the simplest and most robust way.

Alternatively, you can store sessions in something like memcached or any other no-SQL database, this way you won't need to care about session sticking.

  1. There are no easier ways, but there are more automated ways which will require less manual work. You can automate this using repository and doing remote execution of commands like PSExec or WMI.

Files uploaded by users will have to be ether synchronized to all servers, or uploaded and served from network location accessible to all servers.


credit: BarsMonster
Answered March 17, 2019
Your Answer