httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emma Lovatt" <emma.lov...@ticketline.co.uk>
Subject RE: [users@httpd] ServerLimit
Date Mon, 20 Nov 2006 16:43:45 GMT
Thanks for your help I really appreciate it :)

Em

-----Original Message-----
From: Sander Temme [mailto:sctemme@apache.org] 
Sent: 20 November 2006 16:36
To: users@httpd.apache.org
Subject: Re: [users@httpd] ServerLimit

Hi Emma,

On Nov 20, 2006, at 7:54 AM, Emma Lovatt wrote:

> I have read some conflicting information on how to up the max_clients
> directive.

There's really only one way: in the configuration file. See conf/ 
extra/httpd-mpm.conf for suggestions.

> Could someone explain the process to me a little better if possible or
> point me in the direction of some docs,  I am really struggling to  
> find
> some decent documentation on this.

You should not need to muck in the source code: tuning the  
ServerLimit and MaxClients directives should be all you need.  For  
instance, if you want a maximum of 1024 child processes, tell Apache:

ServerLimit 1024
MaxClients 1024

There is, however, something screwy going on: the order of these  
directives in the configuration file matters!  The code that  
implements the MaxClients directive checks the internal value of the  
ServerLimit directive at that time, and if that hasn't been set yet  
it'll emit the following warning:

WARNING: MaxClients of 1024 exceeds ServerLiimit value of 256 server,
  lowering MaxClients to 256.  To increase, please see the ServerLimit
  directive.

Switch the above around, restart your server and you'll see this  
happen until you switch it back. And they'll still both show up as  
1024 in mod_info!  Quite maddening if you don't know what's going on.

> Here is the part of the prefork.c I think I have to tweak :).
>
> #ifndef DEFAULT_SERVER_LIMIT
> #define DEFAULT_SERVER_LIMIT 256
> #endif

Once again, you shouldn't need to tune at compile time. However, if  
you desperately want to do so, yes this is the value to tweak.

The eventual value should be in relation to your memory, CPU, bus and  
network power. Find out using top how much memory each process takes  
(note that there is a shared memory portion that only gets allocated  
once across all processes) and divide that across the total available  
memory. However, you probably shouldn't go too high because you'll  
run into CPU, bus and mutex concurrency issues before you run out of  
memory. The kernel will use extra RAM as file system cache, so it's  
never wasted.

S.

-- 
sctemme@apache.org            http://www.temme.net/sander/
Open Source Software Consultant
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF





- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This e-mail (and any attachments) is confidential and may be privileged. If you are not the
intended recipient do not copy, use, or rely on them.
We do not accept any legal responsibility for the contents of this communication due to the
generally insecure nature of email.
The views and opinions expressed within this email are those of the author and are not necessarily
those of 'Piccadilly Ticketline' or any subsidiary.
If you received this email in error, please notify us immediately. PiccadillyTicketline has
taken every reasonable precaution to ensure that any attachment to this e-mail has been swept
for viruses.
However, Ticketline cannot accept liability for any damage sustained as a result of software
viruses and would advise that you carry out your own virus checks before opening any email
or attachment.

- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message