Chinaunix首页 | 论坛 | 博客
  • 博客访问: 489025
  • 博文数量: 127
  • 博客积分: 7010
  • 博客等级: 少将
  • 技术积分: 1972
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-01 12:42
文章分类

全部博文(127)

文章存档

2009年(33)

2008年(94)

我的朋友

分类: LINUX

2008-08-01 13:24:56

检查 squid 性能最好最准确最详尽的方法估计还是分析日志!

这里有个工具 ,简单的提供比较不错的日志分析结果

下载后运行: awk -f scalar.awk access.log
web1# awk -f scalar.awk access.logbak


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~  SCALAR (Squid Cache Advanced Log Analyzer & Reporter), Version 0.96  ~~~~
~~~~                                                                       ~~~~
~~~~  (C) 2003-4 by Yuri N. Fominov, YuriF@risk.az, ~~~~
~~~~  SCALAR has no warranty and it is completely free, so you are welcome ~~~~
~~~~  to re-distribute this pretty useful piece of software. Good Luck2All ~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~ Analysis Headlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Log Start Time [08-08-2008 16:49:43]
    Log End Time [01-09-2008 14:02:54]
  Lines Analyzed    11.193M

 Unique Clients: 251091

     In Traffic:   55.274 GB
    Out Traffic:  109.464 GB
  ------------------------------------
  Saved Traffic:   54.190 GB   49.50 %


~~~ Requests By Hours ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 53.2K                       ==                                               
 50.6K                       ==                                               
 47.9K                       ==                                               
 45.2K                       ==                                               
 42.6K                       ==                                               
 39.9K                       ==                                               
 37.3K                       ==                                               
 34.6K                       == ==                                            
 31.9K                    == == ==                                            
 29.3K                    == == ==       ==    ==                             
 26.6K                    == == ==    == == == == ==                          
 23.9K                    == == == == == == == == ==                          
 21.3K                    == == == == == == == == == ==                       
 18.6K                 == == == == == == == == == == == == == == ==           
 16.0K                 == == == == == == == == == == == == == == ==           
 13.3K                 == == == == == == == == == == == == == == == == ==     
 10.6K                 == == == == == == == == == == == == == == == == ==     
  8.0K              == == == == == == == == == == == == == == == == == == ==  
  5.3K           == == == == == == == == == == == == == == == == == == == == ==
  2.7K  == == == == == == == == == == == == == == == == == == == == == == == ==
_______________________________________________________________________________
  Hours: 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Maximum Requests:  53.231K/hour,      887 /min,   14.8/sec.
Average Requests:  20.566K/hour,      343 /min,    5.7/sec.
Minimum Requests:   4.417K/hour,       73 /min,    1.2/sec.


~~~ Traffic by Hours ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

412.2MB                      ==                                               
391.6MB                      ==                                               
371.0MB                      ==                                               
350.4MB                      ==                                               
329.8MB                      == ==                                            
309.2MB                   == == ==             ==                             
288.6MB                   == == ==       ==    ==                             
267.9MB                   == == ==       == == == ==                          
247.3MB                   == == == == == == == == ==                          
226.7MB                   == == == == == == == == ==       == ==              
206.1MB                   == == == == == == == == == == == == == ==           
185.5MB                == == == == == == == == == == == == == == ==           
164.9MB                == == == == == == == == == == == == == == == ==        
144.3MB                == == == == == == == == == == == == == == == == ==     
123.7MB                == == == == == == == == == == == == == == == == == ==  
103.1MB                == == == == == == == == == == == == == == == == == ==  
 82.4MB             == == == == == == == == == == == == == == == == == == == ==
 61.8MB == == == == == == == == == == == == == == == == == == == == == == == ==
 41.2MB == == == == == == == == == == == == == == == == == == == == == == == ==
 20.6MB == == == == == == == == == == == == == == == == == == == == == == == ==
_______________________________________________________________________________
  Hours: 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Maximum Xfers: 412.224 MB/hour,    6.870 MB/min, 117.255 KB/sec [ 938 kbps]
Average Xfers: 205.783 MB/hour,    3.430 MB/min,  58.534 KB/sec [ 468 kbps]
Minimum Xfers:  61.901 MB/hour,    1.032 MB/min,  17.607 KB/sec [ 141 kbps]


~~~ File Extensions Report ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-------|------ R E Q U E S T S  --------|----------- T R A F F I C -----------|
 Ext.  |  total | misses |  hits  |hit% |   total  |  misses  |   hits   |hit%|
