Re: [squid-users] memory leaks

From: Edvard Chitro <squid@dont-contact.us>
Date: Tue, 16 May 2006 13:06:54 +0300 (EEST)

FAQ says: "As a rule of thumb on Squid uses approximately 10 MB of RAM per
GB of the total of all cache_dirs (more on 64 bit servers such as Alpha),
plus your cache_mem setting and about an additional 10-20MB. It is
recommended to have at least twice this amount of physical RAM available
on your Squid server. For a more detailed discussion on Squid's memory
usage see the sections above."

So I have 6,8 Gb cache dir = 6.8 x 10 = 68 MB + 10 MB(cache_mem) +
additional 10-20 MB = 98 MB ... and to have at least twice so 98 x 2 = 196
MB ... I have 460 MB free before I start squid.... so that is 4 times more
than recommended minimal amount.....

Top shows squid is only using 50-60 Mb ...

And if I shut down squid only 60 Mb gets freed ...

I will add additional 128 RAM and see the result ... but I doubt that it
will help .. maybe give me 2-5 days of uptime ...

> squid maps the cache content to the memory so that it will have a fast
> lookup..
> so the more your cache is being used, the more the memory is being used ..
>
> reduce your cache_dir or increase your memory.. IMHO 512MB is to little ..
>
> Quoting Edvard Chitro <squid@ineteksa.lt>:
>
>> Hello,
>>
>> I have serious problems with squid.
>>
>> My setup is:
>> Debian Sarge @ Athlon 750, 512 RAM and 2 SCSI hdd's (one for cache, one
>> for system). Kernel is 2.4.31.
>>
>> Squid Cache: Version 2.5.STABLE13
>> configure options: --prefix=/usr/squid-13/ --with-aufs-threads=10
>> --with-pthreads --enable-storeio=aufs --enable-removal-policies=heap,lru
>> --enable-delay-pools --disable-wccp --enable-dlmalloc
>> --enable-kill-parent-hack --enable-snmp
>> --enable-default-err-language=Lithuanian
>> --enable-err-languages=Lithuanian
>> --enable-poll --enable-linux-netfilter --disable-ident-lookups
>> --disable-hostname-checks --enable-underscores
>>
>> cache_mem 10 MB
>> cache_dir aufs /cache 7168 10 256
>>
>> I get ~600 req/s on average. Performance is good .. no lagging etc. ...
>> fast response...
>> top shows squid is using ~ 60 MB of ram.
>>
>> My box has 512 ram. It is basically a router with only squid and
>> iptables
>> firewall on it.
>>
>> When I start the sistem (without starting squid) only 37 MB of ram gets
>> used. And usage is constant, no matter how long box is up. After a week
>> it
>> still has 37 Mb used and ~400 MB free.
>>
>> But if I start squid and let it run, then after ~36 hours I have only 92
>> Mb free ... and after 7-30 days I get ether box lockup because out of
>> memory or squid becomes zombie and locks up. The most interesting thing
>> that swap usage is always remains zero or 132 Kb. Ihave no bad sector on
>> hard drives. I have checked everything. That irritates me ...
>>
>> I have such problems since Stable 9 I think. I have been using Debian
>> Woody and thought that it might be gcc 2.95 that causes problems... but
>> now I have switched to Debian Sarge with gcc 3.3 and the same problems
>> exist.
>>
>> After 40 hours of uptime I get:
>>
>> edska@gw:~$ free
>> total used free shared buffers cached
>> Mem: 516312 510772 5540 0 51976
>> 48876
>> -/+ buffers/cache: 409920 106392
>> Swap: 248968 0 248968
>>
>>
>>
>> root 17386 0.0 0.2 4136 1160 ? Ss 10:43 0:00
>> /usr/squid-13/sbin/squid
>> squid 31627 2.1 8.9 68640 46044 ? S 10:43 0:29 \_
>> (squid)
>> squid 2352 0.0 0.0 1336 280 ? Ss 10:43 0:00 \_
>> (unlinkd)
>> squid 17672 0.0 8.9 68640 46044 ? S 10:43 0:00 \_
>> (squid)
>> squid 1721 0.0 8.9 68640 46044 ? S 10:43 0:00
>> \_
>> (squid)
>> squid 10627 0.0 8.9 68640 46044 ? S 10:43 0:00
>> \_
>> (squid)
>> squid 32141 0.0 8.9 68640 46044 ? S 10:43 0:00
>> \_
>> (squid)
>> squid 15300 0.0 8.9 68640 46044 ? S 10:43 0:00
>> \_
>> (squid)
>> squid 29018 0.0 8.9 68640 46044 ? S 10:43 0:00
>> \_
>> (squid)
>> squid 5266 0.0 8.9 68640 46044 ? S 10:43 0:00
>> \_
>> (squid)
>> squid 7231 0.0 8.9 68640 46044 ? S 10:43 0:00
>> \_
>> (squid)
>> squid 20412 0.0 8.9 68640 46044 ? S 10:43 0:00
>> \_
>> (squid)
>> squid 17492 0.0 8.9 68640 46044 ? S 10:43 0:00
>> \_
>> (squid)
>> squid 23770 0.0 8.9 68640 46044 ? S 10:43 0:00
>> \_
>> (squid)
>>
>>
>>
>> Can somebody help me ?
>>
>> Last time squid died with something like this in the logs:
>> May 14 23:41:09 gw kernel: Unable to handle kernel paging request at
>> virtual address 30303098
>> May 14 23:41:09 gw kernel: printing eip:
>> May 14 23:41:09 gw kernel: c01b0880
>> May 14 23:41:09 gw kernel: *pgd = 0000000000000000
>> May 14 23:41:09 gw kernel: *pmd = 0000000000000000
>> May 14 23:41:09 gw kernel: Oops: 0000
>> May 14 23:41:09 gw kernel: CPU: 0
>> May 14 23:41:09 gw kernel: EIP:
>> 0010:[reiserfs_update_inode_transaction+16/48] Not tainted
>> May 14 23:41:09 gw kernel: EFLAGS: 00010217
>> May 14 23:41:09 gw kernel: eax: 30303030 ebx: fffffffe ecx: df85fc00
>> edx: dea43d40
>> May 14 23:41:09 gw kernel: esi: dca72500 edi: dea43d40 ebp: c8eabea0
>> esp: c8eabe78
>> May 14 23:41:09 gw kernel: ds: 0018 es: 0018 ss: 0018
>> May 14 23:41:09 gw kernel: Process squid (pid: 24378,
>> stackpage=c8eab000)
>> May 14 23:41:09 gw kernel: Stack: c0194b09 dea43d40 c5c5761c 00000008
>> c8eabec0 c8eabf00 c8eabf9c 00000020
>> May 14 23:41:09 gw kernel: c8eabfc0 00000000 c026bc5b 00000000
>> 00000026 0029537d df87fc00 00000020
>> May 14 23:41:09 gw kernel: 00005a0f 00000282 00000004 00000000
>> 00000000 00000000 00000000 df4ffe40
>> May 14 23:41:09 gw kernel: Call Trace: [reiserfs_unlink+169/608]
>> [generic_fs_handler+62/208] [vfs_unlink+189/400] [sys_unlink+251/384]
>> [system_call+51/64]
>> May 14 23:41:09 gw kernel:
>> May 14 23:41:09 gw kernel: Code: 8b 40 68 89 82 54 01 00 00 8b 81 f8 00
>> 00
>> 00 8b 40 20 89 82
>>
>
>
>
Received on Tue May 16 2006 - 04:05:18 MDT

This archive was generated by hypermail pre-2.1.9 : Thu Jun 01 2006 - 12:00:02 MDT