Application Server Solutions for Microsoft IIS and ASP.NET
       solutions   products   partners   company   support   downloads         store
JTurbo Self-Help: FAQ
Back to Search >  Back to Search Results

Faq ID 359
Product ServletExec
Category Installation
Question When using multiple SE AS Instances, response time is very slow. What's wrong?
Answer This FAQ applies to SE 5.x and higher.
To fully understand and diagnose this issue, it's helpful to first understand some basics about how the SE AS native adapter (which "hooks into" the web server software), and SE AS Instance(s) communicate with each other.
  1. The adapter reads in a file named webadapter.properties which tells the adapter about the various SE AS instances (ASI's) that are available.
  2. The adapter attempts to communicate with each ASI listed in that file in order to learn the rules for routing requests (which requests should be routed to which ASI's).
  3. Any ASI is that not running, or otherwise unreachable can cause significant response-time delays.
You can alter the behavior of the adapter by using the multiInstanceMode global property, so that the adapter is less effected by this condition and so the delay is no longer a problem.
Here is some useful information about the aliasCheckInterval global property:

servletexec.aliasCheckInterval

The default value is 10 (measured in seconds). Setting it to -1 turns it off, so that there is no request-time polling. An example of using this property in webadapter.properties is: servletexec.aliasCheckInterval=20 This global property governs how often the adapter will ping/query the SE AS instances (ASIs) that are defined in that file, to ask them if there are any changes to the aliases (webapp context paths, uri mappings for security, filters, servlets, etc...). The adapter stores a local copy of such mappings in what is referred to as an Alias Cache (1 alias cache per ASI) and periodically attempts to update that cache (at request time) if warranted. If an ASI is not running and the adapter tries to ping/query it, there may be a timeout delay before the socket knows that there is nothing at the other end to respond to the ping/query. This is usually 1 second, but may differ depending on OS, and other factors. If there are several ASI's that are not running or are otherwise unreachable then the delay is increased proportionally (1 second delay for each ASI that's down). This situation can be avoided by enabling the multiInstanceMode property (see below).
For additional details about the aliasCheckInterval property, please see SE FAQ #259

Now you have enough information to better understand the multiInstanceMode global property:
servletexec.multiInstanceMode

The default value is disabled. An example of using this property in webadapter.properties is: servletexec.multiInstanceMode=enabled Enabling multi-instance mode will cause the adapter to:
  • only ping an unresponsive ASI every aliasCheckInterval seconds (rather than continually trying to ping it on every request in an attempt to update its outdated/expired alias cache).
  • clear the in-memory alias cache for any ASI that becomes unresponsive. This provides better support for using SE in a failover/clustered environment. It allows the request to "filter down" to the other ASI's or the webserver itself rather than giving Failed To Connect to ServletExec messages over and over. Just be aware that you may get 404 Not Found responses in this case. To confirm that your adapter is running in multi-instance mode, look for the presence of the following line in your adapter's startup messages: This adapter will run with multi-instance optimizations.

 

And one way to test just how quickly responses are being rendered on the server would be to request a simple JSP which simulates sending back some data, and times itself too. For example a JSP that contains only this:


<%@ page import="java.util.*, java.math.*" %>

<%
 long startTime = System.currentTimeMillis();
 Date date_now  = new Date(startTime);
%>

<html>
<p>
Page Execution started at: <%=date_now%>.
<br>
<br>
Below there will be generated 100,000 characters in order to emulate sending about 0.1M of data.
<hr>
<%
  for (int i = 0; i < 100000; i++) {
    BigInteger I = new BigInteger("" + i);
    if (I.remainder(new BigInteger("" + 100)).intValue() == 0) {
      out.println("<br>");
    }
    out.print("a");
  }
%>
<hr>

<%
 long endTime = System.currentTimeMillis();
 date_now = new Date(endTime);
%>
</p>

<p>
Page Execution ended at: <%=date_now%>.
<br>

This page took about <%=endTime - startTime%> milliseconds to execute on the server.
</p>
</html>



   
company media information terms of use privacy policy contact us