I run an 8GB VPS with a lot of low-medium traffic virtual hosts (mostly Wordpress installations) using FCGId for php.
Throughout the day the server seems to gradually run out of memory (4GB swap file fills up) and eventually oom-killer starts killing mysqld (which consumes 2-4 GB of ram).
I notice that there are about 12 apache processes and 42 php-cgi7.0 processes. The apache processes are about 480mb, and the php-cgi processes are 300-500mb according to the memory panel in virtualmin.
I’m wondering if this is abnormal? What’s the most performance-friendly way to constrain memory consumption? Should I try to limit the number of php-cgi7.0 processes, and if so, how?
Would completely disabling mod-php have a noticeable benefit?
Appreciate any help anyone can offer.