Re: [squid-users] No memory left, buffers eats all ram. Is any solution?

From: Tomasz <admin@dont-contact.us>
Date: Mon, 7 Apr 2008 10:25:28 +0200

Hello,

Dnia N Kwietnia 6 2008, 16:36, Henrik Nordstrom napisał(a):

>> w3cache ~ # cat /etc/squid/squid.conf | grep cache_dir | grep -v "^#"
>> cache_dir aufs /var/cache/squid/dysk1 30000 16 256
>> cache_dir aufs /var/cache/squid/dysk2 30000 16 256
>> cache_dir coss /dev/sdd1 30000 block-size=2048 overwrite-percent=40
>> max-size=1048576 membufs=30
>> cache_dir coss /dev/sde1 30000 block-size=2048 overwrite-percent=40
>> max-size=1048576 membufs=30
>> (In cache.log i seen that standard 10mb membfus was too small)
>
> 4 * 30 * 10 MB = 1.2 GB

Can I calculate probably ram usage of cache_dir both for coss and aufs storage
in that same way?

>> Is in that configuration 4-5GB of ram may be used for cache etc?
>> Is it normal?
>>
>> I have also huge amount of ram used for cache_mem:
>> w3cache ~ # cat /etc/squid/squid.conf | grep cache_mem | grep -v "^#"
>> cache_mem 2048 MB
>
> 1.2 GB + 2 GB = 3.2 GB.
>
> (...)
>
> Disable the swap. You don't need it and it's only causing you problems.

Funny, this resolved problem.

>> Why there is so much buffers?
>
> Linux uses any free memory as filesystem cache to speed up disk access.
> But the problem is that if you have an huge application with lots of
> infrequently accessed memory such as Squid this may cause the
> application to get partially swapped out even when there isn't really a
> shortage of memory.. and for Squid it's very bad to get swapped out..
> (unlike most other applications in that memory usage category)

Ok but this is strange.

>> w3cache ~ # free
>> total used free shared buffers
>> cached
>> Mem: 8155824 8108788 47036 0 2687584
>> 1048768
>> -/+ buffers/cache: 4372436 3783388
>> Swap: 996008 167864 828144
>
> Plenty of free memory there.

Hm, can I raise cache_dir on that situation? (with disabled swap and so huge
amount of ram used by buffers/cache)

Regards,

-- 
Tomasz
Received on Mon Apr 07 2008 - 02:25:53 MDT

This archive was generated by hypermail 2.2.0 : Thu May 01 2008 - 12:00:04 MDT