You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Matthew Boeckman <ma...@saepio.com> on 2002/12/10 17:13:08 UTC

[users@httpd] MaxClients > 255

  I'm running apache 1.3.26 on a RH 7.1 (linux 2.4.18smp) server and 
need to recompile apache to support more than 255 clients. I have 
followed what instructions I can find on this, and just wanted to see if 
the list had any additional input or suggestions.

What I did:
 From the 1.3.26 tarball, edited src/include/httpd.h to have:
#ifndef HARD_SERVER_LIMIT
#ifdef WIN32
#define HARD_SERVER_LIMIT 1024
#elif defined(NETWARE)
#define HARD_SERVER_LIMIT 2048
#else
#define HARD_SERVER_LIMIT 1024
#endif
#endif

reconfig/make/make install

My planned config will be something like:
MinSpareServers 15
MaxSpareServers 30
StartServers 15
MaxClients 1024

Any input is greatly appreciated! Thanks.

-- 
Matthew Boeckman			(816) 777-2160
Manager - Systems Integration		Saepio Technologies


---------------------------------------------------------------------
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


Re: [users@httpd] MaxClients > 255

Posted by Jacob Coby <jc...@listingbook.com>.
> RSS = Resident Set Size, which I believe is the portion of the process
that
> is actually resident in physical RAM, as opposed to swapped out to disk.
I
> think this discounts memory mapped files and stuff, but I don't know if it
> includes memory used as stack space.  Perhaps someone more clued-in could
> correct me?

Ahh, thanks.  So I looked in the man page for top, and what do you know, it
says what they mean!  ;-)

RSS  The total amount of physical memory used by the task,
            in kilobytes, is shown here. For ELF  processes  used
            library  pages  are counted here, for a.out processes
            not.

 SIZE The size of the task's  code  plus  data  plus  stack
            space, in kilobytes, is shown here.

So, it appears, that RSS does not include stack space.

-Jacob


---------------------------------------------------------------------
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


RE: [users@httpd] MaxClients > 255

Posted by Koen Vingerhoets <ko...@ubench.com>.
11788 root      18   0  1228 1228   836 R     2.3  0.2   0:00 top
 1341 apache    15   0  7804 7804  6736 R     2.1  1.5   3:39 httpd
 1386 apache    14   0  8344 8344  6704 S     1.5  1.6   3:59 httpd
 1456 apache    13   0  7640 7640  6720 S     1.3  1.4   3:11 httpd
 1347 apache    12   0  7660 7660  6700 S     1.1  1.4   4:06 httpd
 1356 apache    15   0  8360 8360  6716 R     1.1  1.6   2:52 httpd
 1364 apache    12   0  7640 7640  6716 S     1.1  1.4   2:55 httpd
 1373 apache    12   0  7484 7484  6700 S     1.1  1.4   3:08 httpd
31351 apache    10   0  7652 7652  6736 S     1.1  1.4   2:55 httpd
 1461 apache    10   0  7464 7464  6724 S     1.1  1.4   2:21 httpd
11037 mysql     11   0 20836  20M  2224 S     1.1  4.0   1:33 mysqld
 1241 apache    11   0  7804 7804  6720 S     0.9  1.5   3:55 httpd
 1316 apache    12   0  7960 7960  6720 S     0.9  1.5   2:55 httpd
 1376 apache    11   0  7644 7644  6724 S     0.9  1.4   3:51 httpd
  966 mysql     11   0 20836  20M  2224 S     0.7  4.0   3:57 mysqld
10997 mysql     10   0 20836  20M  2224 S     0.7  4.0   2:06 mysqld
 1324 apache    11   0  7808 7808  6716 S     0.5  1.5   3:16 httpd
 1499 apache    10   0  7624 7624  6720 S     0.5  1.4   4:14 httpd
31711 apache     9   0  7684 7684  6724 S     0.5  1.5   2:54 httpd
 1446 apache     9   0  7628 7628  6720 S     0.5  1.4   2:43 httpd
  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND

