anu shaji
anu shaji

Reputation: 39

If request sent through jmeter, in glassfish clustering requests are not segregating to different servers

For the application server set as clustering in glass fish. I have sent request through jmeter and all the requests hits to only one server . Expected was requests should be distributed to multiple servers in the cluster. But if sent requests manually clustering is working. Please help to sort out this issue

Upvotes: 0

Views: 119

Answers (1)

Dmitri T
Dmitri T

Reputation: 167992

There could be different clustering load balancing mechanisms, as far as I can see from the GlassFish Server High Availability Administration Guide:

  • Cookie Method

    The Loadbalancer Plug-In uses a separate cookie to record the route information. The HTTP client (typically, the web browser) must support cookies to use the cookie based method. If the HTTP client is unable to accept cookies, the plug-in uses the following method.

  • Explicit URL Rewriting

    The sticky information is appended to the URL. This method works even if the HTTP client does not support cookies. To implement explicit URL rewriting, the application developer must use HttpResponse.encodeURL() and encodeRedirectURL() calls to ensure that any URLs in the application have the session information appended to them.

So depending on your Load Balancer configuration you need to

  1. Either define either different cookies in the HTTP Cookie Manager
  2. Or make sure different threads send requests to different URLs i.e. via HTTP URL Re-writing Modifier
  3. In any case it is recommended to add DNS Cache Manager so each virtual user would resolve the underlying IP address of the application under test on its own.

Upvotes: 0

Related Questions