RE: [squid-users] TCP_HIT and TCP_MISS

From: Guillaume Chartrand <guillaume.chartrand@dont-contact.us>
Date: Wed, 26 Mar 2008 11:37:39 -0400

>-----Message d'origine-----
>De : ferret@gci.net [mailto:ferret@gci.net] De la part de Chris Robertson
>Envoyé : 25 mars 2008 15:41
>À : squid-users@squid-cache.org
>Objet : Re: [squid-users] TCP_HIT and TCP_MISS
>
>Guillaume Chartrand wrote:
>>> -----Message d'origine-----
>>> De : ferret@gci.net [mailto:ferret@gci.net] De la part de Chris Robertson
>>> Envoyé : 20 mars 2008 21:21
>>> À : squid-users@squid-cache.org
>>> Objet : Re: [squid-users] TCP_HIT and TCP_MISS
>>>
>>> Guillaume Chartrand wrote:
>>>
>>>> I try the solution on the other post to increase file descriptor
>>>> I have 4096 when I do a ulimit -n
>>>> I recompile squid
>>>> Here what I have when I run squid -v
>>>> Squid Cache: Version 2.6.STABLE12
>>>> configure options:
>>>>
>>>>
>>> No configure options at all? The default (last I checked) did not allow
>>> for support of aufs cache dirs.
>>>
>>
>>
>> I've just run ./configure
>> Without no other option. Now I look for enable aufs cache dir but I didn't find with option I need to enable. The only >option who's near that it's
>> --with-aufs-threads=N_THREADS
>>
>> If it's that option, how many threads should I put.
>>
>>
>
>Personally I use "--enable-storeio=aufs,null,ufs", with a few other
>options (with-large-files, enable-snmp,
>enable-removal-policies=heap,lru). There is a message in the archives
> (somewhere, I can't find it right now) where Henrik explains that ufs is
>actually better for a lightly loaded cache (less overhead), but the
>blocking becomes a factor as the requests per second rise. For me it
>has become reflexive to suggest using aufs.

>>>> 2008/03/18 09:11:01| NOTICE: no explicit transparent proxy support enabled. Assuming getsockname() works on >>>intercepted conne
>>>> ctions
>>>> 2008/03/18 09:11:01| WARNING: Forwarding loop detected for:
>>>> Client: 172.20.20.18 http_port: 172.20.20.18:3128
>>>> GET http://172.20.20.18:3128/design/motherbd/software/ias/updates.htm HTTP/1.0
>>>> Via: 1.0 squid.collanaud.qc.ca:3128 (squid/2.6.STABLE12)
>>>> X-Forwarded-For: 172.21.132.93
>>>> Host: 172.20.20.18:3128
>>>> Cache-Control: max-age=259200
>>>> Connection: keep-alive
>>>>
>>>>
>>>>
>>
>>
>>> So your router is intercepting Squid's traffic and redirecting it back
>>> to Squid. That's not so good. In a big way.
>>>
>
>This was not addressed in your reply. Hopefully it was addressed on
>your network. I feel it's the real issue.

>>>> And here is some of my squid.conf
>>>> # Squid normally listens to port 3128
>>>> #http_port 3128
>>>> http_port 3128 transparent
>>>> #Default:
>>>> # cache_mem 8 MB
>>>> cache_mem 512 MB
>>>> #Default:
>>>> # maximum_object_size 4096 KB
>>>> maximum_object_size 25600 KB#Default:
>>>> cache_dir ufs /usr/local/squid/var/cache 2500 16 256 # this one is a symlink to another disk
>>>>
>>>>
>>
>>
>>> A symlink, or is the other disk mounted here. No matter, but you should
>>> probably be using aufs, which you will have to compile support for.
>>>
>>
>> It's a symlink only.
>>

>Interesting. Any reason for using a symlink instead of a mount point?

I deleted the symlink and make a mount point
>>
>>>> cache_dir ufs /usr/local/squid/var/cache2 2500 16 256
>>>>
>>>>
>>
>>
>>> So how much memory does this box have? You've dedicated about a GB of
>>> RAM for Squid alone (512 cache_mem + (5GB of cache_dir * 0.1)).
>>>
>>
>> The machine is on VMware virtual machine and have 2 disk of 40GB each and 1GB of RAM
>>

>Ugh. My calculation was off by an order of magnitude. 5GB of cache
>will only take (on average) 50MB of memory. See
>http://wiki.squid-cache.org/SquidFaq/SquidMemory for more details. But
>be aware, squid does not put objects from the disk cache BACK into
>memory. Only objects fetched from the net are put in the memory cache.

I've downgrade my cache_mem to 100M
cache_mem 100 MB
I've modified the cache_dir
cache_dir aufs /usr/local/squid/var/cache 2500 16 256
cache_dir aufs /usr/local/squid/var/cache2 2500 16 256

I've make a make clean on my src dir
I've deleted all file and directory in my cache directory
I make my mount point of my second disk to /usr/local/squid/var/cache2 and deleted my symlink to have direct access
I recompile with this line
./configure --enable-storeio=aufs,null,ufs --with-large-files
Make
Make install

I rerun squid with option -z to remake my directory
After I run squid normally

It's about 12 hours and that squid running and I don't have TCP_HIT

I try to access a gif with 2 different browser on the same machine and here What I got in my access.log
1206545448.392 6413 172.20.51.11 TCP_MISS/200 596 GET http://www.nu.nl/img/balkje.gif - DIRECT/62.69.179.208 image/gif
1206545708.067 252 172.20.51.11 TCP_MISS/200 596 GET http://www.nu.nl/img/balkje.gif - DIRECT/62.69.184.229 image/gif

So I don't know again what I misconfigured

Thank
Received on Wed Mar 26 2008 - 09:40:51 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Apr 01 2008 - 13:00:05 MDT