Consultor Eletrônico



Kbase P177625: What is the meaning of the Rq Duration in the AppServer broker query ?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   25/11/2010
Status: Unverified

GOAL:

What is the meaning of the Rq Duration in the AppServer broker query ?

GOAL:

How to interpret Request Duration provided with asbman -query command ?

GOAL:

Does Rq Duration includes execution time spent on the agent ?

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.x

FIX:

The Request Duration (Rq. duration) information that is provided by the AppServer broker query
represents the time that the broker spent servicing the client request. Depending on the AppServer
broker's operating mode this value may or may not include agent's procedure execution. The same client
request can result in different maximum and average times.


To better illustrate meaning of these values, the simple client and server procedure are shown :


/* asclient.p */
DEFINE VARIABLE hAs AS HANDLE NO-UNDO.
CREATE SERVER hAs.
/* Connect statement for Stateless, State-Reset and State-Aware broker operating mode */
hAS:CONNECT("-H localhost -S 5162 -AppService asbroker1 ").
/* Connect statement for the State-free broker operating mode - uncomment to use */
/* hAS:CONNECT("-H localhost -S 5162 -AppService asbroker1 -sessionModel Session-free"). */

RUN asexecpause1.p ON hAS.
hAS:DISCONNECT().

/* asexecpause1.p to be deployed on AppServer */
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DO i = 1 TO 3 :
PAUSE 1.
END.


The asbman -query results for 3 consecutive RUN executions of the asclient.p shows the following information:

Stateless
3 Run statements, 9 requests, Rq Duration (max, avg) 3000, 1000
State-reset, State-aware

3 Run statements, 3 requests, Rq Duration (max, avg) 1, 1
3 Run statements, 3 requests, Rq Duration (max, avg) 1, 1
State-free

3 Run statements, 6 requests, Rq Duration (max, avg) 3000, 1500

In the case of Stateless example, there have been 3 run statements executed by the client,
which is shown as 9 requests : 1 connect, 1 run and 1 disconnect request per each client execution.
Maximum request duration is 3000 milliseconds, which is exactly the time server procedure asexecpause1.p
takes to finish. Average time is shown as the maximum duration time divided by total number requests
per invocation, including connect and disconnect time which are actually sub-millisecond when client and the AppServer
execute on the same machine. As one invocation takes 3000 milliseconds, this value divided by 3 shows 1000.
Stateless operating mode causes that client remains connected all the time to the broker, so the execution
agent execution time is taken into account.

State-reset and State-aware operating mode have the same behavior in terms of the client
connection to the broker and to the dedicated agent. Each client invocation causes broker to
respond back to the client with the port number of designated agent. Therefore each asclient.p
execution will make one request to the brok.er. As the request consists of client asking broker
for an agent and broker immediate response with the agent's port number to the client, that
counts as a single request and in case client and the broker are on the same machine, the
Rq Duration shows millisecond time. Actual agent execution of the asexecpause1.p is not
taken into account as during that time the client is connected directly to the agent.

State-free shows similar Rq duration values as Stateless, although with 1 request less per
client invocation. Reason being that State-free does not maintain client connection so there
are 2 requests in effect: first one where client requests connection to the broker and the
second where the actual run is passed to the AppServer. Broker returns the execution status
and/or eventual output parameter values. In this case, average duration shows longer time
as the maximum request duration is same, but it is divided by 2 requests per invocation
(instead of 3 as with Stateless operating mode).

It is worth noting that WebSpeed broker behaves the same way as AppServer
State-reset or State-aware broker operating mode. Actual maximum duration time that
includes agent's procedure execution can be seen only with Stateless and State-free
AppServer operating mode.
.