Proxy Squid 2.7 HIT Performance

Short URL

Saya punya settingan squid 2.7 dengan nilai request HIT yang bagus, saya tidak akan membahas bagaimana cara menginstallnya. Untuk lebih jauh cara melakukan Install Proxy Squid bisa dilihat di artikel Membuat Proxy Server (squid) di Linux Fedora atau Proxy Squid di Windows

###########################################
#      HIGH PERFORMANCE SQUID 2.7
#        paidjo.com IT Infra
#     Config date : 6 Desember 2010
###########################################

# ACCESS CONTROLS
# —————————————————————————–

acl QUERY urlpath_regex -i cgi-bin ? .php$ .asp$ .shtml$ .cfm$ .cfml$ .phtml$ .php3$ localhost
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl SSL_ports port 443 563 81
acl Safe_ports port 21 70 80 210 280 443 488 563 591 631 777 901 81 3128 1025-65535
acl CONNECT method CONNECT
acl purge method PURGE

http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access deny all

# NETWORK OPTIONS
# —————————————————————————–

http_port 3121
zph_mode tos
zph_local 0×30
zph_parent 0
zph_option 136

icp_port 0
htcp_port 0
icp_access allow all
htcp_access allow all

snmp_port 0
snmp_access allow all

# OPTIONS WHICH AFFECT THE CACHE SIZE
# —————————————————————————–

cache_mem 8 MB
maximum_object_size_in_memory 32 KB
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA
cache_dir aufs /var/spool/squid/cache1 7500 16 256
cache_dir aufs /var/spool/squid/cache2 7500 16 256
cache_dir aufs /var/spool/squid/cache3 7500 16 256
store_dir_select_algorithm least-load
maximum_object_size 128000 KB
cache_swap_low 90
cache_swap_high 95
#update_headers off

# LOGFILE PATHNAMES AND CACHE DIRECTORIES
# —————————————————————————–

access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
logfile_rotate 5
log_ip_on_direct off
log_icp_queries off
buffered_logs off
netdb_filename none
emulate_httpd_log on

# OPTIONS FOR TUNING THE CACHE
# —————————————————————————–

cache deny QUERY
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i .(gif|png|jp?g|ico|bmp|tiff?)$ 10080 95% 43200
refresh_pattern -i .(rpm|cab|deb|exe|msi|msu|zip|tar|gz|tgz|rar|bin|7z|doc?|xls?|ppt?|pdf|nth|psd|sis)$ 10080 90% 43200
refresh_pattern -i .(avi|iso|wav|mid|mp?|mpeg|mov|3gp|wm?|swf|flv|x-flv|axd)$ 43200 95% 432000
refresh_pattern -i .(html|htm|css|js)$ 1440 75% 40320
refresh_pattern -i .index.(html|htm)$ 0 75% 10080
refresh_pattern -i (/cgi-bin/|?) 0 0% 0
refresh_pattern . 1440 90% 10080

quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 98
store_avg_object_size 13 KB

#refresh_pattern ((facebook.com)|(69.63.181.11|69.63.181.12|69.63.1 89.11|69.63.189.16)).*.(jpg|png|gif|swf|mp3|mp4|m pg|3gp|flv|swf|wmv|zip|rar) 12960 99% 12960
refresh_pattern -i .facebook.com.*.(jpg|gif|png|swf|wav|mp(e?g|a|e|1|2|3|4)|3gp|flv|swf|wmv|zip|rar) 12960 999999% 129600
refresh_pattern -i .fbcdn.net.*.(jpg|gif|png|swf|wav|mp(e?g|a|e|1|2|3|4)|3gp|flv|swf|wmv|zip|rar) 12960 999999% 129690
refresh_pattern -i .zynga.com.*.(jpg|gif|png|swf|wav|mp(e?g|a|e|1|2|3|4)|3gp|flv|swf|wmv) 12960 999999% 129609
refresh_pattern -i .crowdstar.com.*.(jpg|gif|png|swf|wav|mp(e?g|a|e|1|2|3|4)|3gp|flv|swf|wmv) 12960 999999% 129609
refresh_pattern ^http://static.ak.fbcdn.net*.(jpg|gif|png|mp(e?g|a|e|1|2|3|4)|3gp|flv|swf|wmv) 129600 999999% 129600
refresh_pattern ^http://videoxl.l[0-9].facebook.com/(.*)(3gp|flv|swf|wmv|mp(e?g|a|e|1|2|3|4)) 129600 999999% 129600
refresh_pattern ^http://*.channel.facebook.com/(.*)(js|css|swf|jpg|gif|png|mp(e?g|a|e|1|2|3|4)) 129600 999999% 129600
refresh_pattern ^http://video.ak.facebook.com*.(3gp|flv|swf|wmv|mp(e?g|a|e|1|2|3|4)) 129600 999999% 129600
refresh_pattern ^http://photos-[a-z].ak.fbcdn.net/(.*)(css|swf|jpg|gif|png|mp(e?g|a|e|1|2|3|4)) 129600 999999% 129600
refresh_pattern ^http://profile.ak.fbcdn.net*.(jpg|gif|png) 129600 999999% 129600
refresh_pattern ^http://platform.ak.fbcdn.net/.* 720 100% 4320
refresh_pattern ^http://creative.ak.fbcdn.net/.* 720 100% 4320
refresh_pattern ^http://apps.facebook.com/.* 720 100% 4320
refresh_pattern ^http://static.ak.fbcdn.net*.(js|css|jpg|gif|png) 129600 999999% 129600
refresh_pattern ^http://statics.poker.static.zynga.com/(.*)(swf|jpg|gif|png|mp(e?g|a|e|1|2|3|4)) 129600 999999% 129600
refresh_pattern ^http://statics.poker.static.zynga.com/.* 720 100% 4320
refresh_pattern ^http://*.zynga.com*.(swf|jpg|gif|png|wav|mp(e?g|a|e|1|2|3|4)) 129600 999999% 129600
refresh_pattern ^http://*.crowdstar.com*.(swf|jpg|gif|png|wav|mp(e?g|a|e|1|2|3|4)) 129600 999999% 129600
refresh_pattern ^http://*.google-analytics.*/.* 720 100% 4320
refresh_pattern -i .kaskus.com.*.(jpg|gif|png|swf|wav|mp(e?g|a|e|1|2|3|4)|3gp|flv|swf|wmv|zip|rar) 12960 999999% 129600
refresh_pattern -i .kaskus.us.*.(jpg|gif|png|swf|wav|mp(e?g|a|e|1|2|3|4)|3gp|flv|swf|wmv|zip|rar) 12960 999999% 129600
refresh_pattern ^http://*.kaskus.us*.*(jpg|gif|png|mp(e?g|a|e|1|2|3|4)|3gp|flv|swf|wmv) 129600 999999% 129600

# HTTP OPTIONS
# —————————————————————————–

server_http11 on
collapsed_forwarding on
vary_ignore_expire on
#header_access From deny all
#header_access Server deny all
#header_access Link deny all
#header_access Via deny all
#header_access X-Forwarded-For deny all

# TIMEOUTS
# —————————————————————————–

forward_timeout 240 seconds
connect_timeout 30 second
peer_connect_timeout 5 seconds
read_timeout 600 second
request_timeout 60 second
persistent_request_timeout 60 seconds
client_lifetime 86400 second
half_closed_clients off
pconn_timeout 60 second
shutdown_lifetime 10 second

# ADMINISTRATIVE PARAMETERS
# —————————————————————————–

cache_mgr kang@paidjo.com
cache_effective_user squid
cache_effective_group squid
httpd_suppress_version_string on
visible_hostname paidjo.com

# DELAY POOL PARAMETERS
# —————————————————————————–

# ADVANCED NETWORKING OPTIONS
# —————————————————————————–

max_filedescriptors 4096

# DNS OPTIONS
# —————————————————————————–

check_hostnames off
#dns_timeout 10 seconds
#dns_nameservers 125.160.4.82 203.130.196.155 203.130.196.5 222.124.204.34 202.134.0.61 8.8.4.4 8.8.8.8
#hosts_file /etc/hosts
ipcache_size 8192
ipcache_low 90
ipcache_high 95
fqdncache_size 4096

# MISCELLANEOUS
# —————————————————————————–

memory_pools off
forwarded_for off
#reload_into_ims on
coredump_dir /var/spool/squid/cache1
pipeline_prefetch on
offline_mode off

# -=EoF=-

yang ingin download filenya disini KLIK

execute untuk membuat swap baru sesuai dengan config diatas

squid -z

Bila ada error silahkan disesuaikan bagian yang errornya..

Share and Enjoy

14 Thoughts on “Proxy Squid 2.7 HIT Performance

  1. dah saya edit lagi squidnya, tapi kok error yang sama masih muncul yak? begini pesan error yang muncul

    2011/03/26 19:37:47| parseConfigFile: squid.conf:1 unrecognized: ‘ ###########################################’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:2 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:3 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:4 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:5 unrecognized: ‘ ###########################################’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:7 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:8 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:29 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:30 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:46 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:47 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:60 unrecognized: ‘ #update_headers’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:62 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:63 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:75 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:76 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:94 unrecognized: ‘ #refresh_pattern’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:118 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:119 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:124 unrecognized: ‘ #header_access’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:125 unrecognized: ‘ #header_access’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:126 unrecognized: ‘ #header_access’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:127 unrecognized: ‘ #header_access’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:128 unrecognized: ‘ #header_access’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:130 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:131 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:144 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:145 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:153 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:154 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:156 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:157 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:161 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:162 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:165 unrecognized: ‘ #dns_timeout’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:166 unrecognized: ‘ #dns_nameservers’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:167 unrecognized: ‘ #hosts_file’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:173 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:174 unrecognized: ‘ #’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:178 unrecognized: ‘ #reload_into_ims’
    2011/03/26 19:37:47| parseConfigFile: squid.conf:183 unrecognized: ‘ #’
    FATAL: cache_dir /var/spool/squid/cache1: (2) No such file or directory
    Squid Cache (Version 2.7.STABLE5): Terminated abnormally.

  2. paidjo on 3 April 2011 at 12:04 said:

    coba cek lagi di line yang terlihat error itu.. mungkin tanda kutipnya salah seharusnya ‘ bukan `

  3. ucok on 4 May 2011 at 09:53 said:

    Pak mau tanya?, saya pake squid fro windows, yang jadi masalah thunderbird kok ndak bisa ya pak, ada solusi supaya thunderbird bisa dijalankan melalui squid?

  4. paidjo on 18 May 2011 at 07:56 said:

    coba setting dulu Network Proxynya di Firefox.. dengan ip 127.0.0.1 portnya tinggal menyesuaikan dengan settingan di proxy

  5. hi,

    i found your post regarding constant TCP_MISS in a forum and i see that you have a solution.Would you mind telling me,which part in the squid.conf that i have to change in order to make my transparent proxy works like yours??FYI, im installing squid 3.1.14 on ubuntu server 11.04. thanks

  6. paidjo on 22 August 2011 at 00:27 said:

    Sebenarnya saya belum pernah mencoba squid 3 ke atas, dulu sempat hanya testing, cuma ada beberapa perbedaan yang membuat squid tidak bisa running dengan normal. Sebaiknya anda mencoba install squid 2.7 yang terkenal stabil. bahkan RIM saja menggunakan squid 2.7 untuk layanan Blackberry Internes Service nya..
    Maaf kelamaan balesnya

  7. Dhanies on 14 October 2011 at 17:43 said:

    Pak.. Tolong punya saya juga ada error nya juga di file “squid.exe.log” nya
    Pesan error nya
    ======================================================================

    2011/10/15 01:39:48| parseConfigFile: squid.conf:2 unrecognized: ‘visible_hostname=host’
    2011/10/15 01:39:48| parseConfigFile: squid.conf:4 unrecognized: ‘httpd_accel_host’
    2011/10/15 01:39:48| parseConfigFile: squid.conf:5 unrecognized: ‘httpd_accel_port’
    2011/10/15 01:39:48| parseConfigFile: squid.conf:6 unrecognized: ‘httpd_accel_with_proxy’
    2011/10/15 01:39:48| parseConfigFile: squid.conf:7 unrecognized: ‘httpd_accel_uses_host_header’

    ======================================================================
    menggunakan squid dari windows XP

  8. paidjo on 19 October 2011 at 09:53 said:

    coba dihapus atau di comment yang error diatas
    #visible_hostname=host
    #httpd_accel_host
    #httpd_accel_port
    #httpd_accel_with_proxy
    #httpd_accel_uses_host_header

  9. mario on 29 October 2011 at 18:29 said:

    Your Squid cache directories /var/spool/squid/cache1, /var/spool/squid/cache2, /var/spool/squid/cache3, /var/spool/squid/cache4, /var/spool/squid/cache5 have not been initialized.This must be done before Squid can be run.

    Kalo kluar kaya gini gimana perintah selanjutnya???

  10. cece on 8 January 2012 at 19:44 said:

    salam kenal mas mau ajuin beberapa pertanyaan nih
    1.kalo hardisk 250gb prosi dualcore ram 2gb ubuntu server 64bit
    itu rumus pembagian cache_dir aufs nya brp yah

    2.kalo cek hardisk cache penuh itu gimana yah di webmin
    3.terus beda nya logfile_rotate 1 dengan logfile_rotate 5 apa yah? arti angka 1 dan 5 itu apa yah ?
    mas ada email gak saya mau minta tolong di cek settingan squid.conf qu minta di koreksi mas

    seblum dan sesudah nya makasih yah mas

  11. paidjo on 17 January 2012 at 10:24 said:

    1. Mending samain dg konfigurasi standarnya
    2. Untuk lebih mudahnya gunakan partisi sendiri untuk cache, misalnya di /var jadi create partisi sendiri
    Kalo memang log penuh silahkan cleare log access.log cache.log
    3. Log rotate digunakan untuk pembagian file log agar tidak membekak sizenya

  12. reno on 28 August 2012 at 10:49 said:

    Gan, saya mau tanya ada yang tahukah perbandingan beberapa versi squid proxy (versi 2.4 2.5, 2.6 & 2.7)?
    Mohon informasinya gan.. Terima kasih..

  13. Azmi on 28 October 2012 at 19:30 said:

    Mas punya q kok TCP/MISS terus?

  14. paidjo on 28 October 2012 at 19:39 said:

    mungkin karena masih baru jadi belum ke save di cache nya

Leave a Reply

Your email address will not be published. Required fields are marked *

*


4 + = 11

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

[+] kaskus emoticons

Post Navigation