RAM gets filled by php-fpm

Skip to first unread message

Conny Tigerspice

Apr 20, 2018, 5:39:43 PM4/20/18
to highload-php-en
Hi (:

I have a problem which is related to php-fpm. So I would be very greatful for any assistance on how to solve the problem.

Server A runs a Shopware onlineshop (Linux, Plesk, Apache, PHP 7.0.29)
Server B runs an import script using the REST-API of Shopware to import data (write it to the mySQL database)

So server B sends a request, gets the result and sends a new request. Is is done very very often.
While it is sending requests, at some point the RAM on server A gets filled completely.
If I check the output of "top", there are several php-fpm processes running which use all the RAM.
As soon as I kill the import scripts on server B, the RAM on server A gets free again.

I've already contacted the people who wrote the REST-API but that was no real help to me.
For sending the requests I use Guzzle on server B and I also contacted the Guzzle programmers which told me that it is impossible that Guzzle is the cause.

So I hope that someone of you can somehow help me.

Some guidance on how to analyze the problem would already help.

I checked the file /var/log/plesk-php70-fpm/error.log and the apache logs, but I did not find anything helpful.
Is there something else I can check?


Apr 22, 2018, 5:28:22 PM4/22/18
to highloa...@googlegroups.com
How many GB Ram total on server A and how many 1 php-fpm consumed?


You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Conny Tigerspice

Apr 23, 2018, 6:44:32 AM4/23/18
to highload-php-en
Server A has 30.7 GB RAM and there were 5 php-fpm processes consuming 17.6 up to 22.7 percent each. So you could say 20% of 30.7 GB = 6.14 GB.

I got the advice to monitor the problematic processes using "strace". I noticed in the output that php files are listed very often. So I used grep to get all the lines containing "\.php". In the resulting file, a lot of lines containing the word "unfinished" appeared, but the unfinished processes were never resumed. So I assume that this could cause my problem.
The system calls that are never finished are:


on php files.

Some example lines are:
14686 09:12:21.497129 lstat("/var/www/vhosts/shoplink/vendor/autoload.php",  <unfinished ...>
14686 09:12:21.497367 lstat("/var/www/vhosts/shoplink/vendor/autoload.php",  <unfinished ...>
14686 09:12:21.497788 access("vendor/autoload.php", F_OK <unfinished ...>
14686 09:12:21.497837 lstat("/var/www/vhosts/shoplink/autoload.php",  <unfinished ...>
14686 09:12:21.498051 lstat("/var/www/vhosts/shoplink/autoload.php",  <unfinished ...>
14686 09:12:21.498263 lstat("/var/www/vhosts/shoplink/autoload.php",  <unfinished ...>
14686 09:12:21.498485 lstat("/var/www/vhosts/shoplink/autoload.php",  <unfinished ...>
14686 09:12:21.498841 open("/var/www/vhosts/shoplink/autoload.php", O_RDONLY <unfinished ...>
14686 09:12:21.499113 lstat("/var/www/vhosts/shoplink/vendor/autoload.php",  <unfinished ...>
14686 09:12:21.499381 lstat("/var/www/vhosts/shoplink/vendor/autoload.php",  <unfinished ...>
14686 09:12:21.499621 lstat("/var/www/vhosts/shoplink/vendor/autoload.php",  <unfinished ...>
14686 09:12:21.499889 lstat("/var/www/vhosts/shoplink/vendor/autoload.php",  <unfinished ...>
14686 09:12:21.500329 open("/var/www/vhosts/shoplink/vendor/autoload.php", O_RDONLY <unfinished ...>

Does someone have any idea why the calls remain unfinished? What could cause this behaviour in general?


Apr 23, 2018, 12:25:36 PM4/23/18
to highloa...@googlegroups.com
Could you show me the disk io? What type of hard drive you are using, hdd or ssd? What RAID type?
Reply all
Reply to author
0 new messages