-------|--------|--------|--------|-----|----------|----------|----------|----|
gif       5.805M 248.700K   5.556M  96%   14.090 GB 495.884 MB  13.605 GB  97%
js        1.381M  29.721K   1.352M  98%   22.350 GB 460.261 MB  21.900 GB  98%
css     954.303K 954.303K       0    0%    3.261 GB   3.261 GB       0  B   0%
870.826K 870.789K      37    0%   30.536 GB  30.536 GB 116.659 KB   0%
jpg     675.875K  33.087K 642.788K  95%   14.822 GB 746.796 MB  14.092 GB  95%
html    573.751K 573.751K       0    0%  199.415 MB 199.415 MB       0  B   0%
/       433.036K 432.022K   1.014K   0%    9.916 GB   9.910 GB   6.812 MB   0%
php     355.043K 355.043K       0    0%    6.335 GB   6.335 GB       0  B   0%
ico      75.853K  75.853K       0    0%   58.440 MB  58.440 MB       0  B   0%
swf      39.938K   1.808K  38.130K  95%    4.295 GB 243.123 MB   4.058 GB  94%
rar       6.362K   6.362K       0    0%    2.692 GB   2.692 GB       0  B   0%
png       2.995K     211    2.784K  93%   15.876 MB   3.080 MB  12.797 MB  81%
txt       2.805K   1.633K   1.172K  42%    1.843 MB   1.232 MB 626.292 KB  33%
dat       2.497K   2.427K      70    3%    1.924 MB   1.871 MB  54.961 KB   3%
asp         698      576      122   17%  548.344 KB 452.555 KB  95.789 KB  17%
wma         550      221      329   60%  708.849 MB 243.174 MB 465.676 MB  66%
htm         406       33      373   92%  394.260 KB  28.376 KB 365.884 KB  93%
mdb         252      252        0    0%  198.105 KB 198.105 KB       0  B   0%
bmp         171       52      119   70%   35.436 MB  11.518 MB  23.918 MB  67%
     169      169        0    0%  147.975 KB 147.975 KB       0  B   0%
aspx        160      155        5    3%  125.776 KB 121.851 KB   3.926 KB   3%
zip          91       91        0    0%  336.216 KB 336.216 KB       0  B   0%
htc          66       66        0    0%   35.782 KB  35.782 KB       0  B   0%
ppt          56       45       11   20%  150.571 MB 117.393 MB  33.177 MB  22%
pdf          47       24       23   49%    3.679 MB   1.876 MB   1.803 MB  49%
com          38       38        0    0%   29.873 KB  29.873 KB       0  B   0%
xml          31       12       19   61%  277.014 KB  49.570 KB 227.443 KB  82%
js\"         31       31        0    0%   16.714 KB  16.714 KB       0  B   0%
csss"        17       17        0    0%   13.364 KB  13.364 KB       0  B   0%
xls          16        2       14   88%  425.066 KB  70.637 KB 354.430 KB  83%
             13       13        0    0%   22.232 KB  22.232 KB       0  B   0%
[other]      12       12        0    0%    9.434 KB   9.434 KB       0  B   0%
php'          9        9        0    0%    7.075 KB   7.075 KB       0  B   0%
pwd           8        6        2   25%    6.287 KB   4.717 KB   1.570 KB  25%
dll           7        7        0    0%    5.503 KB   5.503 KB       0  B   0%
smi           7        7        0    0%    5.503 KB   5.503 KB       0  B   0%
crt           5        5        0    0%    3.931 KB   3.931 KB       0  B   0%
doc           5        2        3   60%    1.731 MB 865.067 KB 907.331 KB  51%
bak           4        4        0    0%    3.145 KB   3.145 KB       0  B   0%
php"          4        4        0    0%    3.145 KB   3.145 KB       0  B   0%
cert          3        3        0    0%    2.358 KB   2.358 KB       0  B   0%
mp3           3        3        0    0%    2.358 KB   2.358 KB       0  B   0%
0             3        3        0    0%    2.358 KB   2.358 KB       0  B   0%
src+'         2        2        0    0%    1.572 KB   1.572 KB       0  B   0%
back()        2        2        0    0%    1.572 KB   1.572 KB       0  B   0%
h             2        2        0    0%    1.572 KB   1.572 KB       0  B   0%
jpeg          2        2        0    0%    1.572 KB   1.572 KB       0  B   0%
config        2        2        0    0%    1.572 KB   1.572 KB       0  B   0%
php>          2        2        0    0%    1.572 KB   1.572 KB       0  B   0%
asa           2        2        0    0%    1.572 KB   1.572 KB       0  B   0%
================|========|========|=====|==========|==========|==========|====|
TOTALS:  11.183M   3.588M   7.595M  68%  109.449 GB  55.258 GB  54.190 GB  50%


-----------------------|-- R E Q U E S T S ---|-------- T R A F F I C --------|
 Content Type          |  total |  hits  |hit%|  total   |   hits   |hit%|%VOL|
