2

I have set up a squid cache on a portable 3G/wifi router I've built.

The proxy works, but I only ever see TCP_MISS, with a very rare TCP_MEM_HIT

I've never tried this before, and this is the config file I came up with:

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

Even the files coming from the 3G stick's built in http pages don't cache.

Have I made any mistakes in config file?
Is there any special way to set up /var/spool/squid3? I just used sudo mkdir /var/spool/squid3 and it created all the bits inside. Here's the output from 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.

Here's a pair of lines from 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

Two different machines, same file, two misses

Two more lines, these are weird:

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

What is 1.2.3.9? how can upload.wikimedia.org be in the middle of that url? Is that some sort of other cache maintained by T-Mobile in between us and the rest of the 'net?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.