You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rob Kirkbride <ro...@gmail.com> on 2007/06/17 16:17:13 UTC

mod_jk 1.2.23 not load balancing correctly?

Hi,

We've added a 4th application server to our farm and since then I've noticed
it's not load balancing equally across all our nodes at all.

Each of the app servers has a lbfactor of 1 and we're using the default
request strategy. I've copied the jkstatus page. I can see that app101 is
handling around ten times as many requests as the other servers.

  [E|R]  app101 ajp13 10.100.3.122:8009 10.100.3.122:8009 ACT OK   0 1 1 915
2033 0   1  1.7M 51M  0    9   app101       0/0
   [E|R]  app102 ajp13 10.100.5.111:8009 10.100.5.111:8009 ACT OK   0 1 1
98  230  0   0  197K 5.8M 0    2   app102       0/0
   [E|R]  app103 ajp13 10.100.5.113:8009 10.100.5.113:8009 ACT OK   0 1 1
101 227  0   0  187K 5.3M 0    3   app103       0/0
   [E|R]  app104 ajp13 10.100.5.114:8009 10.100.5.114:8009 ACT OK   0 1 1
96  216  0   0  232K 1.1M 0    5   app104       0/0

The app servers themselves seem quite happy so I'm not sure why it might be
doing this.

Has anyone got any ideas - I don't particularly want to start changing the
balancing strategy/values on a live server without some though.

Thanks,

Rob Kirkbride

Re: mod_jk 1.2.23 not load balancing correctly?

Posted by Mladen Turk <ml...@gmail.com>.
Rob Kirkbride wrote:
> Just to close this down the problem was traced to having the same server
> name in the jvmRoute in the server.xml in JBoss.
> 
> The load balancer is now behaving correctly.
> 
> Sorry to waste your time!
>

Not at all. You actually gave us a valuable information
that will probably help many others.
Thanks for bringing the resolution back in.
This is exactly what a community is and should be!

Regards,
Mladen.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: mod_jk 1.2.23 not load balancing correctly?

Posted by Rob Kirkbride <ro...@gmail.com>.
Just to close this down the problem was traced to having the same server
name in the jvmRoute in the server.xml in JBoss.

The load balancer is now behaving correctly.

Sorry to waste your time!

Rob

On 17/06/07, Rob Kirkbride <ro...@gmail.com> wrote:
>
> Hi Rainer,
>
> We're using the stock Apache 2.0 with RHEL4 on a x86 architecture.
> Obviously I've built mod_jk from source.
>
> Thanks for the detail - I'll see about adding the logs as you suggested.
> The strange thing is that with 3 app servers it has been load balancing
> very evenly for the last 10 months quite happily. Basically the introduction
> of the 4th app server has changed the figures.
>
> This is the thing that leads me to believe it could be a fault in the code
> - literally I've changed nothing else about the app/configuration apart from
> the extra lines in the workers.properties to add the 4th app server.
>
> Rob
>
> On 17/06/07, Rainer Jung <ra...@kippdata.de> wrote:
> >
> > Hi Rob,
> >
> > at the moment there is no known problem with the balancing. I expect you
> > checked your mod_jk log file for errors.
> >
> > What's your platform and what's your web server?
> >
> > Since your request counts in the status display are still relatively
> > small, it looks like you get the unequal distribution pretty soon.
> > You've got no backend errors, so we could only speculate, if there are
> > few heavy weight sessions only hitting app101.
> >
> > You could get a better impression about what's going on, by adding some
> > fields to you Apache LogFormat. See:
> >
> > http://tomcat.apache.org/connectors-doc/reference/apache.html
> >
> > There we have for example:
> >
> > LogFormat "%h %l %u %t \"%r\" %>s %b \
> > %{JK_LB_FIRST_NAME}n %{JK_LB_LAST_NAME}n %{JK_LB_LAST_ACCESSED}n" \
> > extended
> >
> > and then use "extended" as the name of the log format in your CustomLog
> > directive.
> >
> > If you use Cookies for your sessions (and not URL encoded sessions), you
> > should also add %{JSESSIONID}C to the format, which will log the id of
> > the request. Finally you might like to add "%P %{tid}P" which shows the
> > pid and thread id of the apache process handling the request.
> >
> > Those together help in finding out when and maybe why the balancing
> > mapped request unequally to the app servers.
> >
> > If you need to post more exceprts from the status page, you could use
> > the additional parameters "mime=xml" (or =txt / ?prop) to get more mail
> > friendly formats.
> >
> > Regards,
> >
> > Rainer
> >
> > Rob Kirkbride schrieb:
> > > Hi,
> > >
> > > We've added a 4th application server to our farm and since then I've
> > > noticed
> > > it's not load balancing equally across all our nodes at all.
> > >
> > > Each of the app servers has a lbfactor of 1 and we're using the
> > default
> > > request strategy. I've copied the jkstatus page. I can see that app101
> > is
> > > handling around ten times as many requests as the other servers.
> > >
> > >  [E|R]  app101 ajp13 10.100.3.122:8009 10.100.3.122:8009 ACT OK   0 1
> > 1 915
> > > 2033 0   1  1.7M 51M  0    9   app101       0/0
> > >   [E|R]  app102 ajp13 10.100.5.111:8009 10.100.5.111:8009 ACT OK   0 1
> > 1
> > > 98  230  0   0  197K 5.8M 0    2   app102       0/0
> > >   [E|R]  app103 ajp13 10.100.5.113:8009 10.100.5.113:8009 ACT OK   0 1
> > 1
> > > 101 227  0   0  187K 5.3M 0    3   app103       0/0
> > >   [E|R]  app104 ajp13 10.100.5.114:8009 10.100.5.114:8009 ACT OK   0 1
> > 1
> > > 96  216  0   0  232K 1.1M 0    5   app104       0/0
> > >
> > > The app servers themselves seem quite happy so I'm not sure why it
> > might be
> > > doing this.
> > >
> > > Has anyone got any ideas - I don't particularly want to start changing
> > the
> > > balancing strategy/values on a live server without some though.
> > >
> > > Thanks,
> > >
> > > Rob Kirkbride
> > >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>

Re: mod_jk 1.2.23 not load balancing correctly?

Posted by Rob Kirkbride <ro...@gmail.com>.
Hi Rainer,

We're using the stock Apache 2.0 with RHEL4 on a x86 architecture. Obviously
I've built mod_jk from source.

Thanks for the detail - I'll see about adding the logs as you suggested.
The strange thing is that with 3 app servers it has been load balancing very
evenly for the last 10 months quite happily. Basically the introduction of
the 4th app server has changed the figures.

This is the thing that leads me to believe it could be a fault in the code -
literally I've changed nothing else about the app/configuration apart from
the extra lines in the workers.properties to add the 4th app server.

Rob

On 17/06/07, Rainer Jung <ra...@kippdata.de> wrote:
>
> Hi Rob,
>
> at the moment there is no known problem with the balancing. I expect you
> checked your mod_jk log file for errors.
>
> What's your platform and what's your web server?
>
> Since your request counts in the status display are still relatively
> small, it looks like you get the unequal distribution pretty soon.
> You've got no backend errors, so we could only speculate, if there are
> few heavy weight sessions only hitting app101.
>
> You could get a better impression about what's going on, by adding some
> fields to you Apache LogFormat. See:
>
> http://tomcat.apache.org/connectors-doc/reference/apache.html
>
> There we have for example:
>
> LogFormat "%h %l %u %t \"%r\" %>s %b \
> %{JK_LB_FIRST_NAME}n %{JK_LB_LAST_NAME}n %{JK_LB_LAST_ACCESSED}n" \
> extended
>
> and then use "extended" as the name of the log format in your CustomLog
> directive.
>
> If you use Cookies for your sessions (and not URL encoded sessions), you
> should also add %{JSESSIONID}C to the format, which will log the id of
> the request. Finally you might like to add "%P %{tid}P" which shows the
> pid and thread id of the apache process handling the request.
>
> Those together help in finding out when and maybe why the balancing
> mapped request unequally to the app servers.
>
> If you need to post more exceprts from the status page, you could use
> the additional parameters "mime=xml" (or =txt / ?prop) to get more mail
> friendly formats.
>
> Regards,
>
> Rainer
>
> Rob Kirkbride schrieb:
> > Hi,
> >
> > We've added a 4th application server to our farm and since then I've
> > noticed
> > it's not load balancing equally across all our nodes at all.
> >
> > Each of the app servers has a lbfactor of 1 and we're using the default
> > request strategy. I've copied the jkstatus page. I can see that app101
> is
> > handling around ten times as many requests as the other servers.
> >
> >  [E|R]  app101 ajp13 10.100.3.122:8009 10.100.3.122:8009 ACT OK   0 1 1
> 915
> > 2033 0   1  1.7M 51M  0    9   app101       0/0
> >   [E|R]  app102 ajp13 10.100.5.111:8009 10.100.5.111:8009 ACT OK   0 1 1
> > 98  230  0   0  197K 5.8M 0    2   app102       0/0
> >   [E|R]  app103 ajp13 10.100.5.113:8009 10.100.5.113:8009 ACT OK   0 1 1
> > 101 227  0   0  187K 5.3M 0    3   app103       0/0
> >   [E|R]  app104 ajp13 10.100.5.114:8009 10.100.5.114:8009 ACT OK   0 1 1
> > 96  216  0   0  232K 1.1M 0    5   app104       0/0
> >
> > The app servers themselves seem quite happy so I'm not sure why it might
> be
> > doing this.
> >
> > Has anyone got any ideas - I don't particularly want to start changing
> the
> > balancing strategy/values on a live server without some though.
> >
> > Thanks,
> >
> > Rob Kirkbride
> >
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: mod_jk 1.2.23 not load balancing correctly?

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Rob,

at the moment there is no known problem with the balancing. I expect you
checked your mod_jk log file for errors.

What's your platform and what's your web server?

Since your request counts in the status display are still relatively
small, it looks like you get the unequal distribution pretty soon.
You've got no backend errors, so we could only speculate, if there are
few heavy weight sessions only hitting app101.

You could get a better impression about what's going on, by adding some
fields to you Apache LogFormat. See:

http://tomcat.apache.org/connectors-doc/reference/apache.html

There we have for example:

LogFormat "%h %l %u %t \"%r\" %>s %b \
%{JK_LB_FIRST_NAME}n %{JK_LB_LAST_NAME}n %{JK_LB_LAST_ACCESSED}n" \
extended

and then use "extended" as the name of the log format in your CustomLog
directive.

If you use Cookies for your sessions (and not URL encoded sessions), you
should also add %{JSESSIONID}C to the format, which will log the id of
the request. Finally you might like to add "%P %{tid}P" which shows the
pid and thread id of the apache process handling the request.

Those together help in finding out when and maybe why the balancing
mapped request unequally to the app servers.

If you need to post more exceprts from the status page, you could use
the additional parameters "mime=xml" (or =txt / ?prop) to get more mail
friendly formats.

Regards,

Rainer

Rob Kirkbride schrieb:
> Hi,
> 
> We've added a 4th application server to our farm and since then I've
> noticed
> it's not load balancing equally across all our nodes at all.
> 
> Each of the app servers has a lbfactor of 1 and we're using the default
> request strategy. I've copied the jkstatus page. I can see that app101 is
> handling around ten times as many requests as the other servers.
> 
>  [E|R]  app101 ajp13 10.100.3.122:8009 10.100.3.122:8009 ACT OK   0 1 1 915
> 2033 0   1  1.7M 51M  0    9   app101       0/0
>   [E|R]  app102 ajp13 10.100.5.111:8009 10.100.5.111:8009 ACT OK   0 1 1
> 98  230  0   0  197K 5.8M 0    2   app102       0/0
>   [E|R]  app103 ajp13 10.100.5.113:8009 10.100.5.113:8009 ACT OK   0 1 1
> 101 227  0   0  187K 5.3M 0    3   app103       0/0
>   [E|R]  app104 ajp13 10.100.5.114:8009 10.100.5.114:8009 ACT OK   0 1 1
> 96  216  0   0  232K 1.1M 0    5   app104       0/0
> 
> The app servers themselves seem quite happy so I'm not sure why it might be
> doing this.
> 
> Has anyone got any ideas - I don't particularly want to start changing the
> balancing strategy/values on a live server without some though.
> 
> Thanks,
> 
> Rob Kirkbride
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org