users@glassfish.java.net

Loadbalancer problems with Apache

From: <glassfish_at_javadesktop.org>
Date: Mon, 08 Oct 2007 05:08:43 PDT

I'm trying to use the Glassfish LB (mod_loadbalancer.so) with Apache. I'm encountering several problems and wondering whether anyone else has seen these - I can't find anything too likely on the Glassfish issues list. I've seen these issues with multiple versions of the aslb, even trying the very old version shipped in Sun's 8.2 Enterprise Edition (with the 8.2 appserver).

Firstly - any request to Apache will result in the loadbalancer sending requests to the app server http listeners. This is regardless of whether they're mapped in loadbalancer.xml or not. So a request to Apache which results in a 404 to the client will still open network connections to the backends. This is a particular problem to me as I have frontend h/w loadbalancers which send probes to an Apache tier, which results in requests being generated by mod_loadbalancer to the backends (which shouldn't happen ideally ...).

Secondly - I'm seeing a cascade effect of network connections with netstat. The first connection from Apache to the app servers will be established. It'll then go into TIME_WAIT, and another connection is initiated. This doesn't seem to increase in a linear fashion - the rate of new connections being created seems to increase almost exponentially. There is a ceiling however - for instance with one single http request (this was a 404 request as in my first point above), it maxes out at 14 connections for some reason. This state is maintained - established conns go to TIME_WAIT and others drop off - so it stays at 14 connections forever! This isn't very desirable and eventually results in the web server hosts running out of network resources.

I'm using Glassfish v2 final (b58g), various versions of the aslb (current aslb-9.1-MS4-b7), Apache 2.0.59 with patches or 2.0.61, Solaris 10 x86 frontend webservers, Windows Server 2003 R2 appservers (I know, odd choice of OS).

netstat -a from webserver:

10.0.1.28.59057 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59058 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59059 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59060 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59061 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59062 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59063 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59064 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59065 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59066 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59067 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59068 10.0.1.140.38080 65535 0 49640 0 TIME_WAIT
10.0.1.28.59069 10.0.1.140.38080 16384 0 49640 0 ESTABLISHED

One the appserver, I only see a max of two connections - one ESTABLISHED, and sometimes one in TIME_WAIT. Could this be a misconfig of http listener threads on the app server perhaps?
[Message sent by forum member 'ocoro02' (ocoro02)]

http://forums.java.net/jive/thread.jspa?messageID=238915