Maximum number established TCP connection

Patrick Dung patrick_dkt at yahoo.com.hk
Tue Mar 4 07:20:40 UTC 2008


--- Bill Moran <wmoran at potentialtech.com> wrote:

> In response to Matthew Seaman <m.seaman at infracaninophile.co.uk>:
> 
> > Bill Moran wrote:
> > > In response to Patrick Dung <patrick_dkt at yahoo.com.hk>:
> > > 
> > >> Hello
> > >>
> > >> I would like if there is a (countable) limit for the max TCP
> connection
> > >> of a Apache web server.
> > >>
> > >> Suppose:
> > >> 1. An apache web server serves a very big iso file.
> > >> 2. 5000 people tried to connect to the apache server to get the
> iso
> > >> file.
> > >> 3. They connect to the server gradually (not 5000 people
> starting at
> > >> the same moment). So that there will not be a problem caused by
> the TCP
> > >> backlog limit.
> > >> 4. There will be 5000 established TCP connections.
> > >>
> > >> Is it true that FreeBSD could handle 'unlimited' established TCP
> > >> connections as long as it has enough CPU power and memory?
> > > 
> > > The FreeBSD limit on the number of open TCP connections is
> significantly
> > > higher than the Apache limit on the number of concurrent HTTP
> sessions.
> > > I believe Apache has a hard limit of 256.
> > 
> > That's a compile-time option in apache-1.3.x -- you can set
> > APACHE_HARD_SERVER_LIMIT in /etc/make.conf to override the default
> of
> > 512 if required.
> > 
> > However in apache-2.2.x it seems the limits are imposed entirely by
> > the MPM settings in httpd.conf -- at least, I cannot find any
> tunables
> > in the port Makefiles.
> 
> Interesting.  I found this:
> http://httpd.apache.org/docs/2.0/mod/mpm_common.html#serverlimit
> Which claims the hard limit is 20,000.  So I guess my information is
> a bit out of date.
> 
> -- 
> Bill Moran
> http://www.potentialtech.com
> 

Hello

I have checked the link and dig deeper.

For prefork model: One connection should be served by one httpd child
process. The default limit, as most of you had said, it should be
MaxClients or ServerLimit (default is 256 described in apache manual).

If worker model is used, the max connection limit should still be
MaxClients, but there are other related parameters  which affect the
limit. (ThreadsLimit, ServerLimit, ThreadsPerChild).

ps: Each directive (eg. ServerLimit) may have different meanings in
different MPM. 

I hope my understanding is correct and please correct me if I am wrong.

Regards
Patrick


      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping


More information about the freebsd-questions mailing list