perfdump 实用程序是 Proxy Server 中内置的一个服务器应用函数 (Server Application Function, SAF),用于从 Proxy Server 内部统计信息中收集各种性能数据片断并以 ASCII 文本形式进行显示。与通过 Server Manager 获得的统计信息种类相比,使用 perfdump 实用程序可监视更多种统计信息。
利用 perfdump 可将统计信息整合起来。不再是监视单个进程,而是将统计信息乘以进程数,这样可以从总体上更准确地了解服务器的情况。
只有在启用 stats-xml 函数之后,才能启用 perfdump SAF。
在 obj.conf 文件的默认对象后面添加以下对象:
<Object name="perf">
Service fn="service-dump"
</Object>
将下行添加到默认对象:
NameTrans fn=assign-name from="/.perf" name="perf"
重新启动服务器软件。
通过转到 http:// computer_name:proxyport/.perf 访问 perfdump。
您可以请求 perfdump 统计信息,并指定浏览器的自动刷新频率(以秒为单位)。以下示例将刷新频率设置为每隔 5 秒一次:
http:// computer_name:proxyport/.perf?refresh=5
以下显示了 perfdump 输出样例:
proxyd pid: 6751
Sun Java System Web Proxy Server 4.0 B05/02/2005 15:32 (SunOS DOMESTIC)
Server started Thu May 19 13:15:14 2005
Process 6751 started Thu May 19 13:15:14 2005
ConnectionQueue:
-----------------------------------------
Current/Peak/Limit Queue Length 0/1/4096
Total Connections Queued 1
Average Queue Length (1, 5, 15 minutes) 0.00, 0.00, 0.00
Average Queueing Delay 0.09 milliseconds
ListenSocket ls1:
------------------------
Address http://0.0.0.0:8081
Acceptor Threads 1
KeepAliveInfo:
--------------------
KeepAliveCount 0/256
KeepAliveHits 0
KeepAliveFlushes 0
KeepAliveRefusals 0
KeepAliveTimeouts 0
KeepAliveTimeout 30 seconds
SessionCreationInfo:
------------------------
Active Sessions 1
Keep-Alive Sessions 0
Total Sessions Created 48/128
DiskCacheInfo:
------------------
Hit Ratio 0/0 ( 0.00%)
Misses 0
Cache files at startup 0
Cache files created 0
Cache files cleaned up 0
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: 1
Request processing time: 0.2559 0.2559
default-bucket (Default bucket)
Number of Requests: 1 (100.00%)
Number of Invocations: 7 (100.00%)
Latency: 0.2483 0.2483 ( 97.04%)
Function Processing Time: 0.0076 0.0076 ( 2.96%)
Total Response Time: 0.2559 0.2559 (100.00%)
Sessions:
----------------------------
Process Status Function
6751 response service-dump
|
有关这些参数的更多信息,请参见《Sun ONE Web Server 6.1 Performance Tuning, Sizing, and Scaling Guide》的第 2 章中的 "Using Statistics to Tune Your Server"。
如果要对可以通过浏览器查看服务器的 perfdump 统计信息的用户进行限制,需要为 /.perf URI 创建一个 ACL。
此外,还必须在 obj.conf 文件的 perf 对象定义中引用该 ACL 文件。例如,如果为 /.perf URI 创建了一个命名的 ACL,则需要在该对象定义的 PathCheck 语句中引用该 ACL 文件,如下所示:
<Object name="perf">
PathCheck fn="check-acl" acl="perf.acl"
Service fn="service-dump"
</Object>