This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12915|Reply: 0

[Webmaster Communication] Using Alibaba Cloud SLB load balancing to solve php-fpm CPU usage of more than 90%

[Copy link]
Posted on 5/8/2015 8:22:09 PM | | | |
During the May Day holiday, the service team upgraded the server environment of the Yitaobang website, from PHP5.3 to PHP5.6, and after the successful upgrade, the server CPU was blown up to more than 90%, which has remained high. Check the server and find that multiple PHP-FPM processes cause the CPU load to be too high, resulting in the website being unable to be accessed normally. Reinstalling the server environment and PHP version multiple times, and even changing PHP to HHVM cannot solve the problem of high CPU load.


E-Taobang server operation process (service architecture diagram): User client → Domain name resolution → Baidu Cloud Acceleration Node (CDN/caching/anti-DDOS/CC attacks) → Alibaba Cloud Shield node (anti-CC/DDOS/WAF attacks) → ECS source server (CSS, JS, and images for CDN diversion), and Alibaba Cloud Cloud Shield does not have any attack information, so it can be completely ruled out as an attack.

Looking at the nginx logs, php-fpm logs, and slow logs, there are no abnormal factors, and I see multiple TIME_WAIT information from the netstat -n command, which is caused by the IP segment of 100.97.x.x (the last IP segment is the IP address of Alibaba Cloud SLB listening service).


Without further ado, let's talk about the specific solution, which was finally handled by the professional operation and maintenance team of the Yitao Gang (V Station Power), and the final result was that the CPU load caused by the SLB's service monitoring settings was too high.
The original SLB service listens to HTTP protocol port 80, and the http protocol health check will regularly send http requests from multiple heads, resulting in continuous access to read HTTP, resulting in php-fpm causing the CPU load to reach more than 90% for a long time, and the specific CPU load usage quota depends on the configuration of ECS. After changing the health check service, the CPU usage goes offline.

If this situation also occurs, change the health check configuration of SLB service listening from HTTP protocol 80 to TCP protocol 80 configuration as follows:






Previous:Microsoft abandoned IE and was determined to do 220,000 lines of code
Next:Extraterrestrial power to take the server
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com