Tips Monitoring Squid Proxy


Kepengen liat performansi squid tanpa harus instal cachemgr ?

kan kalo pake cachemgr harus install webserver + cgi, minimal itu

apalagi kalo monitoringnya pake cacti or mrtg ato yang sejenis

pake sarg ? calamaris ? wew sama aja deh perlu instal ini itu…

kalo 100 itu cepek, kalo 10 x 10 = cape’ dech…. (50+50, etc)

Pake squidclient ajah😀 ni tool udah include kok waktu kita install squid, gak perlu macem2 ini itu, pake squidclient ini udah cukup.

Gitu aja kok repot….

nih contohnya

squidclient -h 192.168.1.x -p 80 mgr:info

  squidclient -h 192.168.1.x -p 80 mgr:info

  HTTP/1.0 200 OK
  Server: squid/2.6.STABLE6
  Date: Tue, 20 Mar 2007 04:49:52 GMT
  Content-Type: text/plain
  Expires: Tue, 20 Mar 2007 04:49:52 GMT
  Last-Modified: Tue, 20 Mar 2007 04:49:52 GMT
  X-Cache: MISS from xx.xx.comy
  Via: 1.0 xx.xx.comy:80 (squid/2.6.STABLE6)
  Connection: close

  Squid Object Cache: Version 2.6.STABLE6
  Start Time:     Wed, 07 Mar 2007 06:20:49 GMT
  Current Time:   Tue, 20 Mar 2007 04:49:52 GMT
  Connection information for squid:
        Number of clients accessing cache:      13401
        Number of HTTP requests received:       26416850
        Number of ICP messages received:        12173866
        Number of ICP messages sent:    12174958
        Number of queued ICP replies:   0
       Request failure ratio:   0.00
        Average HTTP requests per minute since start:   1418.0
        Average ICP messages per minute since start:    1307.0
        Select loop called: -2144956104 times, -0.521 ms avg
  Cache information for squid:
        Request Hit Ratios:     5min: 55.6%, 60min: 58.2%
        Byte Hit Ratios:        5min: 42.8%, 60min: 47.0%
        Request Memory Hit Ratios:      5min: 3.1%, 60min: 2.9%
        Request Disk Hit Ratios:        5min: 44.8%, 60min: 43.8%
        Storage Swap size:      1843044 KB
        Storage Mem size:       797464 KB
        Mean Object Size:       14.21 KB
        Requests given to unlinkd:      0
  Median Service Times (seconds)  5 min    60 min:
        HTTP Requests (All):   0.00678  0.00767
        Cache Misses:          0.01745  0.03622
        Cache Hits:            0.00562  0.00562
        Near Hits:             0.09736  0.12106
        Not-Modified Replies:  0.00286  0.00286
        DNS Lookups:           0.00000  0.00000
        ICP Queries:           0.00000  0.00000
  Resource usage for squid:
        UP Time:        1117743.313 seconds
        CPU Time:       36369.113 seconds
        CPU Usage:      3.25%
        CPU Usage, 5 minute avg:        12.86%
        CPU Usage, 60 minute avg:       12.61%
        Process Data Segment Size via sbrk(): 1918888 KB
        Maximum Resident Size: 0 KB
        Page faults with physical i/o: 156
  Memory usage for squid via mallinfo():
        Total space in arena:  1918888 KB
        Ordinary blocks:       1604965 KB 192658 blks
        Small blocks:               0 KB      0 blks
        Holding blocks:          2596 KB      4 blks
        Free Small blocks:          0 KB
        Free Ordinary blocks:  313922 KB
        Total in use:          1607561 KB 84%
        Total free:            313922 KB 16%
        Total size:            1921484 KB
 Memory accounted for:
        Total accounted:       1473329 KB
        memPoolAlloc calls: 1616505531
        memPoolFree calls: 1607627595
 File descriptor usage for squid:
        Maximum number of file descriptors:   8192
        Largest file desc currently in use:   7625
        Number of file desc currently in use: 3968
        Files queued for open:                   0
        Available number of file descriptors: 4224
        Reserved number of file descriptors:   100
        Store Disk files open:                 738
        IO loop method:                     epoll
 Internal Data Structures:
        239672 StoreEntries
        130246 StoreEntries with MemObjects
           102 Hot Object Cache Items
        129736 on-disk objects

