hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Apache optimization, reach MaxClients every weeks
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Apache optimization, reach MaxClients every weeks

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 10-08-2006, 05:43 AM
osaris osaris is offline
Newbie
 
Join Date: Oct 2006
Posts: 5

Apache optimization, reach MaxClients every weeks


Hello,

I'm running a 3 Ghz Xeon with 2 GB RAM Dell server (PE 2850) which host 160 sites with Plesk. It make 120 Gb traffic per month.

I'm running FC3 with Apache 2.0.53.

Since 3 months, Apache crash apprimatively one time per week near 3 a.m. with a MaxClients reached error in error_log and the server load at 300 ! I'm unable to restart apache and I need to reboot the server with APC every time because shutdown command didn't reply !

Except when Apache crash, my server load is between 0 and 1 all the time.

Here is my apache config :

Quote:
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 120

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 2

##
## Server-Pool Size Regulation (MPM specific)
##
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 160
MaxRequestsPerChild 2000
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
I've already check if the problem was coming from a cron job but it didn't seems to.

Maybe upgrading to Apache 2.0.59 would resolve this strange problem ?

Regards,

Osaris


Last edited by osaris; 10-08-2006 at 05:46 AM. Reason: Added informations
Reply With Quote


Sponsored Links
  #2  
Old 10-08-2006, 05:46 AM
Slidey Slidey is offline
Web Hosting Master
 
Join Date: Apr 2003
Location: UK
Posts: 2,560
what do the main apache logs show? can you graph number requests per minute/10 minute/hour period?

add a ps auxww every 5 minutes for an hour between 2 + 3 (maybe lengthen it by 30 minutes each side) and output to a file, check whats running

Reply With Quote
  #3  
Old 10-08-2006, 06:00 AM
osaris osaris is offline
Newbie
 
Join Date: Oct 2006
Posts: 5
Thanks for your (very) quick reply.

The main apache logs didn't show special usage, still few call to the webmail but not lots of requests.

I've already captured the apache-status every minute before the crash and we see that in the scoreboard that all the slots are used by a process. I've try to add an apache restart at 3:08 a.m. but it can't kill all the processes ! It sends a SIGTERM then a SIGKILL on the 256 processes which are running.

I've also captured the ps auxww every minute between 2:45 and 3:15 but it only show that there's many apache processes, nothing more...

Thanks for your help

Reply With Quote
Sponsored Links
  #4  
Old 10-08-2006, 06:14 AM
Slidey Slidey is offline
Web Hosting Master
 
Join Date: Apr 2003
Location: UK
Posts: 2,560
im on call this weekend, so virtually have to sit in front of the pc anyway...

it strikes me as strange that it happens at exactly the same time every night.. even if your site got busy, it would/should have some variation.. is it a certain cgi, or a busy db, or even a db backup (we get all 3 sometimes, but more cgi issues than db as we run on seperate machines)

so theres no defunct processes, just a shedload of active apache procs? can try to upgrade to latest - i dont regularly read changelogs so dont know whats changed and how they'd affect you..

Reply With Quote
  #5  
Old 10-08-2006, 06:30 AM
osaris osaris is offline
Newbie
 
Join Date: Oct 2006
Posts: 5
The problem appears approximatively one time per week :

Quote:
[root@srv13 httpd]# cat error_log* | grep MaxClients
[Sat Oct 07 03:07:58 2006] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Mon Sep 25 03:24:39 2006] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Sat Sep 30 03:11:46 2006] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Thu Sep 14 03:18:25 2006] [error] server reached MaxClients setting, consider raising the MaxClients setting
Apache-status let me think it's not a site busy issue because many site are listed. I've already checked that it's not a backup or CGI issue.

In fact it's like if httpd wasn't killing processes so the slots are filled with many many processes and apache die...

Did you know how I can easily upgrade to httpd 2.0.59 on FC3 ? (rpm)

Regards,

Osaris

Reply With Quote
  #6  
Old 10-08-2006, 06:41 AM
cywkevin cywkevin is offline
Predatory Poster
 
Join Date: Jul 2003
Location: Goleta, CA
Posts: 5,550
Try lowering the value for timeout from 120 to 60 Of course if all else fails you may have to accept that you need a better server and upgrade.

Reply With Quote
  #7  
Old 10-08-2006, 06:55 AM
osaris osaris is offline
Newbie
 
Join Date: Oct 2006
Posts: 5
Quote:
Originally Posted by pixelized
Try lowering the value for timeout from 120 to 60 Of course if all else fails you may have to accept that you need a better server and upgrade.
I've lowered my timeout but I really didn't think that the solution is to upgrade to a better server because i would have more problem between 5 p.m and 8 p.m. each day !

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Google Launches Open Source Apache HTTP Server Module mod_pagespeed Web Hosting News 2012-10-12 12:01:56
Apache Web Server Adds Cloud Capabilities with First Major Update in 5 Years Web Hosting News 2012-02-21 16:05:02
The Apache Software Foundation Launches Hadoop v1.0 Web Hosting News 2012-01-05 18:29:16
Control Panel cPanel Launches New Apache Configuration Script Web Hosting News 2011-12-28 19:41:39
Oracle is the Latest Vendor to Apply Patch for Apache Killer Flaw Web Hosting News 2011-09-19 14:43:58


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?