Package for the Analysis and Graphing of the throughput and queue lengths of SiteMinder requests at the policy server.

Document ID : KB000051286
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

The attached scripts will set the stats function to occur at a regular period, then using the logs generated extract the statistics data and manipulate it into a format that can be loaded into the attached Excel spreadsheets to give a graph of throughput numbers of connections and queue depths.

Solution:

Overview:

For Siteminder 6.0 on Solaris Systems you can run the command:

$smpolicysrv -stats

Which results in the following style of output:

 [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3585][INFO] 
===================================================================================
[2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3586][INFO] System Statistics [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3603][INFO] Thread pool limit: 8 [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3623][INFO] Thread pool: Msgs=0 Waits= 0 Misses= 0 PriorityRatio= 0 Max HP Msg= 0 Max
NP Msg= 0 Current Depth= 0 Max Depth= 0 Current High Depth= 0 Current Norm Depth= 0 Current Threads= 1 Max Threads= 1 [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3631][INFO] Connections: Current=0 Max= 0 Limit=256 Exceeded limit= 0 [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3634][INFO]

Spread throughout the smps.log trace file. This document describes how you can regularly generate those statistics and how to extract them to produce the following graphs, giving a good picture of how your server is performing, and if there are any trouble spots:

Figure 1

Figure 2

Background:

For Siteminder 6.0 on Solaris Systems you can run the command :

     $smpolicysrv -stats  

Which results in the following style of output:

 [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3585][INFO] 
 ===================================================================================
 [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3586][INFO] System Statistics
 [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3603][INFO] Thread pool limit: 8
 [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3623][INFO] Thread pool: Msgs=0 Waits= 0 Misses= 0 PriorityRatio= 0 Max HP Msg= 0 Max 
NP Msg= 0 Current Depth= 0 Max Depth= 0 Current High Depth= 0 Current Norm Depth= 0 Current Threads= 1 Max Threads= 1 [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3631][INFO] Connections: Current=0 Max= 0 Limit=256 Exceeded limit= 0 [2844/1652][Thu Feb 14 2008 13:04:06][CServer.cpp:3634][INFO]

[CServer.cpp:3603][INFO] Thread Pool

     Thread pool limit: 8 

Thread pool limit is the configured maximum number of threads set in the registry for this service. Two more threads than the maximum can be spawned if no threads are available to handle handshake requests, and will remain afterwards to handle regular requests as well as handshakes if needed.

[CServer.cpp:3623][INFO] Thread Pool
Msgs=0
Waits= 0
Misses= 0
Msgs = # of times a message was removed from the queue
Waits = # of times Dequeue had to wait for a message
Misses = # of times waiting thread woke up to find no message
Msgs, Waits, and Misses are thread-level values deal with threads that are waiting or threads that wake up to find that the request is being serviced by a different thread. Waits and Misses by themselves do not indicate any problems occurring and don't need to be worried about.

Max HP Msg= 0
Max NP Msg= 0
Max HP Msg gives the information about the maximum number of high priority messages available on the message queue.
Max NP Msg gives the information about the maximum number of normal priority messages available on the message queue.

Current Depth= 0
Max Depth= 0
Current Depth is the current queue request depth for this Policy Server, Max Depth is the maximum queue depth for this Policy Server service since the service was last started.

Current Threads= 1
Max Threads= 1

Current Threads is the current number of thread pool threads for this Policy Server service. Max Threads is the highest number of threads ever in use at once since the service was last started. If more threads are required after Max threads, policy server can open two more threads than max value. That is why Max Threads can go up by 2 more than Thread Pool Limit.

[CServer.cpp:3631][INFO] Connections:

Current=0
Max= 0
Limit=256
Exceeded limit= 0

Current is the number of agent connections currently attached to the Policy Server service. Max is the maximum number ever attached at once to the service. Limit is the MaxSockets value configured for the service (maximum number of agent connections allowed at once).

Exceeded limit notes if the Limit has been reached and further agent connections have been attempted (the connections attempted past the limit will be rejected, and the Policy Server will throw the error "Too many server threads").

Generating Statistics regularly:

Using the batch file provided in the scripts/dos_appendstats.cmd it will perform a stats command every 10min, this can be setup in as a schedule job, and uses a DOS ping trick to introduce a delay (since DOS for some reason forgot to have a sleep command).

The same procedure can be easily set up using crontab in a unix system.

The purpose for analysis is to produce a stats call of the format:

    $smpolicysrv -stats  

on a regular basis.

Extracting the Data:

With the smps.log files produced run the script file:

    $extractPSTraceStats.py smps*.log  

to extract the statistics information which then places the raw data into three .csv files.

File Name Description
smps_rawstats.logRaw log of just the statistics
smps_stats_connections.csvConnection information in csv format
smps_stats_threads.csvThread information in csv format

Graphing the Results:

From the package open the .xls or .ods file, and then cut and paste the connection infrmation into the column on the connection tab and do the same to the threads tab. You should then have the following graphs available to you:

Figure 3

Figure 4

File Attachments:
TEC529612.zip