How to run wshang script to collect webservd runtime information
Wednesday Jun 24, 2009
Tags: file hung memory script supportfiles upload wshang
Today, I found a need to run perfdump periodically in web server 6.1 SPx and download it into a single file with timestamps for later analysis. I can then check further on different number of performance numbers of this web server to see if any area to tune for better.
So, I followed the steps at 6.1 docs to enable perfdump,
http://docs.sun.com/app/docs/doc/820-5719/abyaq?l=en&a=view&q=perfdump
then I came across this great blog,
http://blogs.sun.com/elving/entry/perfdump_in_7_0
which tells how to do it in web 7 easily.
Inside, I also saw,
" (echo "GET /.perf";sleep 1 ) | telnet www.mysite.com 80 "
by
"Posted by
ttalex
on October 20, 2006 at 02:33 AM PDT"
So, I wrote up a simple script to try,
APPLE:/export/home0/case/7041xxxx-yyy-p1> cat get-perf-2s.ksh
#/usr/bin/ksh
while [ 1 ]
do
# 1st to print date timestamp
echo "=====================next perf dump======================="
date
# 2nd to get .perf
(echo "GET /.perf";sleep 1 ) | telnet apple.asia.sun.com 60103
# 3rd sleep 2s
sleep 2
done
Then, I chmod a+x and then
./get-perf-2s.ksh >> perf.txt
and control-c to stop it after a while,
then > cat perf.txt
=====================next perf dump=======================
Fri Dec 12 15:06:33 CST 2008
Trying 129.158.175.16...
Connected to apple.
Escape character is '^]'.
webservd pid: 19065
Sun ONE Web Server 6.1SP10 B09/04/2008 10:03 (SunOS DOMESTIC)
Server started Fri Dec 12 14:39:20 2008
Process 19065 started Fri Dec 12 14:39:20 2008
ConnectionQueue:
-----------------------------------------
Current/Peak/Limit Queue Length 0/1/4096
Total Connections Queued 95
Average Queue Length (1, 5, 15 minutes) 0.00, 0.00, 0.00
Average Queueing Delay 0.13 milliseconds
ListenSocket ls1:
------------------------
Address http://0.0.0.0:60103
Acceptor Threads 1
Default Virtual Server https-sess
ListenSocket ls2:
------------------------
Address http://129.158.175.16:60104
Acceptor Threads 1
Default Virtual Server land-vs1
KeepAliveInfo:
--------------------
KeepAliveCount 0/256
KeepAliveHits 7
KeepAliveFlushes 0
KeepAliveRefusals 0
KeepAliveTimeouts 3
KeepAliveTimeout 30 seconds
SessionCreationInfo:
------------------------
Active Sessions 1
Keep-Alive Sessions 0
Total Sessions Created 48/128
CacheInfo:
------------------
enabled yes
CacheEntries 8/1024
Hit Ratio 108/214 ( 50.47%)
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: 101
Request processing time: 0.0019 0.1919
default-bucket (Default bucket)
Number of Requests: 101 (100.00%)
Number of Invocations: 1307 (100.00%)
Latency: 0.0003 0.0272 ( 14.18%)
Function Processing Time: 0.0016 0.1647 ( 85.82%)
Total Response Time: 0.0019 0.1919 (100.00%)
Sessions:
----------------------------
Process Status Function
19065 response service-dump
=====================next perf dump=======================
Fri Dec 12 15:06:36 CST 2008
Trying 129.158.175.16...
Connected to apple.
Escape character is '^]'.
webservd pid: 19065
Sun ONE Web Server 6.1SP10 B09/04/2008 10:03 (SunOS DOMESTIC)
Server started Fri Dec 12 14:39:20 2008
Process 19065 started Fri Dec 12 14:39:20 2008
ConnectionQueue:
-----------------------------------------
Current/Peak/Limit Queue Length 0/1/4096
Total Connections Queued 96
Average Queue Length (1, 5, 15 minutes) 0.00, 0.00, 0.00
Average Queueing Delay 0.13 milliseconds
................. repeated itself................
======================================
So, hope this simple script can help capture the perfdump in web 6.1 .
However, it is still best to upgrade to web 7 to use the CLI there for perfdump (it will work in web 7 even when the webservd process hung, but not in web 6.1). Another good reason to upgraded to web 7.