You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Abhinav Bhagwat <ab...@gmail.com> on 2007/07/24 19:23:00 UTC

[users@httpd] Getting 5000 concurrent connections and 400 requests per second with Apache

Hi All,

I want to connect 5000 clients simultaneously to apache. I have increased
the ulimit and /etc/security/limits.conf limits. I have also modified the
httpd.conf to serve MaxClients upto 10000 and increase the Timeout to 1500.
The keepAlive is set to On as i need to send multiple requests on each
connection. I keep getting socket-timeout and connection resets at the
client side. I am use httperf at the client side to simulate 5000
connections at the rate of 400 requests per second. I can easily get IIS do
this without any configuration changes to it.

Any Suggestions ?

Regards,
Abhinav

Re: [users@httpd] Getting 5000 concurrent connections and 400 requests per second with Apache

Posted by Joshua Slive <jo...@slive.ca>.
On 7/24/07, Abhinav Bhagwat <ab...@gmail.com> wrote:
> The apache version is 2.0.52-25 running on RHEL 4. The content is a 1k html
> file.

That's a pretty-old version, and if you want the bleeding-edge of
performance, you should use a modern version. But on the other hand, I
don't see any specific reason why upgrading would fix this particular
problem.

>
> When shutting down apache i see the error below in the logs othewise when
> apache is running there is no error.
>
> [error] child process 16801  still did not exit, sending a SIGKILL
>
> The service httpd status command shows about 5000 process ids when the load
> is at its peak.
> Can you give some clue on what other networking logs should i check for?

You should check basic things like physical memory free and processor
usage to make sure the server isn't swapping itself to death. And you
should check the basic system logs like /var/log/messages, etc. Given
that it seems like apache has plenty of capacity to spare (MaxClients
10000 with 5000 active), I'd take a hard look at local OS and
networking issues on both your client and server.

Joshua.

---------------------------------------------------------------------
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] Getting 5000 concurrent connections and 400 requests per second with Apache

Posted by Abhinav Bhagwat <ab...@gmail.com>.
The apache version is 2.0.52-25 running on RHEL 4. The content is a 1k html
file.

When shutting down apache i see the error below in the logs othewise when
apache is running there is no error.

[error] child process 16801  still did not exit, sending a SIGKILL

The service httpd status command shows about 5000 process ids when the load
is at its peak.
Can you give some clue on what other networking logs should i check for?

Regards,
Abhinav

On 7/24/07, Joshua Slive <jo...@slive.ca> wrote:
>
> On 7/24/07, Abhinav Bhagwat <ab...@gmail.com> wrote:
> > Hi All,
> >
> > I want to connect 5000 clients simultaneously to apache. I have
> increased
> > the ulimit and /etc/security/limits.conf limits. I have also modified
> the
> > httpd.conf to serve MaxClients upto 10000 and increase the Timeout to
> 1500.
> > The keepAlive is set to On as i need to send multiple requests on each
> > connection. I keep getting socket-timeout and connection resets at the
> > client side. I am use httperf at the client side to simulate 5000
> > connections at the rate of 400 requests per second. I can easily get IIS
> do
> > this without any configuration changes to it.
> >
> > Any Suggestions ?
>
> Do some more debugging.
>
> Does the apache error log say anything interesting? What does the
> server-status display look like under this load? Have you checked
> other system logs for networking problems?
>
> By the way, 1500 is way too high for Timeout. You probably want
> Timeout set to well under 60 seconds.
>
> Also, you haven't given any details about what version of apache, what
> OS, what kind of content is being served, etc.
>
> Joshua.
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
Regards,
Abhinav
--------------------------
Sent from my Google Mail account.

Re: [users@httpd] Getting 5000 concurrent connections and 400 requests per second with Apache

Posted by Joshua Slive <jo...@slive.ca>.
On 7/24/07, Abhinav Bhagwat <ab...@gmail.com> wrote:
> Hi All,
>
> I want to connect 5000 clients simultaneously to apache. I have increased
> the ulimit and /etc/security/limits.conf limits. I have also modified the
> httpd.conf to serve MaxClients upto 10000 and increase the Timeout to 1500.
> The keepAlive is set to On as i need to send multiple requests on each
> connection. I keep getting socket-timeout and connection resets at the
> client side. I am use httperf at the client side to simulate 5000
> connections at the rate of 400 requests per second. I can easily get IIS do
> this without any configuration changes to it.
>
> Any Suggestions ?

Do some more debugging.

Does the apache error log say anything interesting? What does the
server-status display look like under this load? Have you checked
other system logs for networking problems?

