Sun Java System Web Server 6.1 SP9 Performance Tuning, Sizing, and Scaling Guide

Monitoring Server Performance

Making the adjustments described in this guide without measuring their effects does not make sense. If you don’t measure the system’s behavior before and after making a change, you won’t know whether the change was a good idea, a bad idea, or merely irrelevant. You can monitor the performance of Sun Java System Web Server in several different ways, as discussed in the following topics:

For more information about monitoring server performance, see General Tuning TipsSolaris-specific Performance Monitoring

Monitoring Current Activity Using the Server Manager

You can monitor many performance statistics through the Server Manager user interface, and through stats-xml. Once statistics are activated, you can monitor the following areas:

Activating Statistics

You must activate statistics on Sun Java System Web Server before you can monitor performance. This can be done through the Server Manager, or by editing the obj.conf and magnus.conf files.


Caution – Caution –

When you activate statistics/profiling, statistics information is made available to any user of your server.


Activating Statistics from the Server Manager

You can activate statistics from the user interface.

ProcedureTo activate statistics from the user interface

  1. From the Server Manager, click the Monitor tab, and then click Monitor Current Activity.

    The Enable Statistics/profiling page appears.

  2. Select Yes to activate Statistics/Profiling.

  3. Click OK, click Apply, and then click the Apply Changes button to activate Statistics/Profiling.

Activating Statistics with stats-xml

You can also activate statistics directly by editing the obj.conf and magnus.conf files. Users who create automated tools or write customized programs for monitoring and tuning may prefer to work directly with stats-xml.

ProcedureTo activate statistics using stats-xml

  1. Under the default object in obj.conf, add the following line:

    NameTrans fn="assign-name" from="/stats-xml/*" name="stats-xml"

  2. Add the following Service function to obj.conf:

    <Object name="stats-xml"> Service fn="stats-xml" </Object>

  3. Add the stats-init SAF to magnus.conf.

    Here's an example of stats-init in magnus.conf:

    Init fn="stats-init" update-interval="5" virtual-servers="2000" profiling="yes"

    The above example shows you can also designate the following:

    • update-interval. The period in seconds between statistics updates. A higher setting (less frequent) will be better for performance. The minimum value is 1; the default value is 5.

    • virtual-servers. The maximum number of virtual servers for which you track statistics. This number should be set equal to or higher than the number of virtual servers configured. Smaller numbers result in lower memory usage. The minimum value is 1; the default is 1000.

    • profiling. Activate NSAPI performance profiling. The default is "no," which results in slightly better server performance. However, if you activate statistics through the user interface, profiling is turned on by default.

Monitoring Statistics

Once you’ve activated statistics, you can get a variety of information on how your server instance and your virtual servers are running. The statistics are broken up into functional areas.

ProcedureTo monitor statistics from the Server Manager

  1. From the Server Manager, click the Monitor tab, and then click Monitor Current Activity.

  2. To ensure that statistics/profiling is activated ("Yes" is selected and applied for "Activate Statistics/Profiling?").

  3. From the drop-down list, select a refresh interval.

    This is the interval, in seconds, that updated statistics will be displayed on your browser.

  4. From the drop-down list, select the type of web server statistics to display.

  5. Click Submit.

    A page appears displaying the type of statistics you selected. The page is updated every 5-15 seconds, depending on the refresh interval. All pages will display a bar graph of activity, except for Connections.

  6. Select the process ID from the drop-down list.

    You can view the current activity through the Server Manager, but these categories are not fully relevant for tuning your server. The perfdump statistics is recommended for tuning your server. For more information, see Using Statistics to Tune Your Server

Virtual Server Statistics

Virtual server statistics can be viewed from the Server Manager. You can choose to display statistics for the server instance, for an individual virtual server, or for all. This information is not provided through perfdump.

Monitoring Current Activity Using the perfdump Utility

The perfdump utility is a Server Application Function (SAF) built into Sun Java System Web Server that collects various pieces of performance data from the Web Server internal statistics and displays them in ASCII text. The perfdump utility allows you to monitor a greater variety of statistics than those available through the Server Manager.

With perfdump, the statistics are unified. Rather than monitoring a single process, statistics are multiplied by the number of processes, which gives you a more accurate view of the server as a whole.

Installing the perfdump Utility

