In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
First of all, analyze the reasons that may lead to uneven load:
1. Lvs's own persistent10 may lead to uneven load.
2. The setting of scheduling algorithm may lead to, such as rr, wrr, wlc, lc algorithm.
3. Report retention parameters of the backend RS node, such as the keepalive parameter of apache
4. when the number of visitors is relatively small, the phenomenon of imbalance is more obvious.
5. The relationship between the time of the request sent by the user and the size of the resource.
The general direct solution:
Comment out the persistent10 in keepalived, and then restart it; (Huihua keeps using cookies and sesson solutions)
Secondly, we can directly use memcached as the session.save_handler of PHP to solve the sesson sharing problem.
Reprint # Old Boy #
1. Install memcached server software # software package see attachment
Note: memcached uses libevent as the event driver, so install libevent first.
two。 Install memcache client parts
Briefly, see the old boy training related video tutorial or Google search under the installation.
3. The beginning of the real configuration
Modify the configuration file to set the global settings in php.ini:
Web cluster session shared storage settings:
The type and configuration path of session in the default php.ini:
# session.save_handler = files
# session.save_path = "/ tmp"
Modify it to the following configuration:
Session.save_handler = memcache
Session.save_path = "tcp://10.0.0.18:11211"
Tip:
1) 10.0.0.18 11211 is the IP and port of the memcached database cache.
2) the above is suitable for LNMP,LAMP environment.
3) memcached servers can also be scheduled by multiple hash.
4. Using memcached to store session features:
Advantages:
1) the speed of reading and writing is much faster than that of normal files.
2) it can solve the problem of sharing session among multiple servers.
Disadvantages:
1) session data is stored in memory, which is lacking in persistence, but it is not a problem for session data.
2) single point, multiple computers are deployed, and data synchronization is not possible. There is still a problem of sesson loss in allocation through hash algorithm.
5. Solutions for large-scale enterprises:
2) other persistence systems can be used to store sessons, such as redis,ttserver, instead of memcached.
3) High performance and high concurrency scenarios, and the efficiency of cookies is much better than that of session. Therefore, large websites will use cookies to solve the problem of session sharing.
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
© 2024 shulou.com SLNews company. All rights reserved.