E
E
Evansive2013-12-03 16:18:36
PHP
Evansive, 2013-12-03 16:18:36

Huge load on the web server (nginx + php-fastcgi)

Hello. There is such a problem: Apache used to stand, with multiple page updates (F5 10-15 times), the CPU is loaded at 100%. I decided that I needed to change the web server, installed nginx + php-fpm, but the problem remained. Please suggest how can I solve this problem? Thanks in advance!
VPS taken from digitalcloud.

Answer the question

In order to leave comments, you need to log in

8 answer(s)
I
Ilya Evseev, 2013-12-03
@IlyaEvseev

1) xcache for php
2) fastchi_cache for nginx
3) mytop and mysqltuner for mysql
4) collectd for system
...
6) PROFIT!

E
Eugene Mosyukov, 2013-12-03
@GeneMoss

Set the accelerator. Cache. Optimize your code. Take more powerful iron.

E
Eugene, 2013-12-03
@Nc_Soft

worker_processes 4;
reduce it to 2
and attach the config of any site from here
include /etc/nginx/sites-enabled/*;

E
Eugene Mosyukov, 2013-12-03
@GeneMoss

The site is powered by WordPress.

Disable unnecessary plugins, maybe you installed a not very high-quality self-made module.

S
smok, 2013-12-03
@smok

Look at the top and slow log of the database. The problem may be in heavy queries to the database.

A
Alexey Sundukov, 2013-12-03
@alekciy

@Evansive

VPS taken
drawdown on the disk from the neighbors is quite possible. Pure phpinfo cannot load the system so much.

E
Eugene, 2013-12-04
@Nc_Soft

Install the http_stub module on nginx (maybe nginx -V is already there to help)

location = /stat {
      stub_status on;
      #allow xx.xx.xx.xx;
      #deny all;
    }

and see how many connections site.ru/stat gives and how many are in the queue

R
Rail Khamdeev, 2013-12-05
@rhamdeew

If you have free time - try to file a similar configuration in a virtual machine on a local machine (or take a trial period from another hosting provider).
I also think xdebug will help, although I tend to think that the problem is in slow mysql queries, you can also see them in mysql slow log
. Also, as an option, you can monitor the site with the New Relic service, everything will be more interesting on the graphs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question