The following tutorial column of Pagoda Panel will introduce to you how to regularly release the memory occupied by PHP through scheduled tasks. I hope it will be helpful to friends in need!
Release the memory occupied by PHP regularly through scheduled tasks
Add a task in the scheduled task and select the period, such as every Monday 3 Execute at 30 minutes
Select to execute the Shell script and paste the following Shell script
if [ -f /etc/init.d/php-fpm-52 ];then service php-fpm-52 reload fi if [ -f /etc/init.d/php-fpm-53 ];then service php-fpm-53 reload fi if [ -f /etc/init.d/php-fpm-54 ];then service php-fpm-54 reload fi if [ -f /etc/init.d/php-fpm-55 ];then service php-fpm-55 reload fi if [ -f /etc/init.d/php-fpm-56 ];then service php-fpm-56 reload fi if [ -f /etc/init.d/php-fpm-70 ];then service php-fpm-70 reload fi myDate=`date +"%Y-%m-%d %H:%M:$S"` echo "★[$myDate] PHP内存回收成功!" echo '------------------------------------------------------------------------------';
The above is the detailed content of How to periodically release the memory occupied by PHP through scheduled tasks. For more information, please follow other related articles on the PHP Chinese website!