0

I'm having an issue with Apache 2.2.15 (CentOS 6.x x64) causing high memory load, to the point of consume 100% of an 8GB swap, and load averages >125. The VM is an Azure A2 VM (2 vCPU, 3.5GB RAM). This has worked wonderfully for quite some time, and my traffic hasn't changed much per WordPress stats. This server also hosts MySQL 5.5.43 x64, but that is under very low load. I'm also using Predis in conjunction with Azure Redis to cache [most of] the WordPress site. Lastly, I'm using mod_fcgid and php5_module (is this correct, or do I just need mod_fcgid?).

Things I've tried:

Moved from preform to worker MPM.

Changed the parameters for the worker MPM:

StartServers 3

MaxClients 150

MinSpareThreads 15

MaxSpareThreads 100

ThreadsPerChild 25

MaxRequestsPerChild 500

Reduce the # of loaded modules

Turn off KeepAlive (just tried this, so waiting for results, but it doesn't look hopeful)

Eventually the Apache processes simply use up all of the memory, then the swap.

Any further suggestions? FWIW, my WordPress site sees about 600 - 800 hits on a normal day, 1100 was my highest, but at that point in time I did not have any of these issues, while still using prefork.

EDIT: Found https://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-centos-5.2 and followed that article, modifying php.conf. mod_php no longer appears in apachectl -t -D DUMP_MODULES.

4
  • 1
    Do you have anything in the apache access/error logs, such as the infamous xmlrpc.php wordpress issue? Also is anything showing up in your system logs that might help narrow down the issue?
    – Chad Smith
    Apr 22, 2015 at 17:11
  • Yes, xmlrpc.php is being repeatedly accessed by certain clients (usually generating 403 or 500 statuses). I'm individually blocking them in the Azure Load Balanced Set when I run across a client, watching access_log. Error_log doesn't really contain much of interest. Which 'system' log should I be looking at? Apr 22, 2015 at 17:14
  • The xmlrpc.php exploit can be used to eventually render your system unreachable, as it consumes a lot of resources. It might be worth adding an explicit block in your .htaccess for it. As for system logs, just /var/log/messages is probably appropriate to determine there are any other potential causes. I'm not looking for anything specific, just something out of the ordinary.
    – Chad Smith
    Apr 22, 2015 at 17:17
  • My understanding is that the exploit was resolved, but that doesn't mean a client cannot request xmlrpc.php. And disabling that renders JetPack non-functional, which would be difficult to deal with. Apr 22, 2015 at 18:21

1 Answer 1

0

The fix was to follow the instructions at https://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-centos-5.2. Commenting out everything in php.conf. After that mod_fcgi took over handling php in it's own process, rather than in Apache's process.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .