banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix Xin góp ý Tuning Squid Proxy - Centos 5.8 !  XML
  [Question]   Xin góp ý Tuning Squid Proxy - Centos 5.8 ! 24/11/2012 09:27:28 (+0700) | #1 | 271258
[Avatar]
yeucodon
Member

[Minus]    0    [Plus]
Joined: 22/03/2008 11:25:51
Messages: 39
Offline
[Profile] [PM]
_ Mở Đầu:

Em đang triển khai dịch vụ squid proxy và trong quá trình tuning để đạt hiệu suất cao cho squid . Hiện còn nhiều thiếu xót mong anh em có thể góp y giúp mình nha .

_ Thông Tin:
CPU : Xeon E504 2Ghz
Ram : 4GB
HDD : Sata WD 150GB ( 8Gb Swap & 100Gb / )
OS : CentOS 5.8
Squid Proxy : V2.6

Mình cấu hình mong muốn đáp ứng được cho khoản 600 user

_ Tình Trạng
_ Tốc độ không cao
_ Load trang chủ hơi chậm ( các trang con nhanh hơn )


_ Squid.conf

########################################################
# Theo meo cua anh myquartz
wwwect_program /opt/www.pl
wwwect_children 5

#Memory
cache_mem 2 GB
maximum_object_size 100 MB
maximum_object_size_in_memory 2 MB
store_avg_object_size 2 GB
wwwector_bypass on

#HDD
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
cache_dir ufs /home/squid 70000 16 256
logfile_rotate 14
debug_options ALL,1
cache_log /home/squid/log/cache.log
cache_store_log none
access_log /home/squid/log/access.log squid


#other
max_filedesc 8192 # Theo anh conmale
max_open_disk_fds 8192 # ' '
dns_nameservers ISP
cache_swap_low 95
cache_swap_high 98

# To disable caching for specific file extension, use the following directives, place them at appropriate location.
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \? \.flv
no_cache deny QUERY

acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
visible_hostname xxx.com
half_closed_clients off
server_persistent_connections off
client_persistent_connections off


refresh_pattern -i \.flv$ 10080 90% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern -i \.mp3$ 10080 90% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern -i \.mp4$ 10080 90% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern -i \.swf$ 10080 90% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern -i \.gif$ 10080 90% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern -i \.jpg$ 10080 90% 10080
refresh_pattern -i \.jpeg$ 10080 90% 10080
refresh_pattern -i \.exe$ 10080 90% 10080 override-expire override-lastmod reload-into-ims

# 1 year = 525600 mins, 1 month = 10080 mins, 1 day = 1440
refresh_pattern (get_video\?|videoplayback\?|videodownload\?|\.flv?) 10080 90% 10080 ignore-private override-expire override-lastmod reload-into-ims
refresh_pattern (get_video\?|videoplayback\?id|videoplayback.*id|videodownload\?|\.flv?) 10080 90% 10080 ignore-private override-expire override-lastmod reload-into-ims
refresh_pattern \.(ico|video-stats) 10080 90% 10080 override-expire ignore-private ignore-auth override-lastmod
refresh_pattern \.etology\? 10080 90% 10080 override-expire ignore-no-cache
refresh_pattern \.adtology\? 10080 90% 10080 override-expire ignore-no-cache
refresh_pattern ^.*safebrowsing.*google 10080 90% 10080 override-expire ignore-no-cache ignore-private ignore-auth
refresh_pattern ^http://((cbk|mt|khm|mlt)[0-9]?)\.google\.co(m|\.uk) 10080 90% 10080 override-expire
refresh_pattern photobucket.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png) 10080 90% 10080 override-expire
refresh_pattern vid\.akm\.dailymotion\.com.*\.on2\? 10080 90% 10080 ignore-no-cache override-expire override-lastmod
refresh_pattern mediafire.com\/images.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png) 10080 90% 10080 reload-into-ims override-expire ignore-private
refresh_pattern ^http:\/\/images|pics|thumbs[0-9]\. 10080 90% 10080 reload-into-ims override-expire
refresh_pattern ^http:\/\/www.bongda.com.*\/ 10080 90% 10080 reload-into-ims override-expire
refresh_pattern ^http://v\.clip\.vn/get_video\/([a-zA-Z0-9]) 10080 90% 10080 override-expire ignore-private ignore-auth override-lastmod

#images facebook
refresh_pattern -i \.facebook.com.*\.(jpg|png|gif) 10080 90% 10080 override-expire
refresh_pattern -i \.fbcdn.net.*\.(jpg|gif|png|swf|mp3) 10080 90% 10080 override-expire
refresh_pattern static\.ak\.fbcdn\.net*\.(jpg|gif|png) 10080 90% 10080 override-expire
refresh_pattern ^http:\/\/profile\.ak\.fbcdn.net*\.(jpg|gif|png) 10080 90% 10080 override-expire

#All File
refresh_pattern -i \.(3gp|7z|ace|asx|bin|deb|divx|dvr-ms|ram|rpm|exe|inc|cab|qt) 10080 90% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern -i \.(rar|jar|gz|tgz|bz2|iso|m1v|m2(v|p)|mo(d|v)|arj|lha|lzh|zip|tar) 10080 90% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern -i \.(jp(e?g|e|2)|gif|pn[pg]|bm?|tiff?|ico|swf|dat|ad|txt|dll) 10080 90% 10080
refresh_pattern -i \.(avi|ac4|mp(e?g|a|e|1|2|3|4)|mk(a|v)|ms(i|u|p)|og(x|v|a|g)|rm|r(a|p)m|snd|vob) 10080 90% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern -i \.(pp(t?x)|s|t)|pdf|rtf|wax|wm(a|v)|wmx|wpl|cb(r|z|t)|xl(s?x)|do(c?x)|flv|x-flv) 10080 90% 10080 override-expire override-lastmod reload-into-ims

refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern ^ftp: 10080 95% 10080 override-lastmod reload-into-ims
refresh_pattern . 1400 40% 10080


########################################################

p/s: Do em bỏ vào đoạn quocte không được nên mod thông cảm giúp em nha.

sống trong đời sống, cần có một tấm lòng
[Up] [Print Copy]
  [Question]   Xin góp ý Tuning Squid Proxy - Centos 5.8 ! 24/11/2012 17:18:25 (+0700) | #2 | 271269
[Avatar]
yeucodon
Member

[Minus]    0    [Plus]
Joined: 22/03/2008 11:25:51
Messages: 39
Offline
[Profile] [PM]
anh conmale ơi anh chỉnh giúp em 1 chút với ạ . Mấy bạn giúp mình với .
sống trong đời sống, cần có một tấm lòng
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|