Magento – php5-fpm High CPU Usage

performance

I am running on a dedicated setup with a dual core processor and 4gb ram.

My setup is as follows:

  • nginx – 1 worker process / 1024 child processes
  • php5-fpm – max_memory = 1024
  • varnish
  • 2 websites each with one store which in turn each have 2 stores

I am in a testing stage at the moment and the site is running quickly even when accessing pages not in the cache.

That being said the php5-fpm process is running almost constantly at 50% (a whole processor), even when there are no visitors. The admin panel runs quite slowly. The memory is only running at about 500mb

I am afraid that when the site goes live we will run into issues.

Is there a way that I can find out why the process is using so much cpu?

Best Answer

Trace the process using strace. Replace XXX with the process ID.

Eg.

strace -s 1024 -p XXX

It will show you everything the process is doing, then you can figure it out from there.

NB. You don't have enough RAM. You should have 8GB as an absolute minimum. RAM is cheap, don't skimp on it.

I am afraid that when the site goes live we will run into issues.

There's a lot to be said for managed Magento hosts that specialise in doing this. They can set up the environment properly (using tried and testing configs) and diagnose and fix any problems that might occur. It is a huge false economy to make a saving by DIYing your hosting.

Related Topic