rss

OPTIMALISASI FILE DESCRIPTOR

Oleh AnJeLa-NeT Palangkaraya 
FORUM WARNET-MIKROTIK-LINUX PALANGKARAYA

Proses berikut dilakukan setelah melakukan perintah :

   # sudo apt-get install squid
   # sudo apt-get install squid squidclient squid-cgi

DAN SEBELUM PROSES COMPILE

# ulimit -HSn 65536

  # echo 65536 > /proc/sys/fs/file-max
  # echo "*         soft        nofile          65536" >> /etc/security/limits.conf
  # echo "*         hard        nofile          65536" >> /etc/security/limits.conf
  # echo "root     soft        nofile          65536" >> /etc/security/limits.conf
 
# echo "root        hard        nofile          65536" >> /etc/security/limits.conf
  # echo "proxy    soft        nofile          65536" >> /etc/security/limits.conf
  # echo "proxy    hard        nofile          65536" >> /etc/security/limits.conf
 #  echo "session required        pam_limits.so" >> /etc/pam.d/common-session

   # modprobe ip_conntrack

   kemudian tambahkan ip_contrack di /etc/modules
   # nano /etc/modules

   tambahkan kalimat berikut baris paling bawah :

   ip_conntrack

   Setelah selesai tekan Ctrl+O, lalu Enter untuk Save dan Ctrl+X untuk exit


   # nano /etc/default/squid

   Ubah opsi SQUID_MAXFD=1024 menjadi :

   SQUID_MAXFD=4096

   Ubah opsi #define __FD_SETSIZE 1024 dengan mengetik perintah berikut :

   # nano /usr/include/linux/posix_types.h

   Cari tulisan #define __FD_SETSIZE 1024 ubah menjadi #define __FD_SETSIZE 65536

   Setelah selesai tekan Ctrl+O, lalu Enter untuk Save dan Ctrl+X untuk exit

   Cari tulisan #define __FD_SETSIZE 1024 dengan mengetik perintah berikut :

   # nano /usr/include/bits/typesizes.h

   Cari tulisan  #define __FD_SETSIZE 1024 ubah menjadi #define __FD_SETSIZE 65536

  Setelah selesai tekan Ctrl+O, lalu Enter untuk Save dan Ctrl+X untuk exit

'BARU DILANJUTKAN PROSES COMPILE & PROSES LAIN INSTALASI SQUID PROXY.....'
JIKA DILAKUKAN SETELAH PROSES INSTALASI, MAKA HASIL DARI MAXIMUM FILE DESCRIPTOR AKAN KEMBALI KE DEFAULTNYA.

contoh hasil :

root@alwi:~# squidclient mgr:info
HTTP/1.0 200 OK
Date: Wed, 05 Oct 2010 21:50:18 GMT
Content-Type: text/plain
Expires: Wed, 05 Oct 2010 21:50:18 GMT
X-Cache: MISS from anjelanet
X-Cache-Lookup: MISS from anjelanet:3128
Via: 1.0 anjelanet:3128 (Lusca/LUSCA_FMI)
Connection: close

Squid Object Cache: Version LUSCA_FMI
Start Time:     Wed, 05 Oct 2010 21:50:15 GMT
Current Time:   Wed, 05 Oct 2010 21:50:18 GMT
Connection information for squid:
        Number of clients accessing cache:      0
        Number of HTTP requests received:       0
        Number of ICP messages received:        0
        Number of ICP messages sent:    0
        Number of queued ICP replies:   0
        Number of HTCP messages received:       0
        Number of HTCP messages sent:   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: 158 times, 19.980 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:      1552368 KB
        Storage Mem size:       180 KB
        Mean Object Size:       30.69 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:        3.157 seconds
        CPU Time:       0.676 seconds
        CPU Usage:      21.42%
        CPU Usage, 5 minute avg:        0.00%
        CPU Usage, 60 minute avg:       0.00%
        Process Data Segment Size via sbrk(): 9060 KB
        Maximum Resident Size: 62720 KB
        Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
        Total space in arena:    9060 KB
        Ordinary blocks:         8958 KB      3 blks
        Small blocks:               0 KB      0 blks
        Holding blocks:         55320 KB      6 blks
        Free Small blocks:          0 KB
        Free Ordinary blocks:     101 KB
        Total in use:           64278 KB 100%
        Total free:               101 KB 0%
        Total size:             64380 KB
Memory accounted for:
        Total accounted:         3668 KB
        memPoolAlloc calls: 203653
        memPoolFree calls: 101583
File descriptor usage for squid:
        Maximum number of file descriptors:   65536
        Largest file desc currently in use:     33
        Number of file desc currently in use:   26
        Files queued for open:                   0
        Available number of file descriptors: 65510
        Reserved number of file descriptors:   100
        Store Disk files open:                   0
        IO loop method:                     epoll
Internal Data Structures:
         50610 StoreEntries
            27 StoreEntries with MemObjects
            26 Hot Object Cache Items
         50583 on-disk objects
root@alwi:~#

No comments:

Post a Comment

Give Me Your Comment, No SPAM No JUNK:

Posting Terbaru

 

Pengikut Blog Ini