Sooo... looking at that, I could say they average at 1 Mb in memory size?
"(SIZE - SHARE) / 1024 = size of one apache process in MB."
(7700 - 6700) / 1024 = approx 1...
We have now 512 Mb on our machine... so the 255 can be reached.  However,
the MySQL's seem to generate some load as well...

204 processes: 202 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 23.0% user,  6.6% system,  0.0% nice, 70.2% idle
Mem:   512112K av,  344820K used,  167292K free,     168K shrd,   56008K
buff
Swap: 1044216K av,       0K used, 1044216K free                   53440K
cached

Looks like we still have room left...  mmm we'll get a 1 gig monster... so I
can safely bump it up :)

Thanks :)

Koen

-----Original Message-----
From: James Tait [mailto:JTait@wyrddreams.demon.co.uk]
Sent: 11 December 2002 10:46
To: users@httpd.apache.org
Subject: Re: [users@httpd] MaxClients > 255


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jacob Coby wrote:
|   PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
| 30485 nobody    16   0 10444 9.8M  4596 S    12.5  2.6   0:04 httpd
| 30537 nobody    15   0 10028 9592  4184 S    10.5  2.4   0:00 httpd
|
| SIZE is your app size, in KB, SHARE is the amount shared, in KB.  So
(SIZE -
| SHARE) / 1024 = size of one apache process in MB.  I'm not sure what RSS
is.
|

RSS = Resident Set Size, which I believe is the portion of the process that
is actually resident in physical RAM, as opposed to swapped out to disk.  I
think this discounts memory mapped files and stuff, but I don't know if it
includes memory used as stack space.  Perhaps someone more clued-in could
correct me?

Cheers,

JT
- --
+------------------------------------+------------------------------------+
| James Tait                         | ICQ# 17834893                      |
| MUD programmer and Linux advocate  | http://www.wyrddreams.demon.co.uk/ |
+------------------------------------+------------------------------------+

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8
Comment: Using PGP with Mozilla - http://enigmail.mozdev.org

iQA/AwUBPfcJUsg6OMTDUy4mEQKn8wCdH/OU1AaahYsQVIBKPASO1tbryFwAoPLJ
1gBr0a9OtzG09rqc7f1hR/jo
=T+e0
-----END PGP SIGNATURE-----


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

---------------------------------------------------------------------
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




---------------------------------------------------------------------
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


Re: [users@httpd] MaxClients > 255

Posted by James Tait <JT...@wyrddreams.demon.co.uk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jacob Coby wrote:
|   PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
| 30485 nobody    16   0 10444 9.8M  4596 S    12.5  2.6   0:04 httpd
| 30537 nobody    15   0 10028 9592  4184 S    10.5  2.4   0:00 httpd
|
| SIZE is your app size, in KB, SHARE is the amount shared, in KB.  So (SIZE -
| SHARE) / 1024 = size of one apache process in MB.  I'm not sure what RSS is.
|

RSS = Resident Set Size, which I believe is the portion of the process that
is actually resident in physical RAM, as opposed to swapped out to disk.  I
think this discounts memory mapped files and stuff, but I don't know if it
includes memory used as stack space.  Perhaps someone more clued-in could
correct me?

Cheers,

JT
- --
+------------------------------------+------------------------------------+
| James Tait                         | ICQ# 17834893                      |
| MUD programmer and Linux advocate  | http://www.wyrddreams.demon.co.uk/ |
+------------------------------------+------------------------------------+

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8
Comment: Using PGP with Mozilla - http://enigmail.mozdev.org

iQA/AwUBPfcJUsg6OMTDUy4mEQKn8wCdH/OU1AaahYsQVIBKPASO1tbryFwAoPLJ
1gBr0a9OtzG09rqc7f1hR/jo
=T+e0
-----END PGP SIGNATURE-----


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

---------------------------------------------------------------------
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


Re: [users@httpd] MaxClients > 255

Posted by Jacob Coby <jc...@listingbook.com>.
> Following this convo with interest, it's clear I need to do some math.
> First question from the Windoze guy: where can I see how much memory a
> process uses??  The 'top' command??? But it's shown as a percentage?? or
> not??? (i'll cover myself in shame already ;)

'top', bingo :)

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
30485 nobody    16   0 10444 9.8M  4596 S    12.5  2.6   0:04 httpd
30537 nobody    15   0 10028 9592  4184 S    10.5  2.4   0:00 httpd

