ezylinux
ลินุกซ์ง่ายนิดเดียว

25
May

เมื่อต้องการทราบรายละเอียดการทำงานของ Squid เราสามารถใช้คำสั่ง squidclient เพื่อใช้ในการขอดูข้อมูลต่างๆ ใน Squid

* Squid คือ โปรแกรมที่ทำหน้่่าที่เป็น proxy server ในระบบปฏิบัติการ linux หรือ Unix

* squidclient เป็น tool ที่ใช้สำหรับการเข้าถึง squid service และดูข้อมูลต่างๆเกี่ยวกับ squid เช่น performance statistic, Average HTTP requests per minutes, Request Hit Ratios, Requests Median Service Time

การดู performance statistic ของ squid จะใช้คำสั่ง

#squidclient -p <port> mgr:info

[root@Squid_Proxy ~]# squidclient -p 3128 mgr:info
HTTP/1.0 200 OK
Server: squid/2.6.STABLE6
Date: Mon, 25 May 2009 17:14:47 GMT
Content-Type: text/plain
Expires: Mon, 25 May 2009 17:14:47 GMT
Last-Modified: Mon, 25 May 2009 17:14:47 GMT
X-Cache: MISS from Squid_Proxy.example.com
X-Cache-Lookup: MISS from Squid_Proxy.example.com:3128
Via: 1.0 Squid_Proxy.example.com:3128 (squid/2.6.STABLE6)
Proxy-Connection: close

Squid Object Cache: Version 2.6.STABLE6
Start Time:     Mon, 25 May 2009 17:14:32 GMT
Current Time:   Mon, 25 May 2009 17:14:47 GMT
Connection information for squid:
        Number of clients accessing cache:      1
        Number of HTTP requests received:       0
        Number of ICP messages received:        0
        Number of ICP messages sent:    0
        Number of queued ICP replies:   0
        Request failure ratio:   0.00
        Average HTTP requests per minute since start:   0.0
        Average ICP messages per minute since start:    0.0
        Select loop called: 6082 times, 2.478 ms avg
Cache information for squid:
        Request Hit Ratios:     5min: 0.0%, 60min: 0.0%
        Byte Hit Ratios:        5min: -0.0%, 60min: -0.0%
        Request Memory Hit Ratios:      5min: 0.0%, 60min: 0.0%
        Request Disk Hit Ratios:        5min: 0.0%, 60min: 0.0%
        Storage Swap size:      0 KB
        Storage Mem size:       108 KB
        Mean Object Size:       0.00 KB
        Requests given to unlinkd:      0
Median Service Times (seconds)  5 min    60 min:
        HTTP Requests (All):   0.00000  0.00000
        Cache Misses:          0.00000  0.00000
        Cache Hits:            0.00000  0.00000
        Near Hits:             0.00000  0.00000
        Not-Modified Replies:  0.00000  0.00000
        DNS Lookups:           0.00000  0.00000
        ICP Queries:           0.00000  0.00000
Resource usage for squid:
        UP Time:        15.071 seconds
        CPU Time:       0.014 seconds
        CPU Usage:      0.09%
        CPU Usage, 5 minute avg:        0.00%
        CPU Usage, 60 minute avg:       0.00%
        Process Data Segment Size via sbrk(): 2776 KB
        Maximum Resident Size: 0 KB
        Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
        Total space in arena:    2908 KB
        Ordinary blocks:         2872 KB      3 blks
        Small blocks:               0 KB      0 blks
        Holding blocks:           356 KB      1 blks
        Free Small blocks:          0 KB
        Free Ordinary blocks:      35 KB
        Total in use:            3228 KB 99%
        Total free:                35 KB 1%
        Total size:              3264 KB
Memory accounted for:
        Total accounted:          158 KB
        memPoolAlloc calls: 985
        memPoolFree calls: 314
File descriptor usage for squid:
        Maximum number of file descriptors:   1024
        Largest file desc currently in use:     13
        Number of file desc currently in use:   11
        Files queued for open:                   0
        Available number of file descriptors: 1013
        Reserved number of file descriptors:   100
        Store Disk files open:                   0
        IO loop method:                     epoll
Internal Data Structures:
            27 StoreEntries
            27 StoreEntries with MemObjects
            26 Hot Object Cache Items
             0 on-disk objects

continue

Tags: Squidclient, Status Squid
Category : Squid | Blog