How to increase HARD_SERVER_LIMIT ?

secretman

Member
Jul 23, 2003
12
0
151
Hello,
I have need to increase HARD_SERVER_LIMIT on apache.

I have set MaxClients 20000 on httpd.conf but when I start apache show
this error :

WARNING: MaxClients of 20000 exceeds compile time limit of 2048 servers,
lowering MaxClients to 2048. To increase, please see the
HARD_SERVER_LIMIT define in src/include/httpd.h.

How to increase?
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,465
30
473
Go on, have a guess
You'll have to build as normal then go into either:

/home/cpapachebuild/

or

/home/cpeasyapache/

depending on your cPanel version and wade into that tree and make your modification and then run the buildscript.
 

mickalo

Well-Known Member
Apr 16, 2002
782
5
318
N.W. Iowa
/home/cpapachebuild/ is a directory. I don't know how to increase HARD_SERVER_LIMIT.
should be something like this:
/home/cpapachebuild/buildapache/apache_<VERSION_NUMBER>/src/include
folder. replace the VERSION_NUMBER with you Apache version, IE: 1.3.37 this is where you'll find the httpd.h file

Mickalo
 

AndyReed

Well-Known Member
PartnerNOC
May 29, 2004
2,221
4
193
Minneapolis, MN
I have set MaxClients 20000 on httpd.conf
The local path to httpd.h file where you can modify HARD_SERVER_LIMIT is:
/home/cpapachebuild/buildapache/apache_1.3.37/src/include/httpd.h
You'll see the following directives:
Code:
#ifndef HARD_SERVER_LIMIT
#ifdef WIN32
#define HARD_SERVER_LIMIT 1024
#elif defined(NETWARE)
#define HARD_SERVER_LIMIT 2048
#else
#define HARD_SERVER_LIMIT 2048
#endif
#endif
My question: Are you sure you need to go up to 20000, although the variable is not there? You would need to have a huge connection and millions and millions of hits a day to go over 256 or a 1000. In any case, you may not need such a high setting for MaxClients, if you turn off KeepAlives. On a high traffic web servers, setting the MaxClients up to 1000 might cause extreme high load on the server. During peak hours you can even DOS attack that server. Good luck!
 

rtgasia

Member
Sep 30, 2006
8
0
151
Hi Andy

We have a server serving files (free file storage sites) with a lot of hits a day, in excess of 100,000.

We have the Core2Duo 2.2 and 4GB RAM running Apache 1.3.37 on a 100mbps Dedicated Line.

WHat would you suggest we keep the MaxClients to?
 

AndyReed

Well-Known Member
PartnerNOC
May 29, 2004
2,221
4
193
Minneapolis, MN
WHat would you suggest we keep the MaxClients to?
256, unless you need to go higher than that. If yes, you'll have to re-compile Apache, by hand, with the variable you want.
 

useradmin

Well-Known Member
Oct 8, 2004
107
0
166
INDIA
default limit

HI,


timeout
maxclient and many apache limit revert back to default value
how to fix this problem.


for example
Timeout = 300
MaxClient = 150
MaxKeepAliveRequests 100
MinSpareServers 5
MaxSpareServers 10


we would like to use our own value.
 

daelda

Member
Feb 3, 2005
9
0
151
Hello,

I have the same problem but with version 2.2.6 of apache which is supposed no to has this problem.

In file /home/cpeasyapache/src/httpd-2.2.6/include/httpd.h there is no HARD_SERVER_LIMIT

How could i solve it?

Thank you.
 

daelda

Member
Feb 3, 2005
9
0
151
Hello,

I have solved it with:

ServerLimit 1200
MaxClients 1000

in httpd.conf

Thank you,

Daelda.
 
Last edited:

hicom

Well-Known Member
May 23, 2003
290
4
168
I'm just adding this note for anyone looking to resolve this problem in the future.

You can increase FD_SETSIZE and HARD_SERVER_LIMIT when running EasyApache 3 under Apache Update. It is one of the options when you go to select the different modules to install on the server.

Hope this will be of help to some people.

Thanks

Tamouh