Thursday Jan 01, 2009

how to bypass RPP and AM agent to get perfdump

Sometimes, you like to get perfdump (/.perf) from web or proxy servers, but the RPP or AM agent may prevent you from doing this. So, you can try below:


 1. follow the steps of perfdump at


http://docs.sun.com/app/docs/doc/820-5719/abyaq?l=en&a=view&q=perfdump


 2. if you got RPP in your web server, then


<Client match="none" uri="/.perf">

NameTrans fn="map" from="/" name="reverse-proxy-/" to="http:/"
</Client> 


then both perf dump and rpp will work ok.

The above will map rpp if uri not equal to /.perf, and will skip rpp
if uri is /.perf


So, both requests to rpp and .perf will work ok.

3. if you got AM agent in your proxy server, then


................ 


NameTrans fn="assign-name" name="stats-xml" from="(/stats-xml|/stats-xml/.\*)"
NameTrans fn="assign-name" name="statistics" from="/.abc/.statistics"
................


PathCheck fn="url-check"
<Client match="none" uri="/.abc(/.\*|)">
PathCheck fn="validate_session_policy"
</Client>

Service fn="deny-service"
AddLog fn="flex-log" name="access"
</Object>


.........


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

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


 then a request to get the statistics will work ok without the AM agent Path Check .





Friday Dec 12, 2008

Simple script to download or get perfdump output into a file for later analysis for web 6.1

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.



About

Wing-Yip Walter Lee

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today