By the way, 1500 is way too high for Timeout. You probably want
Timeout set to well under 60 seconds.

Also, you haven't given any details about what version of apache, what
OS, what kind of content is being served, etc.

Joshua.

---------------------------------------------------------------------
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] Getting 5000 concurrent connections and 400 requests per second with Apache

Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Tue, Jul 24, 2007 at 08:48:40PM +0200, Torsten Foertsch wrote:
> Please forgive me the stupid question but I thought a port number is a 16 bit 
> integer. How can one get more than 64k connections to one IP address then?

There's no port exhaustion involved, TCP stacks distinguish between
sockets based on source-ip source-port tuple. The destination port
remainds the same. Only if you get 64k connections from the same
source-ip would there be a problem.

That said, in one of our variants - as a reverse proxy - we did hit this
problem and just started using multiple IP addresses.

> Can you provide any more direct pointers to the papers you refer?

I think the most recent online version is at;

	http://www.stdlib.net/~colmmacc/scaling-06.pdf

The main constrain is memory. Are you running out?

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

---------------------------------------------------------------------
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] Getting 5000 concurrent connections and 400 requests per second with Apache

Posted by Abhinav Bhagwat <ab...@gmail.com>.
Thanks everybody. The above article helped me to get my numbers :)

Regards,
Abhinav


On 7/25/07, Nick Kew <ni...@webthing.com> wrote:
>
> On Tue, 24 Jul 2007 21:34:20 +0200
> allan juul <al...@muly.dk> wrote:
>
> >
> http://www.stdlib.net/~colmmacc/Apachecon-EU2005/scaling-apache-handout.pdf
>
> Sounds promising, though ISTR his numbers were quite a lot higher the
> following year.  Colm is one of the main people I had in mind,
> the other being Brian Akins.
>
> --
> Nick Kew
>
> Application Development with Apache - the Apache Modules Book
> http://www.apachetutor.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
>
>


-- 
Regards,
Abhinav
--------------------------
Sent from my Google Mail account.

Re: [users@httpd] Getting 5000 concurrent connections and 400 requests per second with Apache

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 24 Jul 2007 21:34:20 +0200
allan juul <al...@muly.dk> wrote:

> http://www.stdlib.net/~colmmacc/Apachecon-EU2005/scaling-apache-handout.pdf

Sounds promising, though ISTR his numbers were quite a lot higher the
following year.  Colm is one of the main people I had in mind,
the other being Brian Akins.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.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] Getting 5000 concurrent connections and 400 requests per second with Apache

Posted by allan juul <al...@muly.dk>.
Torsten Foertsch wrote:
> Hi Nick,
> 
> On Tuesday 24 July 2007 20:10, Nick Kew wrote:
>> If necessary, read some of the ApacheCon papers from power-users
>> describing getting 100000 concurrent connections.
> 

> Can you provide any more direct pointers to the papers you refer?
> 
> Torsten

don't know if this is the one nick refered to :

http://www.stdlib.net/~colmmacc/Apachecon-EU2005/scaling-apache-handout.pdf

./allan


---------------------------------------------------------------------
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] Getting 5000 concurrent connections and 400 requests per second with Apache

Posted by Torsten Foertsch <to...@gmx.net>.
Hi Nick,

On Tuesday 24 July 2007 20:10, Nick Kew wrote:
> If necessary, read some of the ApacheCon papers from power-users
> describing getting 100000 concurrent connections.

Please forgive me the stupid question but I thought a port number is a 16 bit 
integer. How can one get more than 64k connections to one IP address then?

Or does this mean the machine has multiple addresses with a domain mapped to 
all of them?

Can you provide any more direct pointers to the papers you refer?

Torsten

Re: [users@httpd] Getting 5000 concurrent connections and 400 requests per second with Apache

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 24 Jul 2007 22:53:00 +0530
"Abhinav Bhagwat" <ab...@gmail.com> wrote:

> Hi All,
> 
> I want to connect 5000 clients simultaneously to apache. I have
> increased the ulimit and /etc/security/limits.conf limits. I have
> also modified the httpd.conf to serve MaxClients upto 10000 and
> increase the Timeout to 1500.

That's way too long.  1500 milliseconds would make more sense,
unless you serve particularly slow clients.

>	 The keepAlive is set to On as i need to
> send multiple requests on each connection.

High connection numbers + keepalive is the classic case for the
Event MPM.  That's new in 2.2.  Though it should also work with
Worker MPM.

If necessary, read some of the ApacheCon papers from power-users
describing getting 100000 concurrent connections.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.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