-----------------------|--------|--------|----|----------|----------|----|----|
Images/Graphics & Flash   6.600M   6.240M  95%  33.314 GB  31.792 GB  95%  30%
Java, VBS & CSS           2.336M   1.352M  58%  25.611 GB  21.900 GB  86%  23%
                 870.826K      37    0%  30.536 GB 116.659 KB   0%  28%
Web Pages: Static       574.188K     392    0% 200.071 MB 593.327 KB   0%   0%
/ -any content possible 433.036K   1.014K   0%   9.916 GB   6.812 MB   0%   9%
Web Pages: Dynamic      355.916K     127    0%   6.335 GB  99.715 KB   0%   6%
Archives & Executables    6.491K       0    0%   2.692 GB       0  B   0%   2%
Streaming Audio/Video     6.362K       0    0%   2.692 GB       0  B   0%   2%
[other]                   2.981K      72    2%   2.322 MB  56.531 KB   2%   0%
Text & RTF Files          2.805K   1.172K  42%   1.843 MB 626.292 KB  33%   0%
Media: Audio                744      353   47% 709.245 MB 465.901 MB  66%   1%
PDF & MS Office Files       124       51   41% 156.396 MB  36.213 MB  23%   0%
Dev. Source Code             73        3    4%   1.767 MB 907.331 KB  50%   0%
Software Updates              7        0    0%   5.503 KB       0  B   0%   0%
==============================================================================


~~~ Objects Size Report ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------|------ R E Q U E S T S  -------|----------- T R A F F I C -----------
  SIZE   |  total | misses |  hits  |hit%|   total  |  misses  |   hits   |hit%
---------|--------|--------|--------|----|----------|----------|----------|----
  0-0.1KB  14.971K  14.946K      25    0%       0  B       0  B       0  B   0%
0.1-1.0KB   5.996M   1.511M   4.485M  75%   2.324 GB 634.630 MB   1.704 GB  73%
  1-5  KB   2.288M 412.165K   1.876M  82%   5.445 GB   1.053 GB   4.391 GB  81%
  5-10 KB 593.083K 304.573K 288.510K  49%   3.946 GB   1.818 GB   2.128 GB  54%
 10-50 KB   1.623M   1.023M 600.566K  37%  38.112 GB  22.882 GB  15.229 GB  40%
 50-100KB 627.740K 294.049K 333.691K  53%  45.261 GB  18.750 GB  26.512 GB  59%
100-500KB  34.007K  25.291K   8.716K  26%   5.244 GB   3.631 GB   1.613 GB  31%
0.5-1.0MB   4.079K   1.515K   2.564K  63%   2.640 GB   1.100 GB   1.541 GB  58%
  1-5  MB   2.117K   1.613K     504   24%   4.515 GB   3.442 GB   1.072 GB  24%
  5-10 MB     131      131        0    0% 857.259 MB 857.259 MB       0  B   0%
 10-50 MB      53       53        0    0%   1.125 GB   1.125 GB       0  B   0%
 50-100MB       0        0        0    0%       0  B       0  B       0  B   0%
   >100MB       0        0        0    0%       0  B       0  B       0  B   0%
===============================================================================


~~~ Squid Result Codes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

|      Result Code       | Requests  |  Traffic   |
|------------------------|-----------|------------|
             TCP_MEM_HIT     3.701M      41.634 GB
             TCP_IMS_HIT     2.712M     713.549 MB
                 TCP_HIT   679.891K       5.648 GB
         TCP_REFRESH_HIT   493.771K       6.203 GB
        TCP_NEGATIVE_HIT     8.914K       7.848 MB
             TOTAL HITS:     7.595M      54.190 GB

|------------------------|-----------|------------|
                TCP_MISS     3.517M      53.911 GB
        TCP_REFRESH_MISS    51.898K       1.028 GB
 TCP_CLIENT_REFRESH_MISS    19.097K     326.355 MB
       TCP_SWAPFAIL_MISS        45       92.763 KB
==================================================
           TOTAL MISSES:     3.588M      55.258 GB

          TOTAL HITS VOLUME: 67.92 %       49.51 %

|------------------------|-----------|------------|
              TCP_DENIED    10.532K      16.016 MB
==================================================


