search
HomeBackend DevelopmentPHP ProblemHow to periodically release the memory occupied by PHP through scheduled tasks

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 '------------------------------------------------------------------------------';

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!