High traffic, site unresponsive
http://whatiread.fyi/test.html
When these problems occur, Linode's dashboard tells me that the CPU usage and network traffic are unusually high. I can't imagine that 100kbps sustained for an entire day is legitimate traffic; what it's showing for the last couple of hours is more reasonable. What can I do to identify and stop this problem?
~~![](<URL url=)http://i.imgur.com/dSKQAO6.png
Thanks.~~
8 Replies
Regarding network traffic, look in your Apache logs to see where it's coming from. Likely candidates are search engines. If they are generating more traffic than you want, then the well-behaved ones can be dealt with by creating a robots.txt
Does anyone have any more ideas?
![](
Some of them even attempt to open up hundreds of connections at once, which can really suck down your server resources as Apache swaps and swaps. Bad bots ignore robots.txt files. If you run Apache as mod_php, every connection you open up it loads up PHP as well. I'd use something like mpm worker and a php fpm setup.
If you can, limit /wp-admin to to just your IP address. That'll cut down on those kinds of attempts. I use a combination of connection limiting via IP Tables and some fail2ban magic. Hosting WordPress is not a walk in the park, which Is why I think hosted providers have really capitalized on this market…
Yeah, there are a handful of IPs hitting /xmlrpc.php dozens of times a second. I'm pretty sure I can lock that down.
94.102.49.31 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.51.216 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.2 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.234 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.31 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.51.216 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.2 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.234 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.31 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.51.216 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.2 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.234 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.31 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.51.216 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.2 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.234 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.31 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.51.216 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.2 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.234 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.31 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.51.216 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.78 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.2 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.234 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.31 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.51.216 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.78 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.2 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.234 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.31 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.51.216 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.78 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.2 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.234 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.31 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.51.216 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.78 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.2 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.234 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.31 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.51.216 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
94.102.49.78 - - [11/Feb/2016:11:17:14 -0500] "POST /xmlrpc.php HTTP/1.0" 403 478 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
Apparently, getting 403 responses doesn't slow down their attempts. But while traffic is still high, CPU usage is way down, and the site's loading time doesn't seem to be impacted. So I think I'm going to call this a win.
Thanks for the help!
A few things that can be done that should help
First you can hunt down there are a few php bytecode generators, or php caching, such as APC.
Second reduce and clean up the number of modules loaded in apache and php to what is needed, there are a large number of modules loaded that will cause this to be high, and because of PHP is not thread safe you are probably running in worker mode, which means you have multiple copies of Apache being loaded into memory. By default both can draw a great deal of memory
Third, you can run php through FastCGI instead of Modphp, this would allow you to move apache to a threaded model.
Lastly, you can try other web servers such as nginx, you may find better performance, since Nginx only runs threaded and uses fastcgi for php