• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved php-fpm memory leak?

Tigzy

Basic Pleskian
Hello,
I'm having an issue on our prod server.
The memory usage for apache is growing until it eats it all. Every week, I have to restart the php-fpm handler to release the memory.

upload_2018-10-19_9-36-28.png

I'm running:
I haven't been able to isolate a specific app, it looks like a general issue.
I've migrated all the apps from an older PHP version (7.0) to 7.2, it doesn't solve the issue.

Any additional information you'd need ? Any hint cause I have no idea which way to go to continue investigation, my next step (last solution) would be to reinstall the server...
 
Likely some scripts are responsible for this, not PHP-FPM itself. Have you set all PHP configurations to pm = "ondemand" (do not use "static", neither "dynamic")? That should ensure that RAM and processes are freed when they are no longer needed. Also check pm.max_childrenand pm.max_requests, maybe apply appropriate changes there for your system.
 
Thanks Peter,
Currently everything is setup on "ondemand" and the max_children takes the number of domains in account.

upload_2018-10-19_10-5-21.png
 
It *appears* to be fixing the issue, yay ! :)
Giving a few more days before closing the thread.

So this means there's some 3rd party lib somewhere having a leak, right ?

upload_2018-10-22_8-58-31.png
 
If you use php-fpm it may be worth it to add
pm.process_idle_timeout = 10s;
to php.ini (settings > php settings > click on php handler > php ini)
 
I'll set max_requests to 500 see if there's a change.
A value of 10000 can be appropriate, too. 500 is quite low.

If you use php-fpm it may be worth it to add
pm.process_idle_timeout = 10s;
to php.ini (settings > php settings > click on php handler > php ini)
Here, an even shorter window can also work very well. There is no need for long idle times. Most PHP processes will finish within milliseconds, so an idle time of 5s or even lower can still work well and free resources to give your system more headroom.
 
A value of 10000 can be appropriate, too. 500 is quite low.


Here, an even shorter window can also work very well. There is no need for long idle times. Most PHP processes will finish within milliseconds, so an idle time of 5s or even lower can still work well and free resources to give your system more headroom.
You brilliantly read in my mind @Peter Debik , after posting, I told myself hummm 10 seconds is pretty high because the people who want to kill our server send TCP SYN flood attack, and they take advantage of the late timeout. If the timeout is 30 seconds they can send many requests which will overwhelm and take down the server
 
I have added the following to the additional settings in php settings of my service plan:

[php-fpm-pool-settings]
pm.process_idle_timeout = 5s;
 
Back
Top