squidclient -h host -p 80 mgr:refresh

  squidclient -h host -p 80 mgr:refresh

  RefreshCheck calls per protocol

  Protocol        #Calls  %Calls
      HTTP      15342550         60.95
       ICP           0    0.00
  On Store      9831131  39.05

  RefreshCheck histograms for various protocols

  HTTP histogram:
  Count   %Total  Category
    10    0.00  Fresh: request max-stale wildcard
     0    0.00  Fresh: request max-stale value
  5925586  38.62  Fresh: expires time not reached
  9080473  59.18  Fresh: refresh_pattern last-mod factor percentage
     0    0.00  Fresh: refresh_pattern min value
     0    0.00  Fresh: refresh_pattern override expires
     0    0.00  Fresh: refresh_pattern override lastmod
  18429    0.12  Stale: response has must-revalidate
     0    0.00  Stale: changed reload into IMS
     0    0.00  Stale: request has no-cache directive
  74569    0.49  Stale: age exceeds request max-age value
  49797    0.32  Stale: expires time reached
  90922    0.59  Stale: refresh_pattern max age rule
  101761    0.66  Stale: refresh_pattern last-mod factor percentage
  1003    0.01  Stale: by default
  15342550        100.00  TOTAL

  ICP histogram:
  Count   %Total  Category
     0   -1.00  Fresh: request max-stale wildcard
     0   -1.00  Fresh: request max-stale value
     0   -1.00  Fresh: expires time not reached
     0   -1.00  Fresh: refresh_pattern last-mod factor percentage
     0   -1.00  Fresh: refresh_pattern min value
     0   -1.00  Fresh: refresh_pattern override expires
     0   -1.00  Fresh: refresh_pattern override lastmod
     0   -1.00  Stale: response has must-revalidate
     0   -1.00  Stale: changed reload into IMS
     0   -1.00  Stale: request has no-cache directive
     0   -1.00  Stale: age exceeds request max-age value
     0   -1.00  Stale: expires time reached
     0   -1.00  Stale: refresh_pattern max age rule
     0   -1.00  Stale: refresh_pattern last-mod factor percentage
     0   -1.00  Stale: by default
     0   -1.00  TOTAL

  On Store histogram:
  Count   %Total  Category
     0    0.00  Fresh: request max-stale wildcard
     0    0.00  Fresh: request max-stale value
  5007960  50.94  Fresh: expires time not reached
  2611671  26.57  Fresh: refresh_pattern last-mod factor percentage
     0    0.00  Fresh: refresh_pattern min value
     0    0.00  Fresh: refresh_pattern override expires
     0    0.00  Fresh: refresh_pattern override lastmod
     0    0.00  Stale: response has must-revalidate
     0    0.00  Stale: changed reload into IMS
     0    0.00  Stale: request has no-cache directive
     0    0.00  Stale: age exceeds request max-age value
  106620    1.08  Stale: expires time reached
  170364    1.73  Stale: refresh_pattern max age rule
  150242    1.53  Stale: refresh_pattern last-mod factor percentage
  1784274  18.15  Stale: by default
  9831131 100.00  TOTAL

Lainnya :

squidclient -h host -p 80 mgr:counters
squidclient -h host -p 80 mgr:utilization
squidclient -h host -p 80 mgr:5min
squidclient -h host -p 80 mgr:60min
squidclient -h host -p 80 mgr:mem

untuk proxy di localhost, perintahnya diganti dengan

misal:

squidclient mgr:info

9 comments

  1. weww, emang bisa ya? ngeliatnya dari server? soalnya dari kmrn mau liat di cachemgr kok blm bisa2. “squidclient -h 192.168.1.x -p 80 mgr:info” 80 itu port yg dipake squid ya?

    trus sekalian nanya pak, bisa gak sih cache server sekalian jadi client nya😀, soalnya gak da kom yg bs dijadiin client.

    trus, kok di access.log nya cm ada log kegagalan akses cachemgr, trus data nya jg data lama, gak berubah itu2 aja, padahal saya banyak akses situs2. tu kenapa ya?

  2. squidclient -h 192.168.1.x -p 80 mgr:info

    kalo liatnya dari komputer yang dipasangi squid,
    tinggal

    squidclient mgr:info

    untuk dijadikan klien, boleh aja kok mas, terserah
    mas’e yang mo pake😀

    untuk masalah log, trus gak bisa ngakses cachemgr,
    coba cek dulu aja mas squid.conf nya

    jangan2 emang dari squid.conf nya ditutup

  3. maaf mas bayu kok saya coba perintahnya eror yah
    alie@alie-desktop:~$ squidclient mgr:info
    client: ERROR: Cannot connect to localhost:3128: Connection refused

    oh yah saya pakai squid untuk satu komi, port squid sayah 7777,
    dimanakah yah yang salah??? mohon pencerahannya

    terimakasih

  4. maaf ada yang salah ketik

    s/komi–> maksudnya komputer yang diasangi squid

    thx

  5. Salam kenal ya Pak…
    Pak,.. kalo pengen tahu performa squid gimana yaa ?
    soalnya client2 yang request ke proxy kebanyakan ngeluh lambat semua.
    padahal jatah bw mereka masih banyak yang blom ke pakai.
    Sedangkan dari log squid nya ndak ada pesen error.
    Dan CPU Usage buat proxy max-nya cuman sampai 20%.
    Atau mungkin Bapak punya tip/trik untuk mendongkrak kinerja CPU untuk Squid ?🙂

    Terimakasih

  6. sy pake ubuntu server 7.10 squidnya 2.6 Stable16
    koq ga ada squid clientnya ya??
    ada cara lain yang mudah untuk monitoring squid mas??

    bayuart:
    banyak tool buat monitoring squid, misal cek
    https://bayuart.wordpress.com/squid-logfile-analysis/

    silahkan tambahkan dengan perintah

    apt-get install nama_paket

  7. di squid Smoothwall or IPCOP

    squidclient -h 192.168.10.1 -p 800 mgr:info

  8. sy pake ubuntu server 6 squidnya 2.5 Stable12
    kok setelah di diketikan squidclient -p 3129 mgr:info muncul tulisan begini ???
    kesalahannya dimana ya???

    HTTP/1.0 403 Forbidden
    Server: squid/2.5.STABLE12
    Mime-Version: 1.0
    Date: Mon, 25 Feb 2008 14:44:49 GMT
    Content-Type: text/html
    Content-Length: 1100
    Expires: Mon, 25 Feb 2008 14:44:49 GMT
    X-Squid-Error: ERR_ACCESS_DENIED 0
    X-Cache: MISS from proxy
    X-Cache-Lookup: NONE from proxy:3129
    Proxy-Connection: close

    bayu :

    hasil perintah

    netstat -pln |grep squid

    apa ?

    ato isi parameter http_port di squid.conf apa ?
    sesuaikan mas ya…
    soale default squid adalah 3128 bukan 3129
    mohon di cek lagi

  9. wah.. Thx banget mas..
    simple but nice…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: