1
28 Proxy Server 28-1 Proxy proxy Server rpm qa grep squid Linux Proxy Proxy Proxy Proxy Proxy Request Proxy Proxy Proxy RedHat Linux Fedora #mount /mnt/cdrom squid squid Proxy #cd /mnt/cdrom/redhat/rpms #rpm ivh squid-** Proxy Proxy /etc/rc.d/init.d/squid start 28-1
Proxy Server 28 Proxy http://www.squid-cache.org/ Squid Proxy Proxy Proxy Proxy Proxy Proxy Proxy cache Proxy Hierarchy Proxy B Proxy CProxy D Proxy A BCD Proxy BCD Proxy A 28-2
理 理 理 理 路 28-3
Proxy Server 28 Proxy setup System services squid Proxy 28-4
Proxy http ftp gopher Proxy Unix Squid Squid httpsslftpgopherpop3smtp() Proxy Proxy PIII866 CPU 512MB MAXTOR 40GB Proxy vi /etc/squid/squid.conf Proxy /etc/squid errors errors /usr/lib/squid/errors/traditional_chinese Mib.txt SQUID-MIB Mime.conf squid mine Squid.conf squid Squid.conf.default squid 28-5
Proxy Server 28 Proxy /etc/squid/squid.conf 28-6
28-7
Proxy Server 28 28-8
28-9
Proxy Server 28 28-10
28-2 Proxy Proxy /etc/squid/squid.conf Proxy 1457 http_access deny all http_access allow all Proxy 28-11
Proxy Server 28 1422 1458 Proxy http_access deny all 1457 http_access deny all http_access allow all Proxy 1095 1117 Proxy Proxy LRULeast Recently Used 1117 28-12
1095 1117 Proxy Proxy Proxy 2 Hierarchy Proxy flash.aasir.com Proxy CProxy D Proxy aasir.com flash.aasir.comcd Proxy flash.aasir.comcd Proxy aasir.com 28-13
Proxy Server 28 理 理 路 Proxy Proxy IE Proxy flash.aasir.com Proxy flash.aasir.com Proxy 28-14
Internet 28-15
Proxy Server 28 Proxy Proxy flash.aasir.com 3128 3128 flash.aasir.com Proxy Proxy Proxy 28-16
28-3 Proxy Proxy 22 48 # 3128 Proxy flash.aasir.com Squid Proxy Proxy Request 146 parent 147 148 Proxy 28-17
Proxy Server 28 251 252 Proxy Cache.edu parent.foo.net Proxy!not 405 8MB CPU 28-18
CPU Cache cache CPU CPU Cache Cache L1 Cache L2 CPU 1000 度 423 424 cache_swap_low cache_swap_high 5%() 28-19
Proxy Server 28 439 disk 4096K(hit ratio) 519 lru lru heap GDSF heap LFUDA heap LRU 602 cache_dir ufs /var/spool/squid /var/spool/squid 100 100MB 16 16 256 ufs squid I/O (Linux Solaris) aufs cache_dir 28-20
/var/spool/squid 16 /var/spool/squid 00 256 609 617 cache cache 627 none 28-21
Proxy Server 28 Squid LRU Cache LRU Cache reference_age LRU 1 week 1 year 1117 4 months 28-22
1254 Proxy 1day 1440 1300 timeout Proxy timeout (Access Control list,acl) 1320 src( source) Proxy IP 1321 src( source) Proxy 1322 dst( destination) Proxy ( IP ) aclname acltype (access control type) Proxy (access control 28-23
Proxy Server 28 list,acl) acl acl() 61.218.29.0 Proxy flash acl 255.255.255.248 61.218.29.0 61.218.29.7 IP Proxy 28-24
ACL acl acl acl acl src IP Proxy Server acl acl src IP / 路 理 28-25
Proxy Server 28 1422 http http http_access deny all http_access deny all http_access allow all 1458 http_access allow flash flash 61.218.29.0/61.218.29.7 1539 Proxy Webmaster root 1639 httpd 28-26
1704 1713 DNS.cache cache miss cache CPU LRU FIFO chace LRU (temporal locality) (FIFO) Cache 28-27
Proxy Server 28 cache cache cache cache cache cache dirty bit dirty bit=1 dirty bit =0. (Secondary storage) () (relocation) TLB(translation lookaside buffer) () tarp V VALID i INVALID (v dirty bit=1 I dirty bit =0)) 28-28
. miss (page fault) page fault CPU LRUFIFOOPT LRU (temporal locality) (FIFO) OPT 28-29
Proxy Server 28 OPT Write back. D (page fault) Trap() D D I v 邏 參 28-30
.LRU 3 1 2 miss,,,,, miss page fault()miss Hit * page. LRU HIT,, Hit ratio 2/8=0.25 略 料 料 料 不 兩 28-31
Proxy Server 28.FIFO 3 1 2 miss,,,,, miss page fault(). * page FIFO HIT() Hit ratio 3/8=0.375 略 料 料 料 不 28-32
.OPT 3 1 2 miss,,,,, miss page fault(). * page. opt HIT,, Hit ratio 3/8=0.375 略 料 料 料 不 28-33
Proxy Server 28 OPT (CPU ) LRU LRU FIFO CPU Hit ratio 28-34
1. Proxy http ftp gopher Proxy Unix Squid Squid httpsslftpgopherpop3smtp() Squid? (A). News (B). HTTP (C). DNS (D). FTP 2. Proxy? Proxy B Proxy CProxy D Proxy A BCD Proxy BC D Proxy A (A). (B). (C). Hierarchy (D). 3. Squid Proxy? (A). (B). sibling 28-35
Proxy Server 28 (C). parent (D). 4.? (A). Upgrade our network (B). Route all Web surfing through a Squid server (C). Route the boss s mail over a different subnet (D). Reconfigure our DNS servers to increase their local cache 5. CPU CPU Cache cache CPU CPU Cache Cache L1 Cache L2 CPU 1000? (A). (B). (C). (D). 6.? OPT (CPU ) LRU LRU FIFO (A). 28-36
(B). (C). (D). 7.? (Secondary storage)( ) (A). SWAP (B). LRU (C). MBR (D). 1.A,C 2.C 3.C 4. B 5. B 6. B 7. D 28-37