Por que meu cache de squid nunca recebe nenhum hit?

2

Eu configurei um cache de squid em um roteador 3G / wifi portátil que eu criei.

O proxy funciona, mas eu só vejo TCP_MISS, com um muito raro TCP_MEM_HIT

Eu nunca tentei isso antes, e este é o arquivo de configuração que eu criei:

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

Mesmo os arquivos provenientes das páginas http embutidas do dispositivo 3G não armazenam em cache.

Eu cometi algum erro no arquivo de configuração?
Existe alguma maneira especial de configurar / var / spool / squid3? Acabei de usar o sudo mkdir / var / spool / squid3 e ele criou todos os bits dentro. Aqui está a saída do 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.

Aqui está um par de linhas de 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

Duas máquinas diferentes, o mesmo arquivo, duas falhas

Mais duas linhas, estas são estranhas:

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

O que é 1.2.3.9? como upload.wikimedia.org pode estar no meio desse URL? Isso é algum tipo de outro cache mantido pela T-Mobile entre nós e o resto da 'net?

    
por RoboJ1M 04.09.2013 / 21:17

0 respostas

Tags