Re: mod_jk fails to forward request on high traffic

2009-09-10 Thread John Cherouvim

Thanks guys, that seems to solve the problem.
I also tried Mark's DisableReuse and it works fine, but I reverted since 
the timeouts solution works well and looks better.


Another resource I used to get a better understanding of the issue was 
http://kbase.redhat.com/faq/docs/DOC-15866


Thanks again
Ioannis


André Warnier wrote:

John Cherouvim wrote:
...


Is there a possibility that there is a problem with the fact that I use:
IfModule mpm_prefork_module
   ...
  ServerLimit1024
  MaxClients 1024

and default Connector settings?
Connector port=8010 protocol=AJP/1.3 redirectPort=8443 
address=127.0.0.1 /


Do those 2 need to have the same thread count (MaxClients=maxThreads)?


I think you're on the right track there.
See the previous response from Mark :
...


My guess is that all of your Tomcat AJP threads are tied up with idle
httpd threads.


.. doing nothing.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




--
Ioannis Cherouvim
Software Engineer
mail: j...@eworx.gr
web: www.eworx.gr


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod_jk fails to forward request on high traffic

2009-09-08 Thread Mark Thomas
John Cherouvim wrote:
 Hello
 
 I have a website which during peak time (peak lasts around ~4 hours with
 14 pageviews/sec, 140 http requests/sec) starts to drop pageview requests.

My guess is that all of your Tomcat AJP threads are tied up with idle
httpd threads.

Try the following in your httpd.conf:
JkOptions +DisableReuse

Mark




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod_jk fails to forward request on high traffic

2009-09-08 Thread Rainer Jung
On 08.09.2009 17:49, Mark Thomas wrote:
 John Cherouvim wrote:
 Hello

 I have a website which during peak time (peak lasts around ~4 hours with
 14 pageviews/sec, 140 http requests/sec) starts to drop pageview requests.
 
 My guess is that all of your Tomcat AJP threads are tied up with idle
 httpd threads.
 
 Try the following in your httpd.conf:
 JkOptions +DisableReuse

... or read about the necessary timeouts on

http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod_jk fails to forward request on high traffic

2009-09-08 Thread John Cherouvim
Thanks for your reply. I'll try DisableReuse on the next peak, although 
I read in 
http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html that:
For this you set JkOptions +DisableReuse in your Apache httpd 
configuration. This will have a huge negative performance impact!


Is there a possibility that there is a problem with the fact that I use:
IfModule mpm_prefork_module
   ...
  ServerLimit1024
  MaxClients 1024

and default Connector settings?
Connector port=8010 protocol=AJP/1.3 redirectPort=8443 
address=127.0.0.1 /


Do those 2 need to have the same thread count (MaxClients=maxThreads)?

thanks
Ioannis

Mark Thomas wrote:

John Cherouvim wrote:
  

Hello

I have a website which during peak time (peak lasts around ~4 hours with
14 pageviews/sec, 140 http requests/sec) starts to drop pageview requests.



My guess is that all of your Tomcat AJP threads are tied up with idle
httpd threads.

Try the following in your httpd.conf:
JkOptions +DisableReuse

Mark




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

  



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod_jk fails to forward request on high traffic

2009-09-08 Thread Mark Thomas
John Cherouvim wrote:
 Thanks for your reply. I'll try DisableReuse on the next peak, although
 I read in
 http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html that:
 For this you set JkOptions +DisableReuse in your Apache httpd
 configuration. This will have a huge negative performance impact!
 
 Is there a possibility that there is a problem with the fact that I use:
 IfModule mpm_prefork_module
...
   ServerLimit1024
   MaxClients 1024
 
 and default Connector settings?
 Connector port=8010 protocol=AJP/1.3 redirectPort=8443
 address=127.0.0.1 /
 
 Do those 2 need to have the same thread count (MaxClients=maxThreads)?

There is no one right answer. The best way to do this will vary from
case to case. DisableReuse is usually easier to set up than getting the
timeouts and thread pool sizes correct. As long as httpd and Tomcat are
on a fast local network, performance is very rarely an issue.

Mark

 
 thanks
 Ioannis
 
 Mark Thomas wrote:
 John Cherouvim wrote:
  
 Hello

 I have a website which during peak time (peak lasts around ~4 hours with
 14 pageviews/sec, 140 http requests/sec) starts to drop pageview
 requests.
 

 My guess is that all of your Tomcat AJP threads are tied up with idle
 httpd threads.

 Try the following in your httpd.conf:
 JkOptions +DisableReuse

 Mark




 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

   
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod_jk fails to forward request on high traffic

2009-09-08 Thread André Warnier

Rainer Jung wrote:

On 08.09.2009 17:49, Mark Thomas wrote:

John Cherouvim wrote:

Hello

I have a website which during peak time (peak lasts around ~4 hours with
14 pageviews/sec, 140 http requests/sec) starts to drop pageview requests.

My guess is that all of your Tomcat AJP threads are tied up with idle
httpd threads.

Try the following in your httpd.conf:
JkOptions +DisableReuse


... or read about the necessary timeouts on

http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html

Or start a lot more threads on that AJP Connector, since you have a lot 
of spare everything on that machine.
And if these are a lot of small requests by many separate clients, you 
may want to reduce your Apache KeepAliveTimeout to 4, then 3,..


The idea is :
- a browser connects to Apache and issues a request
- Apache is passing this request to one free Apache child
- this child sees that the request is for mod_jk (and, in the 
background, Tomcat)

- so one instance of an Apache child and mod_jk is now busy
- mod_jk connects to Tomcat
- to handle the request, the Tomcat Connector allocates one Tomcat 
thread (possibly starting a new one)

- the thread works and returns the response to mod_jk
- mod_jk returns the response to the Apache child
- the Apache child returns the response to the browser

but...

since the connection is keep-alive, if the same browser does not, on 
the same connection, issue any more requests, then the Apache child 
anyway waits on that connection for the duration of the 
KeepAliveTimeout.  Only when the timeout expires without new request, 
does the child close the connection and return itself to the available 
child pool.
So if the request takes 100 milliseconds to fulfill, and your 
KeepAliveTimeout is 5000 milliseconds, your Apache children sit there 
doing nothing (and being unavailable for other browsers requests) for :

(5000 ms + 100 ms) =  5100 ms = total time
of which
100 ms = time to actually fulfill request
thus
100 ms / 5100 ms = 0.0196.. = 1.9 % productive
and
100 - 1.96 = 98.04 % unproductive
during which time they probably hold on to their mod_jk connection to 
Tomcat also, and thus there is also a Tomcat thread waiting, and doing 
nothing for the same unproductive time, and not being available for 
other clients and requests.


This is a horror scenario and, probably, in reality things are not so 
bad, depending on how your pages are and how smart all these little 
Apache/mod_jk/Tomcat pieces are.

But maybe worth thinking about anyway ?




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod_jk fails to forward request on high traffic

2009-09-08 Thread André Warnier

John Cherouvim wrote:
...


Is there a possibility that there is a problem with the fact that I use:
IfModule mpm_prefork_module
   ...
  ServerLimit1024
  MaxClients 1024

and default Connector settings?
Connector port=8010 protocol=AJP/1.3 redirectPort=8443 
address=127.0.0.1 /


Do those 2 need to have the same thread count (MaxClients=maxThreads)?


I think you're on the right track there.
See the previous response from Mark :
...


My guess is that all of your Tomcat AJP threads are tied up with idle
httpd threads.


.. doing nothing.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org