ProcedureTo install perfdump, make the following modifications in obj.conf

  1. Add the following object to your obj.conf file after the default object:

    <Object name="perf">Service fn="service-dump"</Object>

  2. Add the following to the default object:

    NameTrans fn=assign-name from="/.perf" name="perf"

    Make sure that the .perf NameTrans directive is specified before the document-root NameTrans directive in the default object.

  3. If not already activated, activate stats-xml.

    For more information, see Activating Statistics

  4. Restart your server software.

  5. Access perfdump by entering this URL:

    http://yourhost/.perf

    You can request the perfdump statistics and specify how frequently (in seconds) the browser should automatically refresh. The following example sets the refresh to every 5 second

    http://yourhost/.perf?refresh=5

See Also

Using Statistics to Tune Your Server

Sample perfdump Output

The following is sample perfdump output:

------------------------------------------------------------
webservd pid: 2408

ConnectionQueue:
----------------------------------
Current/Peak/Limit Queue Length     0/0/4096
Total Connections Queued            0
Average Queueing Delay              0.00 milliseconds

ListenSocket ls1:
------------------------
Address                   http://0.0.0.0:8080
Acceptor Threads          1
Default Virtual Server    https-iws-files2.red.iplanet.com

KeepAliveInfo:
--------------------
KeepAliveCount        0/256
KeepAliveHits         0
KeepAliveFlushes      0
KeepAliveRefusals     0
KeepAliveTimeouts     0
KeepAliveTimeout      30 seconds

SessionCreationInfo:
------------------------
Active Sessions           1
Total Sessions Created    48/128

CacheInfo:
------------------
enabled             yes
CacheEntries        0/1024
Hit Ratio           0/0 (  0.00%)
Maximum Age         30

Native pools:
----------------------------
NativePool:
Idle/Peak/Limit               1/1/128
Work Queue Length/Peak/Limit  0/0/0

Server DNS cache disabled

Async DNS disabled

Performance Counters:
------------------------------------------------
                           Average        Total     Percent


Total number of requests:                     0
Request processing time:    0.0000       0.0000

default-bucket (Default bucket)
Number of Requests:                           0    (  0.00%)
Number of Invocations:                        0    (  0.00%)
Latency:                    0.0000       0.0000    (  0.00%)
Function Processing Time:   0.0000       0.0000    (  0.00%)
Total Response Time:        0.0000       0.0000    (  0.00%)

Sessions:
----------------------------
Process   Status    Function

2408      response  service-dump
------------------------------------------------------------

Using Performance Buckets

Performance buckets allow you to define buckets and link them to various server functions. Every time one of these functions is invoked, the server collects statistical data and adds it to the bucket. For example, send-cgi and NSServletService are functions used to serve the CGI and Java servlet requests respectively. You can either define two buckets to maintain separate counters for CGI and servlet requests, or create one bucket that counts requests for both types of dynamic content. The cost of collecting this information is little and impact on the server performance is usually negligible. This information can later be accessed using the perfdump utility. The following information is stored in a bucket:

Configuration

You must specify all configuration information for performance buckets in the magnus.conf and obj.conf files. Only the default bucket is automatically enabled.

First, you must enable performance measurement as described in Monitoring Current Activity Using the perfdump Utility

The following examples show how to define new buckets in magnus.conf:


Init fn="define-perf-bucket" name="acl-bucket" description="ACL bucket"

Init fn="define-perf-bucket" name="file-bucket" description="Non-cached responses"

Init fn="define-perf-bucket" name="cgi-bucket" description="CGI Stats"

            

The example above creates three buckets: acl-bucket, file-bucket, and cgi-bucket. To associate these buckets with functions, add bucket=bucket-name to the obj.conf function for which you wish to measure performance.

Example

PathCheck fn="check-acl" acl="default" bucket="acl-bucket"
...
Service method="(GET|HEAD|POST)" type="*~magnus-internal/*" 
fn="send-file" bucket="file-bucket"
...
<Object name="cgi">
ObjectType fn="force-type" type="magnus-internal/cgi"
Service fn="send-cgi" bucket="cgi-bucket"
</Object>

Performance Report

The server statistics in buckets can be accessed using the perfdump utility. The performance buckets information is located in the last section of the report returned by perfdump.

The report contains the following information:

  Performance Counters:
  ------------------------------------------------
                             Average        Total     Percent


  Total number of requests:                     0
  Request processing time:    0.0000       0.0000

  default-bucket (Default bucket)
  Number of Requests:                           0    (  0.00%)
  Number of Invocations:                        0    (  0.00%)
  Latency:                    0.0000       0.0000    (  0.00%)
  Function Processing Time:   0.0000       0.0000    (  0.00%)
  Total Response Time:        0.0000       0.0000    (  0.00%)