~~~ HTTP Status Codes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 ## | Description/Name        | Requests  |  Traffic   |  Group  |
----|-------------------------|-----------|------------|---------|
200  OK                            7.592M    105.799 GB  OK
304  Not Modified                  3.160M    803.087 MB  OK
404  Not Found                   313.813K    240.052 MB  ERROR
302  Moved Temporarily            43.213K     92.005 MB  OTHER
403  Forbidden                    37.631K     78.844 MB  DENY
504  Gateway Timeout              19.023K     29.522 MB  TIMEOUT
000  UDP Traffic                  14.943K          0  B  UDP
206  Parital Content               8.497K      2.448 GB  OK
301  Moved Permanently             2.720K      1.396 MB  OTHER
502  Bad Gateway                   1.504K      1.889 MB  ERROR
400  Bad Request                      87     103.574 KB  ERROR
405  Method Not Allowed               14       7.064 KB  ERROR
401  Unauthorized                      2       1.357 KB  DENY
==============================|===========|============|========|
                      TOTALS:     11.193M    109.464 GB


 Group         | Requests     %Vol      |     Traffic     %Vol  |
---------------|------------------------|-----------------------|
OK                10.760M    96.13%          109.031 GB  99.60%
ERROR            315.418K     2.82%          242.049 MB   0.22%
OTHER             45.933K     0.41%           93.402 MB   0.08%
DENY              37.633K     0.34%           78.845 MB   0.07%
TIMEOUT           19.023K     0.17%           29.522 MB   0.03%
UDP               14.943K     0.13%                0  B   0.00%
===============================================================


~~~ Request Methods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------|------- R E Q U E S T S -----|-------- T R A F F I C ---------|
 Method        |  %VOL  | Requests |  denied |  %VOL  |  Traffic   |  denied  |
---------------|--------|----------|---------|--------|------------|----------|
GET              99.01%    11.082M   10.445K   99.16%   108.543 GB  15.884 MB
POST              0.92%   102.874K       35     0.84%   939.671 MB  53.271 KB
HEAD              0.07%     7.768K        4     0.00%     2.714 MB   1.230 KB
OPTIONS           0.00%        71        14     0.00%   761.777 KB  19.715 KB
PROPFIND          0.00%        26         0     0.00%    25.229 KB       0  B
NONE              0.00%        23        23     0.00%    44.165 KB  44.165 KB
CONNECT           0.00%        11        11     0.00%    16.331 KB  16.331 KB
LOCK              0.00%         1         0     0.00%       541  B       0  B
==============================================================================


~~~ Protocols & Ports (Requests) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 Port | Protocol  | Total    %VOL | Misses Miss% |  Hits   Hit% |  Deny  Deny%|
------|-----------|---------------|--------------|--------------|-------------|
[ALL]  HTTP         11.193M100.00%    3.588M  32%    7.595M  68%  10.484K   0%
invalid-request                 11   0.00%        0    0%        0    0%      11  100%
==================|===============|==============|==============|=============|
          TOTALS:   11.193M   100%    3.588M  32%    7.595M  68%  10.495K   0%


~~~ Protocols & Ports (Traffic) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 Port | Protocol  |   Total    %VOL | Misses   Miss%|  Hits    Hit% |  Deny
------|-----------|-----------------|---------------|---------------|----------
[ALL]  HTTP        109.464 GB 100.00%  55.258 GB  50%  54.190 GB  50%  15.938 MB
invalid-request             16.331 KB  0.00%       0  B   0%       0  B   0%  16.331 KB
==================|=================|===============|===============|==========
          TOTALS:  109.464 GB   100%  55.258 GB  50%  54.190 GB  50%  15.953 MB


~~~ Hierarchy (Requests) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Peer/Direct    |  Total   %VOL| Misses Miss% |  Hits   Hit% |  Deny  |Timeouts|
---------------|--------------|--------------|--------------|--------|--------|
DIRECT            7.606M   68%       0    0%    7.595M 100%   10.532K       0
127.0.0.1         3.588M   32%   3.588M 100%        0    0%        0        0


~~~ Hierarchy (Traffic) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Peer/Direct    |  Total    %VOL| Misses    Miss% |    Hits    Hit% |Deny&T-out|
---------------|---------------|-----------------|-----------------|----------|
127.0.0.1        55.262 GB  50%  55.258 GB  100%         0  B   0%        0  B
DIRECT           54.213 GB  50%       0  B    0%    54.190 GB 100%   16.016 MB


~~~ Hierarchy - Cumulative Traffic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 Group         |  Total    %VOL| Misses    Miss% |    Hits    Hit% |Deny&T-out|
---------------|---------------|-----------------|-----------------|----------|
DIRECT           54.206 GB  50%        0  B   0%    54.190 GB 100%   16.016 MB
ALL PEERS        55.258 GB  50%   55.258 GB 100%         0  B   0%        0  B
---------------|---------------|-----------------|-----------------|----------|
DIRECT + PEERS  109.464 GB 100%   55.258 GB  50%    54.190 GB  50%   16.016 MB


~~~ All Done. Enjoy Your Report.  /  SCALAR (C) 2004, ~~~



                              
文件:scalar.rar
大小:11KB
下载:下载
                                                    
阅读(2683) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~