I have a VPS box that runs a few websites for me as well as some scripts and it seems like its running out of memory. It has 1GB total memory. It looks like php-fpm exhausts the memory. Before it was simply killing other processes (like mysql) to free memory.
The error was:
php fpm has invoked oom-killer
I solved that using this solution: php-fpm invokes oom-killer
Next I tried to configure various php-fpm settings with no luck. I also increased my swap file size from 1GB to 2GB (2x my physical memory). I am running a total of 10 small websites which don't get much traffic at all so I'm confused why I am running out of memory. Besides purchasing more memory for my box, is there anything else I can do?
At this point php-fpm seems to hog up the entire 1GB of memory and most of the swap, in some cases it stops me from accessing the VPS as I can't authenticate!
service php-fpm restart
Instantly frees up almost all the memory on the box (ie 950/990 in use goes to 200/990 in use). So what are my options? I can also post relevant configuration files if needed.
Relevant specs: OS: Centos 6.7 x86_64 RAM: 1GB Swap: 2GB php -version: PHP 5.5.35 (cli) (built: Apr 29 2016 09:07:44) php-fpm -version: PHP 5.5.35 (fpm-fcgi) (built: Apr 29 2016 09:09:09)