In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
When a traditional Web project needs to expand from a single point to a cluster, there is a problem to consider: the implementation of distributed Session. There are usually three solutions for distributed session. Now we simply record these three ways:
1.session broadcast
As the name implies, broadcasting is that all the servers in the cluster synchronize their session to other servers, so that each server has the session information of other servers, so that no matter which server the request enters, the session information can be obtained. This method is relatively simple in understanding and implementation, and avoids the problem of session loss caused by a single point of failure. However, because broadcasting is a process in which multiple servers are synchronized, there will be a certain delay, so it is only suitable for the case of small cluster size and low network overhead.
two。 Viscous session
This is a way to specify session, which distributes all requests to the specified server at the routing of the cluster, so that a request with session goes to the same back-end server every time. This method has no additional network overhead and is suitable for medium-sized clusters, but because each request corresponds to a server, when there is a server down machine, the corresponding session will be lost, resulting in a single point of failure.
3. Centralized cache management
The session information is taken out separately, and all the session information is placed in the specified cache for centralized management. All requests with session will be processed here first, and then distributed to the backend server accordingly. Commonly used caches are memcache, redis, and so on. This method is used in large clusters to facilitate the increase of cluster nodes, but the stability depends on the stability of the cache, so it is necessary to have a reasonable write strategy to avoid the loss of session after cache failure.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Click to download: Windows Server 2008 AD and Exchange
© 2024 shulou.com SLNews company. All rights reserved.