users@glassfish.java.net

Re: how to setup loadbalancing on glassfish?

From: <glassfish_at_javadesktop.org>
Date: Sat, 26 Apr 2008 13:18:20 PDT

Hello,

Unfortunately I'm unable to send you this application. There are couple of reasons of that. Any way It will be difficult for you to deploy it up front. There are dependencies on third party commercial libraries. Thus there is a license issue too. Sorry for that.

I've done a mock application that reveals the same problem.
Use case is following:
A user point his browser to http://hostname/lbtest/test.html
then he clicks on "connect" button.
The Server's servlet replies "connected" then sends integer values from 0 to 9 every 2 seconds.
At deployment time you could change these defaults in web.xml. I make "count" and "sleep" to be servlet's parameters.
For your convenience along with deployable lbtest.war I send you a zip file that contains the eclipse project. After adjusting your project's build path and properties in build.xml you could package the application on your own.

In case of direct connection to Glassfish Application Server the browser displays a correct sequence:
"connected","0","1","2","3","4","5","6","7","8","9"
But if we go to Glassfish through Sun Java System Web Server by mean of the plugin the result is different. The browser displays only
"1","2","3","4","5","6","7","8","9"

The reason is the delay in delivery. Due to this fact the JSWS sends "connected","0","1" in the same packet and obviously a user can't even notice first two messages. He see only the third one. It's interesting that it happens only on first messages. Once the browser got a reply the delivery is as expected.

It will be nice to know what is a cause for such delay. In this case is at least 4 seconds.

thank you,
alexandre efremov
[Message sent by forum member 'aefremov' (aefremov)]

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