tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: modjk apache response questions
Date Mon, 02 May 2011 08:22:12 GMT
Harsimranjit singh Kler wrote:
> Hi
> Yes , it seems wrong configuration .New one is:
> worker.list=balancer
> #For tomcat 1
> worker.worker1.type=ajp13
> worker.worker1.port=8009
> worker.worker1.lbfactor=1
>  #For tomcat 2
> worker2.worker2.type=ajp13
> worker.worker2.port=8010
> worker.worker2.lbfactor=1
> #For tomcat 3
> worker.worker3.type=ajp13
> worker.worker3.port=8011
> worker.worker3.lbfactor=1
> worker.balancer.type=lb
> worker.balancer.balance_workers=worker1,worker2,worker3
> worker.balancer.sticky_session=1
>  Is this fine Now?
> One more thing i observe .When i changing with  with maxthreads.Httpd status
> following o/p
> Apache Server Status for  Server Version: Apache/2.2.17 (Unix) DAV/2
> mod_jk/1.2.30 Server Built: Apr 19 2011 08:35:28
> ------------------------------
>  Current Time: Tuesday, 03-May-2011 02:13:57 IST Restart Time: Tuesday,
> 03-May-2011 01:56:50 IST Parent Server Generation: 0 Server uptime: 17
> minutes 7 seconds Total accesses: 16534 - Total Traffic: 7.2 MB CPU Usage:
> u3.4 s1.79 cu0 cs0 - .505% CPU load 16.1 requests/sec - 7.2 kB/second - 459
> B/request 1 requests currently being processed, 499 idle workers
> .
> .
>  501 requests currently being processed, 149 idle workers
> Why always 501 requests processed??.i mean if i increase number of
> concurrent requests on apache loadbalancer this value never increses beyond
> 500?
> 149 (i.e idle worker increses)change if i increase maxspareThreads from
> worker MPM configurations.

I am not really familiar with the Apache "worker MPM" and its exact ramifications in the 
way that mod_jk handles the number of connections to Tomcat.
So I don't know.
But the limit of 500 requests being processed, looks suspiciously the same as the 
maxThreads value of /one/ Tomcat.
So maybe it is not really balancing the load, but sending it all to one Tomcat only.
This may have something to do with the following setting :

 > worker.balancer.sticky_session=1

and with the way in which your test application is working (with regard to sessions).
You say that you are issuing 4 requests in sequence.  Are those requests part of a session

at the Tomcat level ? Does your test tool take this into account ?

I think you should really (re-)read this page :
and this page :
(see in particular "connection_pool_size")

and use logic to determine what may be happening.

Also, for us to really help you, there are too many unknowns in your test setup (for 
example, we do not know your test application).

To eat an elephant, do it a little bit at a time (African proverb).

So let me suggest the following plan, to simplify the analysis :

1) at the Tomcat level, create one static html page inside your webapp
(for example : tomcat_dir/webapps/my-webapp/test.html)
2) /from another server/, use the Apache "ab" program (*) to issue a number of test 
requests to the front-end load-balancer, for this static page
3) note the settings and the results
4) re-do the same test with other settings, changing one setting at a time

If you see the same behaviour as with your own test application, then indeed there is 
something strange going on, worthy of more analysis.
If you do not see the same behaviour, then you know that what you are seeing has something

to do with your test application.  Then you need to figure out what is different between 
your test application, and a standard request for a static page.

(*) see :
Example test :
/usr/sbin/ab -n 150 -c 50 ""
(to issue a total of 150 requests, with 50 in parallel; in other words, 50 ab instances 
will issue 3 requests each)
and then change gradually to
/usr/sbin/ab -n 3000 -c 1000 ""
(to issue a total of 3000 requests, with 1000 in parallel; in other words, 1000 ab 
instances will issue 3 requests each)

Run this from another server, so that running "ab" itself does not interfere with the 
resources of your load-balancer and tomcat hosts.

> why no error logs if something wrong configured in worker.properities?

1) unknown directives are just being ignored.  Maybe if you set the log level very high 
(e.g. debug) it will print a warning.
2) the 2 directives
were not illegal. They just add up, so you end up with a worker list containing 
on the other hand, you had
So you ended up with worker1 in both lists : the non-balanced list of mod_jk itself (2 
workers : worker1 and balancer); and the internal list of the balancer worker.  That was 
inconsistent and may be the cause for the strange behaviour you were seeing.

> On Wed, Apr 27, 2011 at 8:57 PM, Harsimranjit singh Kler <
>> wrote:
>> Hi
>>  I  need some observations on loadbalancer with mod jk, such as
>> How to check  utilization of each httpd workers? How to check what is the
>> number of connections active on the each separate
>> Tomcats when there is load?.How i can increase response time?AJP port
>> should unique in worker.properities?
>> Whenever i am increasing concurrent requests on LB response time decreases?
>> Using apache 2.2.17+modjk1.2.31+tomcat 5.5.27
>> regards
>> harsimran

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message