Announcement

Kami akan melakukan migrasi forum, berita selengkapnya baca disini

#1 22-11-2009 17:28:29

bodsink
2 dB
Registered: 27-09-2007
Posts: 21

Memory squid overload

Saya Install squid di debian lenny, setiap 2-3 hari momorynya slalu over load, jadi setiap 2-3 hari squid selalu di restart, yang akses ke squid 50 user,  spect kompinya sepreti berikut

#cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz
stepping        : 13
cpu MHz         : 1799.997
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good pni monitor ds_cpl est tm2 ssse3 cx16 xtpr lahf_lm
bogomips        : 3603.64
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz
stepping        : 13
cpu MHz         : 1799.997
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good pni monitor ds_cpl est tm2 ssse3 cx16 xtpr lahf_lm
bogomips        : 3600.09
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual

#cat /proc/meminfo
MemTotal:      2055384 kB
MemFree:        938508 kB
Buffers:        145564 kB
Cached:         666232 kB
SwapCached:          0 kB
Active:         400336 kB
Inactive:       616656 kB
SwapTotal:     3229024 kB
SwapFree:      3229024 kB
Dirty:            3460 kB
Writeback:           0 kB
AnonPages:      205240 kB
Mapped:          19820 kB
Slab:            76184 kB
SReclaimable:    66132 kB
SUnreclaim:      10052 kB
PageTables:       7728 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
WritebackTmp:        0 kB
CommitLimit:   4256716 kB
Committed_AS:   420464 kB
VmallocTotal: 34359738367 kB
VmallocUsed:     11456 kB
VmallocChunk: 34359726539 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
HugePages_Surp:      0
Hugepagesize:     2048 kB

Kernel yang di pakai amd64
uname -a
Linux * 2.6.26-2-amd64 #1 SMP Thu Nov 5 02:23:12 UTC 2009 x86_64 GNU/Linux


Config squidnya seperti dibawah

Code:

http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
#minimum_object_size 512 bytes
cache deny QUERY
acl apache rep_header Server ^Apache
access_log /var/log/squid/access.log 
refresh_pattern ^ftp: 40320 95% 241920 reload-into-ims
refresh_pattern . 120 80% 14400 reload-into-ims override-lastmod
quick_abort_min 0
quick_abort_max 0
quick_abort_pct 98
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320
refresh_pattern -i google.com 1440 20% 10080 override-expire override-lastmod reload-into-ims ignore-reload
refresh_pattern -i facebook.com 1440 20% 10080 override-expire override-lastmod reload-into-ims ignore-reload

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 # https, snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
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 localhost
acl lan src 192.168.1.0/24
acl lan src 192.168.11.0/24 
acl lan src 192.168.10.0/24 
acl blokpornourl dstdomain "/etc/squid/db/blok.txt"
acl blokkeyword url_regex -i "/etc/squid/db/blokeyword.txt"

http_access allow localhost
http_access deny blokpornourl
http_access deny blokkeyword
http_access allow lan
http_access deny all
http_reply_access allow all
always_direct allow all
icp_access allow all

# --BEGIN-- videocache config for squid
url_rewrite_program /usr/bin/python /usr/share/videocache/videocache.py
url_rewrite_children 7
acl videocache_allow_url url_regex -i \.youtube\.com\/get_video\?
acl videocache_allow_url url_regex -i \.googlevideo\.com\/videoplayback \.googlevideo\.com\/videoplay \.googlevideo\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.com\/videoplayback \.google\.com\/videoplay \.google\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.[a-z][a-z]\/videoplayback \.google\.[a-z][a-z]\/videoplay \.google\.[a-z][a-z]\/get_video\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/videoplayback\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/videoplay\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/get_video\?
acl videocache_allow_url url_regex -i proxy[a-z0-9\-][a-z0-9][a-z0-9][a-z0-9]?\.dailymotion\.com\/
acl videocache_allow_url url_regex -i vid\.akm\.dailymotion\.com\/
acl videocache_allow_url url_regex -i [a-z0-9][0-9a-z][0-9a-z]?[0-9a-z]?[0-9a-z]?\.xtube\.com\/(.*)flv
acl videocache_allow_url url_regex -i bitcast\.vimeo\.com\/vimeo\/videos\/
acl videocache_allow_url url_regex -i va\.wrzuta\.pl\/wa[0-9][0-9][0-9][0-9]?
acl videocache_allow_url url_regex -i \.files\.youporn\.com\/(.*)\/flv\/
acl videocache_allow_url url_regex -i \.msn\.com\.edgesuite\.net\/(.*)\.flv
acl videocache_allow_url url_regex -i media[a-z0-9]?[a-z0-9]?[a-z0-9]?\.tube8\.com\/ mobile[a-z0-9]?[a-z0-9]?[a-z0-9]?\.tube8\.com\/
acl videocache_allow_url url_regex -i \.mais\.uol\.com\.br\/(.*)\.flv
acl videocache_allow_url url_regex -i \.video[a-z0-9]?[a-z0-9]?\.blip\.tv\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram)
acl videocache_allow_url url_regex -i video\.break\.com\/(.*)\.(flv|mp4)
acl videocache_allow_dom dstdomain .mccont.com dl.redtube.com .cdn.dailymotion.com
acl videocache_deny_url url_regex -i http:\/\/[a-z][a-z]\.youtube\.com http:\/\/www\.youtube\.com
url_rewrite_access deny videocache_deny_url
url_rewrite_access allow videocache_allow_url
url_rewrite_access allow videocache_allow_dom
redirector_bypass on
# --END-- videocache config for squid

visible_hostname proxy.*
coredump_dir /var/spool/squid
cache_mem 64 MB
cache_mgr *@bodsink
error_directory /usr/share/squid/errors/Indonesia

cache_replacement_policy heap GDSF
memory_replacement_policy heap GDSF
cache_swap_low 90
cache_swap_high 95
maximum_object_size 131072 KB
maximum_object_size_in_memory 64 KB
cache_effective_user proxy
cache_effective_group proxy
cache_dir diskd /cache1 12600 29 256 Q1=64 Q2=72
cache_dir diskd /cache2 12600 29 256 Q1=64 Q2=72
cache_dir diskd /cache3 12600 29 256  Q1=64 Q2=72
cache_dir diskd /cache4 12600 29 256 Q1=64 Q2=72

Sewaktu memory overload swapnya tidak bekerja sama sekali,
mohon bantuan rekean2


thanks

Last edited by bodsink (22-11-2009 17:29:15)

Offline

 

#2 22-11-2009 21:47:27

si_faisal
Moderator
From: Purwokerto & Sukabumi
Registered: 24-06-2008
Posts: 2081
Website

Re: Memory squid overload

coba kecilin cache mem nya jadi 6 MB atau 8 Mb

cache mem objeknya juga coba dikecilin

smile

Offline

 

#3 22-11-2009 22:39:58

bodsink
2 dB
Registered: 27-09-2007
Posts: 21

Re: Memory squid overload

si_faisal wrote:

coba kecilin cache mem nya jadi 6 MB atau 8 Mb

cache mem objeknya juga coba dikecilin

smile

terima kasih, telah saya ganti seperti petunjuknya mas faisal, mungkin perlu memonitoring beberapa hari untuk memastikan memorynya tidak overload 

smile

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB