Home  >  Article  >  Backend Development  >  [Record] PHP-fpm accounts for 100% of CPU fixed

[Record] PHP-fpm accounts for 100% of CPU fixed

藏色散人
藏色散人forward
2020-08-19 15:12:463051browse

[Record] PHP-fpm accounts for 100% of CPU fixed

Recommended: "PHP Video Tutorial"

Record once php-fpm accounts for 100% of the cpu and fix it

Problem description:

According to feedback from business personnel, the front-end page returned a 502 error. After querying the server, it was found that there are two php-fpm accounting for 100% of the CPU. Restarting php-fpm has no effect.

Solution:

1. Use top to find the process ID that accounts for 100% of the cpu, and use ll /proc/PID/fd to check which file the process is operating on. Only found in the operation log file, but no data is written to the log file.

2. Then use strace -p pid to check the process ID of the full CPU and find that write (xxx) error is always reported.

3. Then use df -h to find that a disk is full and the log cannot be written, causing php-fpm to occupy 100% of the CPU.

The above is the detailed content of [Record] PHP-fpm accounts for 100% of CPU fixed. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete