khan.chan {at} enissue.com
原文地址: http://enissue.com/archive/48
硬件需求:
- SCSI 寻道时间|转速
- RAM 最重要
- 建议 不用RAID
系统要求:
- 推荐FreeBSD
- RHEL 4
- 疑问: Squid 2.X能够使用线程来完成AIO,性能表现也要优于以前的方式,不过大部分人都是推荐FreeBSD, 原因我还是不很清晰. Kqueue比Epoll好吗?
Cache per request:
A cache with one disk has to seek at least once per request (ignoring RAM caching of the disk and inode update times).
If you have only one disk, the formula for working out seeks per second (and hence requests per second) is quite simple:
- requests per second = 1000/seek time
- requests per second = 1000/seek time/(number of disks)
- 寻道时间和硬盘数影响requests per second !
Resource:
A cache with one disk has to seek at least once per request (ignoring RAM caching of the disk and inode update times).
If you have only one disk, the formula for working out seeks per second (and hence requests per second) is quite simple:
Version: 2.6 _反向代理_RHEL 4
Config.sh
–enable-large-cache-files –with-large-files
–enable-kill-parent-hack –disable-arp-acl
–disable-deplay-pools –disable-ident-lookups
–disable-mem-gen-trace –disable-useragent-log
–enable-epoll –enable-snmp
–enable-async-io=100
–enable-useragent-log –enable-referer-log
–enable-dlmalloc
–with-pthreas –enable-epoll –enable-storeio=”aufs,coss,diskd,ufs”
–enable-stacktrace –enable-removal-policies=”heap,lru”
–enable-deplay-pools –disable-internal-dns
–enable-default-err-language=Simplify_Chinese
–enable-err-languages=”Simplify_Chinese English”
Ps: ChinaCache squid V 2.5
–prefix=/usr/local/squid –enable-epoll –disable-ident-lookups –enable-async-io=160 –enable-storeio=ufs,aufs,diskd –enable-snmp –enable-cache-digests –enable-useragent-log –enable-referer-log –enable-kill-parent-hack –enable–internal-dns
总结: –enable-dlmalloc
–enable-async-io=160 等同于下面三个参数
–with-aufs-threads=N_THREADS –with-pthreads –enable-storeio=afs,aufs
–enable-removal-policies=”heap,lru”
cache_dir aufs /data/cache1 28000 16 256
cache_dir aufs /data/cache2 28000 16 256
cache_mem 1768 MB
cache_swap_low 70
cache_swap_high 80
maximum_object_size 204800 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 102400 KB
cache_replacement_policy lru
memory_replacement_policy lru
#设定snmp端口
snmp_port 3401
emulate_httpd_log on
logformat combined %>a %ui %un [%tl] “%rm %ru HTTP/%rv” %Hs %h” “%{User-Agent}>h” %Ss:%Sh
cache_log /patch/logs/cache.log
cache_store_log none
acl QUERY urlpath_regex cgi-bin /?
cache deny QUERY
# Vary: Accept-Encoding apache mod_deflate
cache_vary on
#设定icp规则,icp用于实现squid的cache共享
icp_port 3030
udp_incoming_address IP(other cache server)
log_icp_queries on
#设定squid sibling(同级协作squid)
cache_peer IP(other cache server) sibling 80 3030 proxy-only
Trackback URL