ZABBIX php-fpm占用内存高的解决办法

0x00 故障:

2835777-20230110132237997-1319950803

 

 

0x01 Top

PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
1605 apache    20   0 1069240 726400   3920 S   0.0  4.5 261:17.41 php-fpm                                                                                                                                            
1607 apache    20   0 1066988 726212   3932 S   0.0  4.5 260:42.60 php-fpm                                                                                                                                            
1606 apache    20   0 1069432 724392   3920 S   0.0  4.5 260:51.22 php-fpm                                                                                                                                            
9481 apache    20   0 1066936 724124   3924 S   0.0  4.5 261:43.43 php-fpm                                                                                                                                            
1603 apache    20   0 1068816 724052   3916 S   0.0  4.5 261:09.39 php-fpm                                                                                                                                            
1604 apache    20   0 1067072 723892   3916 S   0.0  4.5 261:26.87 php-fpm                                                                                                                                            
11714 apache    20   0 1065180 721692   3912 S   0.0  4.4 261:12.72 php-fpm                                                                                                                                            
9274 apache    20   0 1066056 720220   3908 S   0.0  4.4 260:50.75 php-fpm                                                                                                                                            
24803 apache    20   0 1049856 710728   3944 S   0.0  4.4 255:48.13 php-fpm                                                                                                                                            
10620 apache    20   0 1048444 708284   3928 S   0.0  4.4 255:10.10 php-fpm

 

0x02 解决方法

修改 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

vi /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
#贴入,值根据情况修改
pm.max_requests = 200
#重启服务
systemctl restart httpd rh-php72-php-fpm

 

0x03 总结

php-rpm的内存未正确的释放

阅读剩余
THE END