Usage statistics can
be requested for each client that accesses a server. These statistics
are useful for debugging and tuning server applications. Usage statistics
also enable you to charge users for the amount of server resources
that they consume. By default, the server writes a client's usage
statistics to the server log when the client disconnects from the
server. Here are some of the statistics that you can request:
Number of messages processed
shows the number of
messages (requests and replies) that a client exchanges with a server
in a single session.
shows the cumulative
number of bytes that are received from a client and that are sent
to a client in a single session.
shows the cumulative
elapsed time during which the server processed requests on behalf
of a client in a single session. Although this figure is not CPU time,
it is related to CPU time. Whereas CPU time for a specific operation
usually is relatively independent of other server usage, this figure
increases with an increased level of server activity. However, active
time should give a good indication of the CPU usage by the client
compared with other clients' values that are tracked during similar
levels of server activity. The active time value can exceed the elapsed
time value, especially in the server totals, because many server requests
can be active (therefore, they are being timed) concurrently.
Here are examples of
setting log usage:
proc server id=share1 log=message;
proc server id=share1 log=bytecount;
proc server id=share1 log=(message bytecount activetime elapsedtime);
proc server id=share1 log=all;
Here is an example of
a client log for all statistics:
Usage statistics for user mike(1):
Messages processed: 5,143
Bytes transferred: 10,578K
Active time: 1:47:23.6148
Elapsed time: 3:28:64.7386
To charge users for
the amount of server resources that they consume, allocate consumption
proportionately according to the usage statistics. You can allocate
consumption based on a single statistic or on a combination of statistics.
The most useful statistics for this purpose are the number of messages
that are processed, the number of bytes that are transferred, and
the amount of active time used.
You might need to experiment
with the relative weights of these statistics in your charge-back
formula. These statistics are sensitive to the specific operating
environment, access method, level of server activity, and types of
applications.
The number of messages
that are processed represents actual, billable work by the server.
When used together, the MESSAGE, BYTECOUNT, and ACTIVETIME values
in the LOG= option report data that characterizes the work that a
user asked the server to perform. Here are some examples:
-
Small BYTECOUNT and MESSAGE values
and a large ACTIVETIME value might indicate that a small amount of
data was selected from a large file by sequentially searching the
file or by interpreting a complex view.
-
Moderate or large BYTECOUNT values
and a large MESSAGE value might indicate that a small amount of data
is being read by the user on each message that is exchanged with the
server. This might be caused by random access or exceptionally long
observations and might suggest taking a snapshot of the data for the
user's analysis.
-
Small ACTIVETIME values and a large
BYTECOUNT value suggest that the user is exchanging data “in
bulk” with the server. Usually, that does not indicate a problem,
but if the server is overloaded, you might want to suggest that the
user try another bulk-data transfer technique.