Cup use high on 8gb server traffic only 6-7k in a day


#1

Hi I am getting high cpu uses but my site traffic only 6-7k and my server configuration is digital ocean 8gb ram ubuntu 16 server is already in easy engine setup website in wordpress the average cpu use 60-70% any time and i am using wp super cache if i deactivate it or use delete cache process the server cpu use on 95-99% and after that site totally down i am facing this issue very long time i am not getting any solution please help me in this. see SS:-


#2

some one please guide me.


#3

First you need to update the PHP version to 7: ee site update example.com --php7


#4
  1. Go with PHP 7, but more importantly
  2. Why is PHP running? Is it a dynamic site that you can’t cache?

#5

Thanks for reply

  1. I have Update my site to PHP7 but issue not fix, give me another solution
  2. this is news website.

cpu use now fine before but still it taking around 50-60% and site also showing some time error “error in database connection”, “500 error” “bad gateway” .


#6

Then why aren’t the pages cached?


#7

wp super cache active. if you asking this or explain in detail. thanks


#8

can you please link to your site?


#9

sure: https://www.sabguru.com/ and plz check current load/process on server.


#10

something is wrong and I bet that the page cache is not working - maybe the supercache configuration is not right or something with the server is not right (perhaps, Nginx configuration). The source of your pages say “Dynamic page generated” - meaning this could be a non static page.

I can’t do it from here, but you need to test:

  • Is supercache creating a static file
  • Is the static file really served to the visitor?
  • Can you put a screenshot of your SC configuration?

Also, you can minify and combine your CSS and JS (use Autoptimize for it), but that’s not the main problem


#11

More:

  • How did you activated HTTPS? Did you do it via EE? because if you did it manually with the LE script, it probably means that it wasn’t configured completely
  • You have some non HTTPS resources in your pages, so your site is not really HTTPS-secured, mind you

#12

Please check super cache configuration super-cache.zip (628.6 KB)


#13

http/https: Actually site running from 3 year but on that time ssl not active i active ssl from the last month. SSL Manually: Yes it configure manually, let me how i set via ee i find this (ee site update example.com --letsencrypt) command but not tried now and my cpu/load issue also before this.


#14
  1. the ee command might not work. It has some problems and ee should be updated - not sure if it will happen though

  2. It could be very much the reason. If you did it manually, it could be configured incompletely.

  3. Choose:

  • “expert” mode
  • “compress page…” (3rd option)
  • ‘Don"t cache pages for known users’ (1st option)
  • Do you have another theme for mobile devices?

#15

Hello,

  1. I have made changes as per your guide now average cpu uses is 30-35% but it still going on 70-80% randomly.

  2. No, Same theme calling for mobile devices.

  3. Before 3-4 month site daily traffic around 30-50K but after and server was also work fine but after this issue site user consistently down now daily traffic only 5-7K but is my site under attack or its possible that some one can take my traffic to another plat form or its not part of this.


#16

Check your access logs.

Some kinds of brute force attacks cause CPU spikes. I always rename wp-login.php using WPS Hide Login and explicitly block xmlrpc.php and wp-login.php in nginx.conf in order to avoid this specific issue.


#17

Thanks

  1. Already active WPS.

  2. Already Blocked xmlrpc.php using this- add_filter(‘xmlrpc_enabled’, ‘__return_false’); i follow blocking step from this link (Blocked xmlrpc.php)

if there is another way to block/activity then plz tell me.


#18

In you /var/www/domain.com/conf/nginx create a file named anything.conf with:

location wp-login.php { return 444; }
location xmlrpc.php { return 444; }

Like this, Nginx won’t allow the requests to be processed (the 444 status means “interrupt the connection”).


#19

Rishi, are there many PHP processes? There should be around zero


#20

PHP PROCESS: I don’t know about many process or not sabguru.com normal news website just like blog. pls guid me in this.