Tampilkan postingan dengan label Linux. Tampilkan semua postingan

"Salam blogger!!" Setelah sobat menyelesaikan tugas di Cara Install Proxy Lusca FMI di Ubuntu 10.10 64 Bit "wakakak kaya guru ni pake tugas segala" mari Kita melanjutkan artikel yang tertunda yaitu Cara Install DNS Unbound High Performance Squid Lusca FMI  di Ubuntu Server
Fungsinya agar Squid Lusca FMI kita lebih optimal menerima request dari user yang masuk ke squid langsung saja ke langkah-langkahnya :
Warning : Install DNS unbound Proxy ini saya lakukan Via PuTTy
Sebelum menginstall DNS Unbound ini sebaiknya di OPTIMALKAN dahulu Squid ubuntu kita dengan Cara :
OPTIMALKAN partisi btrfs nya :

# lsmod |grep -i btrfs

# nano /etc/fstab

/cache btrfs noatime,compress,noacl 0 2

OPTIMALKAN juga kernelnya :

default FD 1024
cek di console

# ulimit -n

cara merubah :
# ulimit -HSn 65536

# echo “root soft nofile 65536″ >> /etc/security/limits.conf
# echo “root hard nofile 65536″ >> /etc/security/limits.conf

# nano /etc/pam.d/common-session
tambahkan :
session required pam_limits.so

# modprobe ip_conntrack

kemudian tambahkan ip_contrack di /etc/modules

# nano /etc/modules

Tambahkan kalimat berikut :

ip_conntrack
Selanjutnya >>>>>>>>>
1. Install DNS Unbound
Silah copas kode dibawah ini dan pastekan di terminal PuTTY sobat (alangkah baiknya di copy dulu di notepad setelah itu baru di paste di terminal putty)

apt-get install unbound -y && cd /etc/unbound && wget  ftp://FTP.INTERNIC.NET/domain/named.cache && unbound-control-setup && chown unbound:root unbound_* && chmod 440 unbound_*

