2

I'm having a problem that is occurring after the volume of concurrent users on my site has increased. I'm currently with almost 600 concurrent users and the server is using 100% CPU.

To alleviate this load, I use some caching systems:

ElasticSearch, Memcached, and varnish.

My server is running with Nginx, php-fpm56 and Magento 1.9.3.

Configs nginx (/etc/nginx/nginx.conf):

fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_read_timeout 300;

php-fpm (/etc/php-fpm.d/www.conf):

pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

My server is AWS with c3.4xlarge configuration (vCPU:16 MEM: 30GB SSD: 2 x 160GB)

Monitoring CloudWatch:

My CloudWatch

htop:

enter image description here

The theme was built by us, the entire front-end searches the ElasticSearch, the whole system is cached. We do not use many modules, just OneStepCheckout, payment gateway, and SMTP. I do not know what could be happening anymore because with this machine configuration it should be able to handle at least triple the users.

Anyone have any idea what might be happening?

Thanks!

  • Try to sort htop by cpu usage to see which processes are taking the most resources. It could be because of licks on mysql tables or session handling, or i/o limits. Newrelic is a good tool to see what is happening. – Zefiryn Jun 2 '17 at 19:55
  • Check for infinite loops in code. Maybe enable slow.log in php. easyengine.io/tutorials/php/fpm-slow-log . Leave the stats for a moment and look into Magento's and extensions's code. In most cases, the code is the bottle neck. There should be one or multiple messed up issues there. – obscure Jun 3 '17 at 7:45
  • your image only shows 50% usage, and only java threads – MagenX Jun 4 '17 at 8:32
  • proccess order by CPU: prntscr.com/fg4cvf – Junior Maia Jun 5 '17 at 12:46
  • Did you checked your Memcache and ElasticCache server performance? If for instance the memcache server is to slow/small, the fpm processes waiting for the response and block everything. I would recommend to use a realtime performance monitoring like newrelic for your sice. You will see immediately where the bottlenecks are – Pawel Sep 13 '18 at 10:11
0

Check your logs under system.log and exception.log if you see any error there relating to your Magento. Also do some tests to your modules using https://github.com/magento-ecg/coding-standard to see if your modules have Magento standards in the way how collections are loading, or if any infinite loop is used.

| improve this answer | |
  • No erro logs in system and exeption. – Junior Maia Jun 5 '17 at 12:45
  • did you test your code for any infinite for loop? – Ledian Hymetllari Jun 5 '17 at 12:46
  • I also facing this issue in magento, please check cache is enable in magento backed or also check varnish cache is running on port 80 on AWS instance. – rahul Chittora Dec 27 '19 at 3:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.