Apache 2.2.22
Prefork
1GB Linode
Running 3 virtualhosts, but only one is "active" at the moment. One has a single HTML page and the other has a web application but Tomcat 7 is turned off.
Other things installed: postgres, Tomcat7 (shut off at the moment), and PHP was installed but I uninstalled it to see if it'd help.
To see how slow Apache is running you can visit
www.s2bjj.com yourself. Sometimes it will load but often it won't and if it does many images are not rendered. Sometimes even the CSS file doesn't load.
Basically, Apache was running great but one day I noticed the website above was inaccessible. I run it for a friend who owns a small business and it doesn't receive much traffic at all, however I don't have solid numbers to back this up. It does show up if you Google it so I guess it's a possibility it receives more traffic than I think. However, at least right now I don't think that's the main problem, as the slowness begins immediately after an Apache restart.
What I've tried:
- Uninstalling PHP5 doing "apt-get purge PHP5". I still notice the php5 directory sitting in /etc (I believe) so I'm not sure if it's fully uninstalled. I'm a Linux newb. The site above does not host any files with a php extension, nor does any other virtualhost.
- Playing with apache2.conf. The prefork part uses the recommended settings that Linode provides for web server setup. See below.
Timeout 60
KeepAlive Off
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 80
MaxRequestsPerChild 3000
</IfModule>
I've also tried putting StartServers, MaxSpareServers, and MaxClients to 8 and putting MaxRequestsPerChild to 0 but this did not help. These were recommendations I found while Googling.
Here's what top looks like currently:
top - 08:07:38 up 12:01, 1 user, load average: 0.52, 0.79, 0.82
Tasks: 195 total, 3 running, 192 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.3%us, 0.8%sy, 0.0%ni, 79.9%id, 0.0%wa, 0.0%hi, 0.6%si, 18.4%st
Mem: 1013048k total, 997580k used, 15468k free, 14724k buffers
Swap: 262140k total, 3144k used, 258996k free, 688452k cached
free looks like:
total used free shared buffers cached
Mem: 989 975 13 0 14 674
-/+ buffers/cache: 286 702
Swap: 255 3 252
Apache error log. The MaxClients errors are probably from when I set MaxClients really low. I haven't seen that error since.
[Mon Dec 30 19:27:04 2013] [notice] caught SIGTERM, shutting down
[Mon Dec 30 19:27:05 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Mon Dec 30 19:27:13 2013] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Tue Dec 31 16:46:54 2013] [notice] Graceful restart requested, doing restart
[Tue Dec 31 16:47:00 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Tue Dec 31 16:47:02 2013] [notice] caught SIGTERM, shutting down
[Tue Dec 31 16:47:03 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Tue Dec 31 16:47:04 2013] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Tue Dec 31 16:51:12 2013] [notice] caught SIGTERM, shutting down
[Tue Dec 31 17:05:06 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Tue Dec 31 17:05:07 2013] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Tue Dec 31 17:10:47 2013] [notice] Graceful restart requested, doing restart
[Tue Dec 31 17:10:53 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Tue Dec 31 17:10:53 2013] [notice] caught SIGTERM, shutting down
[Tue Dec 31 17:10:55 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Tue Dec 31 17:10:56 2013] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Tue Dec 31 17:13:01 2013] [notice] caught SIGTERM, shutting down
[Tue Dec 31 17:14:10 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Tue Dec 31 17:14:11 2013] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Tue Dec 31 17:18:20 2013] [notice] Graceful restart requested, doing restart
[Tue Dec 31 17:18:27 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Tue Dec 31 17:18:39 2013] [notice] caught SIGTERM, shutting down
[Tue Dec 31 17:18:39 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Tue Dec 31 17:18:42 2013] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Tue Dec 31 17:18:42 2013] [notice] caught SIGTERM, shutting down
[Tue Dec 31 17:19:48 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Tue Dec 31 17:19:51 2013] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Tue Dec 31 19:57:00 2013] [notice] Graceful restart requested, doing restart
[Tue Dec 31 19:57:07 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Tue Dec 31 20:03:25 2013] [notice] caught SIGTERM, shutting down
[Tue Dec 31 20:06:48 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
Also, something peripheral that is happening to this but that might be related is I'm getting emails every so often regarding my inbound/outbound traffic.
Your Linode, linode337408, has exceeded the notification threshold (5) for inbound traffic rate by averaging 5.44 Mb/s for the last 2 hours.Are webcrawlers totally bombarding the website? No way there's enough "customer" traffic to cause this.
I'm at the end of my rope with this so any suggestions or assistance anyone can provide would really help. As a last resort I guess I can just cancel my Linode and give my friend a copy of the site and say "There's many other web hosting options out there. Have at it." but I'd like to just figure it out if possible.
Thanks.