2. Copy file unbound.conf dengan Program WinSCP
Jika sobat belum punya silahkan download dulu disini unbound.conf
jangan lupa di extarct pake winrar terus Sobat pastekan file Unbound.conf yang telah di download ke /etc/unbound/
stelah itu -----------reboot ubuntu---------- sobat. [#reboot]
3. Periksa Status Unbound yang sudah terinstall sobat dengan cara :
---------------------------------
unbound-control status
unbound-control stats
---------------------------------
4. Restart Unbound Service
---------------------------------
/etc/init.d/unbound restart
---------------------------------
jika tulisan sudah [OK] berarti sobat berhasil menngInstall DNS Unbound High Performance di ubuntu dan untuk setting mikrotiknya silahkan download Setting Firewall dan Mangle Mikrotik
Semoga bermanfaat,.. untuk Monitoring Lusca FMI berlanjut ke postingan berikutnya,..! salam sukses.
Description: [TUTORIAL] Install DNS Unbound High Performance Squid Lusca FMI di Ubuntu Server
Rating: 4.5
Reviewer: Unknown
ItemReviewed: [TUTORIAL] Install DNS Unbound High Performance Squid Lusca FMI di Ubuntu Server

Berikut ini adalah beberapa perintah yang dapat Anda lakukan untuk melihat performansi squid proxy server anda. Perintah ini dapat anda buat dalam bentuk file berextensi ".sh" dan letakkan di direktori /usr/sbin, sehingga anda tidak perlu menghapalkan syntax2 tersebut. Cukup membantu untuk para network administrator atau teknisi.

1. Perintah pertama

squidclient -h localhost -p 8080 mgr:info

Sesuaikan port 8080 dengan port squid Anda.
Hasilnya:

    HTTP/1.0 200 OK
    Server: squid/2.7.STABLE7
    Date: Fri, 20 Aug 2010 12:29:34 GMT
    Content-Type: text/plain
    Expires: Fri, 20 Aug 2010 12:29:34 GMT
    X-Cache: MISS from proxy1.netsolusindo.com
    X-Cache-Lookup: MISS from proxy1.netsolusindo.com:8080
    Via: 1.0 proxy1.netsolusindo.com:8080 (squid/2.7.STABLE7)
    Connection: close

    Squid Object Cache: Version 2.7.STABLE7
    Start Time:     Wed, 18 Aug 2010 12:00:39 GMT
    Current Time:   Fri, 20 Aug 2010 12:29:34 GMT
    Connection information for squid:
            Number of clients accessing cache:      2
            Number of HTTP requests received:       1179697
            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:   405.5
            Average ICP messages per minute since start:    0.0
            Select loop called: 22503753 times, 7.756 ms avg
    Cache information for squid:
            Request Hit Ratios:     5min: 35.1%, 60min: 35.9%
            Byte Hit Ratios:        5min: 16.9%, 60min: 20.7%
            Request Memory Hit Ratios:      5min: 0.2%, 60min: 1.2%
            Request Disk Hit Ratios:        5min: 77.8%, 60min: 75.0%
            Storage Swap size:      27342220 KB
            Storage Mem size:       6136 KB
            Mean Object Size:       18.78 KB
            Requests given to unlinkd:      0
    Median Service Times (seconds)  5 min    60 min:
            HTTP Requests (All):   0.61549  0.52331
            Cache Misses:          1.05672  0.80651
            Cache Hits:            0.10857  0.13498
            Near Hits:             0.64968  0.52331
            Not-Modified Replies:  0.17711  0.05951
            DNS Lookups:           0.04854  0.04433
            ICP Queries:           0.00000  0.00000
    Resource usage for squid:
            UP Time:        174534.204 seconds
            CPU Time:       3182.603 seconds
            CPU Usage:      1.82%
            CPU Usage, 5 minute avg:        5.86%
            CPU Usage, 60 minute avg:       3.71%
            Process Data Segment Size via sbrk(): 176960 KB
            Maximum Resident Size: 693520 KB
            Page faults with physical i/o: 920117
    Memory usage for squid via mallinfo():
            Total space in arena:  176960 KB
            Ordinary blocks:       165139 KB  80926 blks
            Small blocks:               0 KB      0 blks
            Holding blocks:         10020 KB      7 blks
            Free Small blocks:          0 KB
            Free Ordinary blocks:   11820 KB
            Total in use:          175159 KB 94%
            Total free:             11820 KB 6%
            Total size:            186980 KB
    Memory accounted for:
            Total accounted:       102900 KB
            memPoolAlloc calls: 224927337
            memPoolFree calls: 221979688
    File descriptor usage for squid:
            Maximum number of file descriptors:   1024
            Largest file desc currently in use:    638
            Number of file desc currently in use:  477
            Files queued for open:                   0
            Available number of file descriptors:  547
            Reserved number of file descriptors:   100
            Store Disk files open:                   1
            IO loop method:                     epoll
    Internal Data Structures:
            1456421 StoreEntries
               520 StoreEntries with MemObjects
               449 Hot Object Cache Items
            1456302 on-disk objects

2. Perintah kedua

tail -f /var/log/squid/access.log | ccze

Sesuaikan /var/log/squid/access.log dengan direktori log squid Anda.

3. Perintah ketiga

squidclient -h localhost -p 8080 mgr:info | grep Hit

Sama seperti perintah pertama, sesuaikan -p 8080 dengan port squid Anda.
Hasilnya:
Request Hit Ratios:     5min: 32.1%, 60min: 35.4%
        Byte Hit Ratios:        5min: 14.9%, 60min: 17.4%
        Request Memory Hit Ratios:      5min: 3.0%, 60min: 1.0%
        Request Disk Hit Ratios:        5min: 84.6%, 60min: 77.2%
        Cache Hits:            0.15888  0.19742
        Near Hits:             1.24267  0.72387

SELAMAT MENCOBA . . .
Description: [TUTORIAL] Perintah monitoring squid proxy
Rating: 4.5
Reviewer: Unknown
ItemReviewed: [TUTORIAL] Perintah monitoring squid proxy

Proxy Server dengan OS ubuntu server kadang menjadi momok tersendiri karena proxy server akan menggunakan memory buat OS, metadata, object_hit_memory, tcp buffer.
Sebenarnya bukan OS Ubuntu Server saja, OS yg lainnya juga begitu.
Secara logika lebih baik kita  mengecilkan 'cache_mem' pada squid.conf - nya, itu yang paling masuk akal. Akan tetapi kadang kita menginginkan kinerja proxy server yang optimal (atau kadang enggak tau...ehehee..) sehingga kita bikin cache_mem sebesar RAM yg kita gunakan untuk proxy server.

1. clear pagecache
echo 1 > /proc/sys/vm/drop_caches
2. clear inodes dan dentries
echo 2 > /proc/sys/vm/drop_caches
3. clear pagecache, inodes & dentries
echo 3 > /proc/sys/vm/drop_caches
Untuk clear secara periodik, kita bisa membuat 'cron' dengan salah satu perintah di atas:
crontab -e
* */2 * * * echo 3 > /proc/sys/vm/drop_caches
Bentuk 'cron' di atas adalah untuk clear pagecache, inodes & dentries setiap 2 jam sekali.
Contoh lain :
crontab -e
0 6,18 * * * sync
1 6,18 * * * echo 3 > /proc/sys/vm/drop_caches

Bentuk 'cron' di atas adalah untuk clear pagecache, inodes & dentries setiap jam 6 pagi dan jam 6 sore.
Perhitungan cron :

* * * * * path/to/script
|  |  |  |  |_ Hari (minggu = 0, senin = 1, dst...)
|  |  |  |___ Bulan (jan = 1, feb = 2, dst...)
|  |  |_____ Tanggal (1 - 31, sesuaikan tanggal dalam bulan tsb)
|  |_______ Jam (0 - 23) |_________ menit (0 - 59)

Kode-kode yang lain :
@reboot (jalan pada waktu start up)
@yearly (jalan sekali dalam satu tahun)
@annually (sama seperti @yearly)
@monthly (jalan sekali dalam satu bulan)
@weekly (jalan sekali dalam satu minggu)
@daily (jalan sekali dalam satu hari)
@midnight (sama seperti @daily)
@hourly (jalan sekali dalam satu jam)
Contoh:
@daily echo 3 > /proc/sys/vm/drop_caches

Maka proses clear akan jalan setiap hari sekali.
Cek Usage memory :
uptime
free -m

# squidclient mgr:info |grep "Storage Mem size:"
# echo 3 > /proc/sys/vm/drop_caches
# squidclient mgr:info |grep "Storage Mem size:"
Description: [TUTORIAL] CLEAR CACHE_MEM PROXY SERVER
Rating: 4.5
Reviewer: Unknown
ItemReviewed: [TUTORIAL] CLEAR CACHE_MEM PROXY SERVER
Welcome to My Blog

Popular Post

Labels

Followers

- Copyright © 2013 shad0w-share | Designed by Johanes Djogan -