我已经在我构建的便携式 3G/wifi 路由器上设置了鱿鱼缓存。
代理可以工作,但我只看到 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 它创建了里面的所有位。这是cache.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 是什么? upload.wikimedia.org 如何位于该网址的中间?这是 T-Mobile 在我们和网络其他部分之间维护的某种其他缓存吗?