1

So I've spent the last two days trying to figure this out. We host a pretty high-traffic Magento site on Amazon EC2 Large, using both Apache w/mpm-prefork, Varnish, and APC caching. Problem is the CPUs suddenly spike at 100% and never quits, increasing the load and rendering the page unusable. This happens every time Apache is started, though usually after several minutes.

First som server stats:

  • Processor: 64-bit
  • vCPU: 2
  • Memory (GiB): 7.5

For now, our only remedy has been to upgrade the instance to XLarge where it performs "ok" (load average on 0.6 - 0.9 but still usable). Still, based on other sites, a Large instance should be enough to host this with relatively good performance.

I suspect that our prefork settings may be causing this. On the Large instance, we have the following settings:

<IfModule mpm_prefork_module>
  StartServers        10
  MinSpareServers     10
  MaxSpareServers     20
  ServerLimit         50
  MaxClients          50
  MaxRequestsPerChild 4000
</IfModule>

Timeout 120
KeepAlive On
MaxKeepAliveRequests 1000
KeepAliveTimeout 5

When upgrading to XLarge, we swap with some higher prefork-settings:

<IfModule mpm_prefork_module>
  StartServers        20
  MinSpareServers     20
  MaxSpareServers     40
  ServerLimit         150
  MaxClients          150
  MaxRequestsPerChild 8000
</IfModule>

Does anyone have any ideas that I might look into? Or anyone with a similar setup willing to share?

Any help is appreciated!

Fredrik
  • 111
  • 3
  • 2
    What performance data have you collected and analyzed so far? Please post about that... – EEAA May 05 '15 at 12:26
  • What kind of data would you be interested in? – Fredrik May 05 '15 at 13:03
  • 1
    Which "large", [there are 4](http://aws.amazon.com/ec2/instance-types/): m3, c3, c4, r3? (Edit: even though you have posted the basic system specifications, each instance type behaves differently, which may have an impact on your application). – msanford May 05 '15 at 15:17
  • It's an M1. Though I can see from the link that it's already outdated and should be replaced with M3 which has SSD storage among other features. I'll try it out. – Fredrik May 06 '15 at 06:32
  • 1
    you need to strace/debug apache process to see what it is actually up to. but the problem is that you have 2 vCPU only for _a pretty high-traffic Magento site_, this is not enough. this is good for a clastered setup, but one unit needs more CPU. – ADM May 07 '15 at 09:13
  • I would say that 2 vCPUs are a bit scarce for a "pretty high-traffic Magento" site, I'm afraid. Analyze your access logs and calculate your average volume of requests per second and average processing time per request (Percentile 95 tends to be a more appropiate metric for PHP intensive sites like Magento). Then, deliver a fleet of vCPUs big enough to handle your site load properly. – ma.tome May 27 '15 at 23:28

0 Answers0