SIZE is your app size, in KB, SHARE is the amount shared, in KB.  So (SIZE -
SHARE) / 1024 = size of one apache process in MB.  I'm not sure what RSS is.

Just sit there and note the mem usages that apache uses over, say, 10 min.
Discard the high and low values, and then average the rest.  Ideally, you
would sample the httpd footprint over the course of a typical day or days
and average those (leaving in the high and low values) to get a true
reading.

You can also go by the percentages, but that's a little less easy to work
with when trying to figure out how much more ram is needed.

-Jacob


---------------------------------------------------------------------
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


RE: [users@httpd] MaxClients > 255

Posted by Koen Vingerhoets <ko...@ubench.com>.
Hi,

I need to reconfigure my Apache for the game www.shimlar.com as well
we're moving to a bigger server, and i've seen: "MaxClients reached,
consider raising the limit" appear a few times in the logs.

Following this convo with interest, it's clear I need to do some math.
First question from the Windoze guy: where can I see how much memory a
process uses??  The 'top' command??? But it's shown as a percentage?? or
not??? (i'll cover myself in shame already ;)

Thanks,

Koen


-----Original Message-----
From: Jacob Coby [mailto:jcoby@listingbook.com]
Sent: 10 December 2002 19:44
To: users@httpd.apache.org
Subject: Re: [users@httpd] MaxClients > 255


> ok so I've got 2GB of ram, of which about 1GB is free at any given time
> which means that (if i understand you) have space for roughly 100
> concurrent requests?

If each connection takes 10mb, yes.  If each takes 2mb, then you've got room
for 500 connections.  It really depends on what your requirements are.

> turns out it isn't training, I was misinformed. They are going to be
> hitting it (everyone of the 400) a few times between 12 and 5, so it's a
> crapshoot as to how many concurrent hits I will actually get... eitehr
> way i"ll but start and spare just to be safe.

Ahh.  If its evenly distributed, that's only 80 hits per hour, easy stuff
:-)

-Jacob


---------------------------------------------------------------------
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




---------------------------------------------------------------------
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


Re: [users@httpd] MaxClients > 255

Posted by Jacob Coby <jc...@listingbook.com>.
> ok so I've got 2GB of ram, of which about 1GB is free at any given time
> which means that (if i understand you) have space for roughly 100
> concurrent requests?

If each connection takes 10mb, yes.  If each takes 2mb, then you've got room
for 500 connections.  It really depends on what your requirements are.

> turns out it isn't training, I was misinformed. They are going to be
> hitting it (everyone of the 400) a few times between 12 and 5, so it's a
> crapshoot as to how many concurrent hits I will actually get... eitehr
> way i"ll but start and spare just to be safe.

Ahh.  If its evenly distributed, that's only 80 hits per hour, easy stuff
:-)

-Jacob


---------------------------------------------------------------------
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


Re: [users@httpd] MaxClients > 255

Posted by Matthew Boeckman <ma...@saepio.com>.
> You don't want your server to start swapping.  It's a slow downward spiral
> from there until your server DOSes itself.  To get an idea of what you need
> in terms of ram, check out how much each process uses on average, subtract
> out the amount shared, and multiply that by the number of connections.
> 
> For example avg(6 to 10mb per child) - 4mb shared * 80 max connections =
> 320mb required.  Say the server has 384mb of ram, which is more than the
> formula says is required.  However if it were to ever get 80 connections
> using the full 10+mb of ram, the server would go down.

ok so I've got 2GB of ram, of which about 1GB is free at any given time
which means that (if i understand you) have space for roughly 100 
concurrent requests?

> 
> You're upping the level because of training?  I would most definitly raise
> startservers, and spareservers because the load is probably going to be very
> spiky.  The presenter says "..and now click on the link that says .." and
> you've got 500 people clicking on the same thing, at the same time.

