제가 만든 휴대용 3G/WiFi 라우터에 Squid Cache를 설정했습니다.
프록시는 작동하지만 TCP_MISS만 표시되고 매우 드물게 TCP_MEM_HIT도 표시됩니다.
나는 이것을 이전에 시도한 적이 없습니다. 여기에 내가 생각해낸 구성 파일이 있습니다.
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl localnet src 192.168.99.0/24
acl SSL_ports port 443
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
http_access allow manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow localhost
http_access deny all
http_port 3128
cache_dir aufs /var/spool/squid3 8192 16 256
maximum_object_size 512 MB
coredump_dir /var/spool/squid3
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
cache_mgr *******@*****.com
3G 스틱에 내장된 http 페이지의 파일도 캐시되지 않습니다.
구성 파일에 실수가 있었나요?
/var/spool/squid3을 설정하는 특별한 방법이 있습니까? 방금 sudo mkdir /var/spool/squid3을 사용했고 내부에 모든 비트가 생성되었습니다. 이것은 캐시.log의 출력입니다:
2013/09/04 19:13:47| Starting Squid Cache version 3.1.20 for arm-unknown-linux-gnueabihf...
2013/09/04 19:13:47| Process ID 2606
2013/09/04 19:13:47| With 65535 file descriptors available
2013/09/04 19:13:47| Initializing IP Cache...
2013/09/04 19:13:47| DNS Socket created at 0.0.0.0, FD 7
2013/09/04 19:13:47| Adding nameserver 127.0.0.1 from /etc/resolv.conf
2013/09/04 19:13:47| Adding nameserver 192.168.1.1 from /etc/resolv.conf
2013/09/04 19:13:47| Adding nameserver 192.168.1.1 from /etc/resolv.conf
2013/09/04 19:13:47| Unlinkd pipe opened on FD 12
2013/09/04 19:13:47| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2013/09/04 19:13:47| Store logging disabled
2013/09/04 19:13:47| Swap maxSize 8388608 + 262144 KB, estimated 665442 objects
2013/09/04 19:13:47| Target number of buckets: 33272
2013/09/04 19:13:47| Using 65536 Store buckets
2013/09/04 19:13:47| Max Mem size: 262144 KB
2013/09/04 19:13:47| Max Swap size: 8388608 KB
2013/09/04 19:13:47| Version 1 of swap file with LFS support detected...
2013/09/04 19:13:47| Rebuilding storage in /var/spool/squid3 (CLEAN)
2013/09/04 19:13:47| Using Least Load store dir selection
2013/09/04 19:13:47| Set Current Directory to /var/spool/squid3
2013/09/04 19:13:48| Loaded Icons.
2013/09/04 19:13:48| Accepting HTTP connections at 0.0.0.0:3128, FD 15.
2013/09/04 19:13:48| HTCP Disabled.
2013/09/04 19:13:48| Squid plugin modules loaded: 0
2013/09/04 19:13:48| Adaptation support is off.
2013/09/04 19:13:48| Ready to serve requests.
2013/09/04 19:13:48| Done reading /var/spool/squid3 swaplog (1664 entries)
2013/09/04 19:13:48| Finished rebuilding storage from disk.
2013/09/04 19:13:48| 1664 Entries scanned
2013/09/04 19:13:48| 0 Invalid entries.
2013/09/04 19:13:48| 0 With invalid flags.
2013/09/04 19:13:48| 1664 Objects loaded.
2013/09/04 19:13:48| 0 Objects expired.
2013/09/04 19:13:48| 0 Objects cancelled.
2013/09/04 19:13:48| 0 Duplicate URLs purged.
2013/09/04 19:13:48| 0 Swapfile clashes avoided.
2013/09/04 19:13:48| Took 0.85 seconds (1953.12 objects/sec).
2013/09/04 19:13:48| Beginning Validation Procedure
2013/09/04 19:13:48| Completed Validation Procedure
2013/09/04 19:13:48| Validated 3353 Entries
2013/09/04 19:13:48| store_swap_size = 19920
2013/09/04 19:13:49| storeLateRelease: released 0 objects
2013/09/04 19:50:17| Preparing for shutdown after 90 requests
2013/09/04 19:50:17| Waiting 30 seconds for active connections to finish
2013/09/04 19:50:17| FD 15 Closing HTTP connection
2013/09/04 19:50:48| Shutting down...
2013/09/04 19:50:48| basic/auth_basic.cc(97) done: Basic authentication Shutdown.
2013/09/04 19:50:48| Closing unlinkd pipe on FD 12
2013/09/04 19:50:48| storeDirWriteCleanLogs: Starting...
2013/09/04 19:50:48| Finished. Wrote 1693 entries.
2013/09/04 19:50:48| Took 0.02 seconds (102861.66 entries/sec).
CPU Usage: 3.420 seconds = 1.690 user + 1.730 sys
Maximum Resident Size: 56784 KB
Page faults with physical i/o: 404
Memory usage for squid via mallinfo():
total space in arena: 4212 KB
Ordinary blocks: 3197 KB 96 blks
Small blocks: 0 KB 1 blks
Holding blocks: 27936 KB 10 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 1014 KB
Total in use: 31133 KB 739%
Total free: 1014 KB 24%
2013/09/04 19:50:48| Open FD READ/WRITE 7 DNS Socket IPv4
2013/09/04 19:50:48| Squid Cache (Version 3.1.20): Exiting normally.
access.log의 두 줄은 다음과 같습니다.
pi@junior ~ $ sudo cat /var/log/squid3/access.log | grep 32px-Portal-puzzle
1378324277.327 203 192.168.99.74 TCP_MISS/304 263 GET http://upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/32px-Portal-puzzle.svg.png - DIRECT/91.198.174.234 text/html
1378324296.260 68 192.168.99.74 TCP_MISS/304 263 GET http://upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/32px-Portal-puzzle.svg.png - DIRECT/91.198.174.234 text/html
두 개의 서로 다른 시스템, 동일한 파일, 두 개의 누락
두 줄이 더 있는데 이상해요.
pi@junior ~ $ sudo cat /var/log/squid3/access.log | grep 16px-Portal-puzzle
1378324276.132 130 192.168.99.74 TCP_MISS/304 263 GET http://1.2.3.9/bmi/upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/16px-Portal-puzzle.svg.png - DIRECT/1.2.3.9 text/html
1378324320.926 290 192.168.99.254 TCP_MISS/200 1373 GET http://1.2.3.9/bmi/upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/16px-Portal-puzzle.svg.png - DIRECT/1.2.3.9 image/png
1.2.3.9 무엇입니까? 이 URL 중간에 upload.wikimedia.org가 어떻게 위치하나요? 이것은 T-Mobile이 우리와 나머지 네트워크 사이에 유지하는 다른 캐시입니까?