LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to check Squid Cache (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-check-squid-cache-843790/)

struggled_newbie 11-11-2010 08:30 PM

How to check Squid Cache
 
Hello Linux Gurus,

I recently finished installing Squid 3.1.9 and I think I've done installing correctly with its feature of minor configuration changes. It accepted requests on port 3128 and created and the created some numerical or binary (I guess) files in /usr/local/squid/var/logs, My problem is how can I fully verify if the cache is really storing Internet Files?

I've read some forums in the Internet replied to me to try the command: cat /usr/local/squid/var/logs/cache.log

So I did tried it and it gives me this output:

2010/11/11 18:04:49| store_swap_size = 0
2010/11/11 18:04:50| storeLateRelease: released 0 objects
2010/11/11 18:05:41| Squid is already running! Process ID 5458
2010/11/11 18:06:16| Squid is already running! Process ID 5458
2010/11/11 18:06:45| Squid is already running! Process ID 5458
2010/11/11 18:06:59| Squid is already running! Process ID 5458
2010/11/11 18:07:07| Squid is already running! Process ID 5458
2010/11/11 18:07:09| Squid is already running! Process ID 5458
2010/11/11 18:08:49| Preparing for shutdown after 42 requests
2010/11/11 18:08:49| Waiting 30 seconds for active connections to finish
2010/11/11 18:08:49| FD 16 Closing HTTP connection
2010/11/11 18:09:02| Squid is already running! Process ID 5458
2010/11/11 18:09:07| Squid is already running! Process ID 5458
2010/11/11 18:09:20| Shutting down...
2010/11/11 18:09:20| basic/auth_basic.cc(97) done: Basic authentication Shutdown.
2010/11/11 18:09:20| Closing unlinkd pipe on FD 13
2010/11/11 18:09:20| storeDirWriteCleanLogs: Starting...
2010/11/11 18:09:20| Finished. Wrote 12 entries.
2010/11/11 18:09:20| Took 0.00 seconds (31007.75 entries/sec).
CPU Usage: 0.127 seconds = 0.075 user + 0.052 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 2688 KB
Ordinary blocks: 2554 KB 51 blks
Small blocks: 0 KB 1 blks
Holding blocks: 548 KB 2 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 133 KB
Total in use: 3102 KB 115%
Total free: 133 KB 5%
2010/11/11 18:09:20| Open FD UNSTARTED 7 DNS Socket IPv6
2010/11/11 18:09:20| Open FD READ/WRITE 8 DNS Socket IPv4
2010/11/11 18:09:20| Open FD READ/WRITE 12 Waiting for next request
2010/11/11 18:09:20| Open FD READ/WRITE 14 www.facebook.com idle connection
2010/11/11 18:09:20| Open FD READ/WRITE 15 photos-d.ak.fbcdn.net idle connection
2010/11/11 18:09:20| Open FD READ/WRITE 17 creative.ak.fbcdn.net idle connection
2010/11/11 18:09:20| Open FD READ/WRITE 18 Waiting for next request
2010/11/11 18:09:20| Open FD READ/WRITE 19 www.facebook.com idle connection
2010/11/11 18:09:20| Open FD READ/WRITE 20 photos-f.ak.fbcdn.net idle connection
2010/11/11 18:09:20| Open FD READ/WRITE 27 creative.ak.fbcdn.net idle connection
2010/11/11 18:09:20| Open FD READ/WRITE 28 Waiting for next request
2010/11/11 18:09:20| Open FD READ/WRITE 29 creative.ak.fbcdn.net idle connection
2010/11/11 18:09:20| Open FD READ/WRITE 30 photos-c.ak.fbcdn.net idle connection
2010/11/11 18:09:20| Open FD READ/WRITE 31 photos-e.ak.fbcdn.net idle connection
2010/11/11 18:09:20| Open FD READ/WRITE 32 www.facebook.com idle connection
2010/11/11 18:09:20| Squid Cache (Version 3.1.9): Exiting normally.
2010/11/11 18:10:11| Starting Squid Cache version 3.1.9 for i686-pc-linux-gnu...
2010/11/11 18:10:11| Process ID 5489
2010/11/11 18:10:11| With 1024 file descriptors available
2010/11/11 18:10:11| Initializing IP Cache...
2010/11/11 18:10:11| DNS Socket created at [::], FD 7
2010/11/11 18:10:11| DNS Socket created at 0.0.0.0, FD 8
2010/11/11 18:10:11| Adding nameserver 252.42.132.50 from /etc/resolv.conf
2010/11/11 18:10:11| Adding nameserver 252.188.255.0 from /etc/resolv.conf
2010/11/11 18:10:12| Unlinkd pipe opened on FD 13
2010/11/11 18:10:12| Store logging disabled
2010/11/11 18:10:12| Swap maxSize 2048000 + 262144 KB, estimated 177703 objects
2010/11/11 18:10:12| Target number of buckets: 8885
2010/11/11 18:10:12| Using 16384 Store buckets
2010/11/11 18:10:12| Max Mem size: 262144 KB
2010/11/11 18:10:12| Max Swap size: 2048000 KB
2010/11/11 18:10:12| Version 1 of swap file with LFS support detected...
2010/11/11 18:10:12| Rebuilding storage in /usr/local/squid/var/cache (CLEAN)
2010/11/11 18:10:12| Using Least Load store dir selection
2010/11/11 18:10:12| Set Current Directory to /usr/local/squid/var/cache
2010/11/11 18:10:12| Loaded Icons.
2010/11/11 18:10:12| Accepting HTTP connections at 10.0.0.14:3128, FD 16.
2010/11/11 18:10:12| HTCP Disabled.
2010/11/11 18:10:12| Squid modules loaded: 0
2010/11/11 18:10:12| Ready to serve requests.
2010/11/11 18:10:12| Done reading /usr/local/squid/var/cache swaplog (12 entries)
2010/11/11 18:10:12| Finished rebuilding storage from disk.
2010/11/11 18:10:12| 12 Entries scanned
2010/11/11 18:10:12| 0 Invalid entries.
2010/11/11 18:10:12| 0 With invalid flags.
2010/11/11 18:10:12| 12 Objects loaded.
2010/11/11 18:10:12| 0 Objects expired.
2010/11/11 18:10:12| 0 Objects cancelled.
2010/11/11 18:10:12| 0 Duplicate URLs purged.
2010/11/11 18:10:12| 0 Swapfile clashes avoided.
2010/11/11 18:10:12| Took 0.01 seconds (1156.52 objects/sec).
2010/11/11 18:10:12| Beginning Validation Procedure
2010/11/11 18:10:12| Completed Validation Procedure
2010/11/11 18:10:12| Validated 49 Entries
2010/11/11 18:10:12| store_swap_size = 104
2010/11/11 18:10:13| storeLateRelease: released 0 objects
2010/11/11 18:10:25| Squid is already running! Process ID 5489
2010/11/11 18:10:40| Squid is already running! Process ID 5489
2010/11/11 18:11:00| Preparing for shutdown after 0 requests
2010/11/11 18:11:00| Waiting 30 seconds for active connections to finish
2010/11/11 18:11:00| FD 16 Closing HTTP connection
2010/11/11 18:13:34| Starting Squid Cache version 3.1.9 for i686-pc-linux-gnu...
2010/11/11 18:13:34| Process ID 2619
2010/11/11 18:13:34| With 1024 file descriptors available
2010/11/11 18:13:34| Initializing IP Cache...
2010/11/11 18:13:34| DNS Socket created at [::], FD 5
2010/11/11 18:13:34| DNS Socket created at 0.0.0.0, FD 6
2010/11/11 18:13:34| Adding nameserver 252.42.132.50 from /etc/resolv.conf
2010/11/11 18:13:34| Adding nameserver 252.188.255.0 from /etc/resolv.conf
2010/11/11 18:13:34| Unlinkd pipe opened on FD 11
2010/11/11 18:13:34| Store logging disabled
2010/11/11 18:13:34| Swap maxSize 2048000 + 262144 KB, estimated 177703 objects
2010/11/11 18:13:34| Target number of buckets: 8885
2010/11/11 18:13:34| Using 16384 Store buckets
2010/11/11 18:13:34| Max Mem size: 262144 KB
2010/11/11 18:13:34| Max Swap size: 2048000 KB
2010/11/11 18:13:34| Version 1 of swap file with LFS support detected...
2010/11/11 18:13:34| Rebuilding storage in /usr/local/squid/var/cache (DIRTY)
2010/11/11 18:13:34| Using Least Load store dir selection
2010/11/11 18:13:34| Set Current Directory to /usr/local/squid/var/cache
2010/11/11 18:13:35| Loaded Icons.
2010/11/11 18:13:35| Accepting HTTP connections at 10.0.0.14:3128, FD 14.
2010/11/11 18:13:35| HTCP Disabled.
2010/11/11 18:13:35| Squid modules loaded: 0
2010/11/11 18:13:35| Ready to serve requests.
2010/11/11 18:13:35| Done reading /usr/local/squid/var/cache swaplog (12 entries)
2010/11/11 18:13:35| Finished rebuilding storage from disk.
2010/11/11 18:13:35| 12 Entries scanned
2010/11/11 18:13:35| 0 Invalid entries.
2010/11/11 18:13:35| 0 With invalid flags.
2010/11/11 18:13:35| 12 Objects loaded.
2010/11/11 18:13:35| 0 Objects expired.
2010/11/11 18:13:35| 0 Objects cancelled.
2010/11/11 18:13:35| 0 Duplicate URLs purged.
2010/11/11 18:13:35| 0 Swapfile clashes avoided.
2010/11/11 18:13:35| Took 0.09 seconds (128.53 objects/sec).
2010/11/11 18:13:35| Beginning Validation Procedure
2010/11/11 18:13:35| Completed Validation Procedure
2010/11/11 18:13:35| Validated 49 Entries
2010/11/11 18:13:35| store_swap_size = 104
2010/11/11 18:13:35| storeLateRelease: released 0 objects
2010/11/11 18:13:58| Preparing for shutdown after 0 requests
2010/11/11 18:13:58| Waiting 0 seconds for active connections to finish
2010/11/11 18:13:58| FD 14 Closing HTTP connection
2010/11/11 18:14:00| Shutting down...
2010/11/11 18:14:00| basic/auth_basic.cc(97) done: Basic authentication Shutdown.
2010/11/11 18:14:00| Closing unlinkd pipe on FD 11
2010/11/11 18:14:00| storeDirWriteCleanLogs: Starting...
2010/11/11 18:14:00| Finished. Wrote 12 entries.
2010/11/11 18:14:00| Took 0.00 seconds (31746.03 entries/sec).
CPU Usage: 0.055 seconds = 0.019 user + 0.036 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 25
Memory usage for squid via mallinfo():
total space in arena: 2304 KB
Ordinary blocks: 2182 KB 9 blks
Small blocks: 0 KB 1 blks
Holding blocks: 548 KB 2 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 121 KB
Total in use: 2730 KB 119%
Total free: 121 KB 5%
2010/11/11 18:14:00| Open FD UNSTARTED 5 DNS Socket IPv6
2010/11/11 18:14:00| Open FD UNSTARTED 6 DNS Socket IPv4
2010/11/11 18:14:00| Squid Cache (Version 3.1.9): Exiting normally.
2010/11/11 18:30:53| Starting Squid Cache version 3.1.9 for i686-pc-linux-gnu...
2010/11/11 18:30:53| Process ID 2619
2010/11/11 18:30:53| With 1024 file descriptors available
2010/11/11 18:30:53| Initializing IP Cache...
2010/11/11 18:30:53| DNS Socket created at [::], FD 5
2010/11/11 18:30:53| DNS Socket created at 0.0.0.0, FD 6
2010/11/11 18:30:53| Adding nameserver 252.42.132.50 from /etc/resolv.conf
2010/11/11 18:30:53| Adding nameserver 252.188.255.0 from /etc/resolv.conf
2010/11/11 18:30:54| Unlinkd pipe opened on FD 11
2010/11/11 18:30:54| Store logging disabled
2010/11/11 18:30:54| Swap maxSize 2048000 + 262144 KB, estimated 177703 objects
2010/11/11 18:30:54| Target number of buckets: 8885
2010/11/11 18:30:54| Using 16384 Store buckets
2010/11/11 18:30:54| Max Mem size: 262144 KB
2010/11/11 18:30:54| Max Swap size: 2048000 KB
2010/11/11 18:30:54| Version 1 of swap file with LFS support detected...
2010/11/11 18:30:54| Rebuilding storage in /usr/local/squid/var/cache (CLEAN)
2010/11/11 18:30:54| Using Least Load store dir selection
2010/11/11 18:30:54| Set Current Directory to /usr/local/squid/var/cache
2010/11/11 18:30:54| Loaded Icons.
2010/11/11 18:30:54| Accepting HTTP connections at 10.0.0.14:3128, FD 14.
2010/11/11 18:30:54| HTCP Disabled.
2010/11/11 18:30:54| Squid modules loaded: 0
2010/11/11 18:30:54| Ready to serve requests.
2010/11/11 18:30:54| Done reading /usr/local/squid/var/cache swaplog (12 entries)
2010/11/11 18:30:54| Finished rebuilding storage from disk.
2010/11/11 18:30:54| 12 Entries scanned
2010/11/11 18:30:54| 0 Invalid entries.
2010/11/11 18:30:54| 0 With invalid flags.
2010/11/11 18:30:54| 12 Objects loaded.
2010/11/11 18:30:54| 0 Objects expired.
2010/11/11 18:30:54| 0 Objects cancelled.
2010/11/11 18:30:54| 0 Duplicate URLs purged.
2010/11/11 18:30:54| 0 Swapfile clashes avoided.
2010/11/11 18:30:54| Took 0.09 seconds (133.47 objects/sec).
2010/11/11 18:30:54| Beginning Validation Procedure
2010/11/11 18:30:54| Completed Validation Procedure
2010/11/11 18:30:54| Validated 49 Entries
2010/11/11 18:30:54| store_swap_size = 104
2010/11/11 18:30:55| storeLateRelease: released 0 objects
2010/11/11 18:31:05| Preparing for shutdown after 0 requests
2010/11/11 18:31:05| Waiting 0 seconds for active connections to finish
2010/11/11 18:31:05| FD 14 Closing HTTP connection
2010/11/11 18:31:06| Shutting down...
2010/11/11 18:31:06| basic/auth_basic.cc(97) done: Basic authentication Shutdown.
2010/11/11 18:31:06| Closing unlinkd pipe on FD 11
2010/11/11 18:31:06| storeDirWriteCleanLogs: Starting...
2010/11/11 18:31:06| Finished. Wrote 12 entries.
2010/11/11 18:31:06| Took 0.00 seconds (36363.64 entries/sec).
CPU Usage: 0.050 seconds = 0.019 user + 0.031 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 25
Memory usage for squid via mallinfo():
total space in arena: 2300 KB
Ordinary blocks: 2181 KB 9 blks
Small blocks: 0 KB 1 blks
Holding blocks: 548 KB 2 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 118 KB
Total in use: 2729 KB 119%
Total free: 118 KB 5%
2010/11/11 18:31:06| Open FD UNSTARTED 5 DNS Socket IPv6
2010/11/11 18:31:06| Open FD UNSTARTED 6 DNS Socket IPv4
2010/11/11 18:31:06| Squid Cache (Version 3.1.9): Exiting normally.
2010/11/11 18:31:12| Starting Squid Cache version 3.1.9 for i686-pc-linux-gnu...
2010/11/11 18:31:12| Process ID 2624
2010/11/11 18:31:12| With 1024 file descriptors available
2010/11/11 18:31:12| Initializing IP Cache...
2010/11/11 18:31:12| DNS Socket created at [::], FD 7
2010/11/11 18:31:12| DNS Socket created at 0.0.0.0, FD 8
2010/11/11 18:31:12| Adding nameserver 252.42.132.50 from /etc/resolv.conf
2010/11/11 18:31:12| Adding nameserver 252.188.255.0 from /etc/resolv.conf
2010/11/11 18:31:12| Unlinkd pipe opened on FD 13
2010/11/11 18:31:12| Store logging disabled
2010/11/11 18:31:12| Swap maxSize 2048000 + 262144 KB, estimated 177703 objects
2010/11/11 18:31:12| Target number of buckets: 8885
2010/11/11 18:31:12| Using 16384 Store buckets
2010/11/11 18:31:12| Max Mem size: 262144 KB
2010/11/11 18:31:12| Max Swap size: 2048000 KB
2010/11/11 18:31:12| Version 1 of swap file with LFS support detected...
2010/11/11 18:31:12| Rebuilding storage in /usr/local/squid/var/cache (CLEAN)
2010/11/11 18:31:12| Using Least Load store dir selection
2010/11/11 18:31:12| Set Current Directory to /usr/local/squid/var/cache
2010/11/11 18:31:12| Loaded Icons.
2010/11/11 18:31:12| Accepting HTTP connections at 10.0.0.14:3128, FD 16.
2010/11/11 18:31:12| HTCP Disabled.
2010/11/11 18:31:12| Squid modules loaded: 0
2010/11/11 18:31:12| Ready to serve requests.
2010/11/11 18:31:12| Done reading /usr/local/squid/var/cache swaplog (12 entries)
2010/11/11 18:31:12| Finished rebuilding storage from disk.
2010/11/11 18:31:12| 12 Entries scanned
2010/11/11 18:31:12| 0 Invalid entries.
2010/11/11 18:31:12| 0 With invalid flags.
2010/11/11 18:31:12| 12 Objects loaded.
2010/11/11 18:31:12| 0 Objects expired.
2010/11/11 18:31:12| 0 Objects cancelled.
2010/11/11 18:31:12| 0 Duplicate URLs purged.
2010/11/11 18:31:12| 0 Swapfile clashes avoided.
2010/11/11 18:31:12| Took 0.01 seconds (1138.63 objects/sec).
2010/11/11 18:31:12| Beginning Validation Procedure
2010/11/11 18:31:12| Completed Validation Procedure
2010/11/11 18:31:12| Validated 49 Entries
2010/11/11 18:31:12| store_swap_size = 104
2010/11/11 18:31:13| storeLateRelease: released 0 objects



wow so many.....



How can I verify if it really caching and how can I look the files that the cache has downloaded?

When I also try the command to check the access.log using
tail -f /usr/local/squid/var/logs/access.log
several inputs are:
TCP_IMS_MIS/200
TCP_MISS/200

Is this really caching Internet cookies?

please help me.

bathory 11-12-2010 03:54 PM

Hi,

Look for TCP_HIT to find cached objects:
Code:

grep TCP_HIT /usr/local/squid/var/logs/access.log
You can find more on squid logs here

Regards


All times are GMT -5. The time now is 08:54 AM.