turns out it isn't training, I was misinformed. They are going to be 
hitting it (everyone of the 400) a few times between 12 and 5, so it's a 
crapshoot as to how many concurrent hits I will actually get... eitehr 
way i"ll but start and spare just to be safe.

-- 
Matthew Boeckman			(816) 777-2160
Manager - Systems Integration		Saepio Technologies


---------------------------------------------------------------------
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


Re: [users@httpd] MaxClients > 255

Posted by Jacob Coby <jc...@listingbook.com>.
> > Why 1.3.26 instead of 1.3.27?
>
> Because that is what we're using! Seriously we haven't upped to 27
> because we have not seen a need to.

That's a reason I guess :)  They're basically identical except for a small
security fix.  IIRC, they're even binary compatable.

> The server will likely never see that many connections actually. We are
> expecting somewhere in the neighborhood of 350-400+ users of one of our
> clients all hitting at the same time this thursday for some training we
> are doing. I don't suppose RAM limitations are a big deal until we
> actually have that kind of traffic coming in.. ?

You don't want your server to start swapping.  It's a slow downward spiral
from there until your server DOSes itself.  To get an idea of what you need
in terms of ram, check out how much each process uses on average, subtract
out the amount shared, and multiply that by the number of connections.

For example avg(6 to 10mb per child) - 4mb shared * 80 max connections =
320mb required.  Say the server has 384mb of ram, which is more than the
formula says is required.  However if it were to ever get 80 connections
using the full 10+mb of ram, the server would go down.

You're upping the level because of training?  I would most definitly raise
startservers, and spareservers because the load is probably going to be very
spiky.  The presenter says "..and now click on the link that says .." and
you've got 500 people clicking on the same thing, at the same time.

By default, IIRC, apache will spawn one process per second.  Think how long
it would take to serve 500 people starting with 15 +
[MinSpareServers..MaxSpareServers] servers waiting.

I did hear some talk about making it increase spawn linearly (1 per second
then 2 per second then 3, etc), but I don't know if that was ever put into
the 1.3 series or not.

-Jacob


---------------------------------------------------------------------
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


Re: [users@httpd] MaxClients > 255

Posted by Matthew Boeckman <ma...@saepio.com>.
Jacob Coby wrote:
>>  I'm running apache 1.3.26 on a RH 7.1 (linux 2.4.18smp) server and
>>need to recompile apache to support more than 255 clients.
> 
> 
> Why 1.3.26 instead of 1.3.27?

Because that is what we're using! Seriously we haven't upped to 27 
because we have not seen a need to.

> 
> 
>>My planned config will be something like:
>>MinSpareServers 15
>>MaxSpareServers 30
>>StartServers 15
>>MaxClients 1024
> 
> 
> Can the server hardware handle 1024 instances of apache?  That's somewhere
> around 2.5GB MINIMUM RAM required.  If you are expecting a consistently
> large number of connections, you might want to up SpareServers and
> StartServers.

The server will likely never see that many connections actually. We are 
expecting somewhere in the neighborhood of 350-400+ users of one of our 
clients all hitting at the same time this thursday for some training we 
are doing. I don't suppose RAM limitations are a big deal until we 
actually have that kind of traffic coming in.. ?
> 
> -Jacob
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 

-- 
Matthew Boeckman			(816) 777-2160
Manager - Systems Integration		Saepio Technologies


---------------------------------------------------------------------
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


Re: [users@httpd] MaxClients > 255

Posted by Jacob Coby <jc...@listingbook.com>.
>   I'm running apache 1.3.26 on a RH 7.1 (linux 2.4.18smp) server and
> need to recompile apache to support more than 255 clients.

Why 1.3.26 instead of 1.3.27?

> My planned config will be something like:
> MinSpareServers 15
> MaxSpareServers 30
> StartServers 15
> MaxClients 1024

Can the server hardware handle 1024 instances of apache?  That's somewhere
around 2.5GB MINIMUM RAM required.  If you are expecting a consistently
large number of connections, you might want to up SpareServers and
StartServers.

-Jacob


---------------------------------------------------------------------
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