Home > Backend Development > PHP Problem > How to periodically release the memory occupied by PHP through scheduled tasks

How to periodically release the memory occupied by PHP through scheduled tasks

藏色散人
Release: 2023-03-07 22:08:02
forward
1972 people have browsed it

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!

How to periodically release the memory occupied by PHP through scheduled tasks

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 '------------------------------------------------------------------------------';
Copy after login

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!

Related labels:
php
source:bt.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template