Re: [squid-users] memory leaks

From: Edvard Chitro <squid@dont-contact.us>
Date: Wed, 17 May 2006 09:40:12 +0300 (EEST)

> tis 2006-05-16 klockan 13:06 +0300 skrev Edvard Chitro:
>
>> Top shows squid is only using 50-60 Mb ...
>>
>> And if I shut down squid only 60 Mb gets freed ...
>
> What I have been saying all the time. The problem is not Squid, the
> problem is elsewhere.

But how can I find the problem.... maybe it is reiserfs eats all the
memory somehow.
Because if I not start Squid memory is free and uptime above 130 days ...
But with squid it is max 30-50 days .. depends on the load ... so maybe
filesystem has some bugs... I have changes 3 kernels ... 2.4.27, 2.4.28,
2.4.31 and the same problem exist.... I have changed dist from Woody to
Sarge and nothing helps....

>
> Your Squid is using 60-70 MB.
>
> This server should run fine with as little as 256 MB, possibly even 128
> if you slim down the OS..
>
>
> But you can not look at the raw free value. It doesn't make sense. What
> you need to keep track of is the adjusted free value (second line of
> numbers) where the the value has been adjusted with buffer & cache.
>
> Linux memory is in one of four different states
>
> a) Completely free (raw free value). Available for immediate use by the
> kernel with no questions asked. This should be quite stable around 5MB
> when the system is working.
>
> b) Buffer / Cache. Used by the kernel to speed things up. Released on
> demand if there is need for more memory.
>
> c) Application memory. Used by running processes. top & ps gives some
> info on how much memory different applications are using, but not always
> correct (the reported number can be much higher for some applications
> than the actual usage due to shared memory and a few other things
> complicating matters.. but for Squid it's quite accurate)

Top and PS gives me nothing ... according to them my box only consumes
only ~ 100 MB ...

top - 09:32:32 up 1 day, 23:29, 1 user, load average: 0.02, 0.03, 0.00
Tasks: 44 total, 1 running, 43 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.6% user, 3.4% system, 0.0% nice, 96.0% idle
Mem: 516312k total, 511248k used, 5064k free, 38520k buffers
Swap: 248968k total, 0k used, 248968k free, 52368k cached

  PID USER PR NI CODE DATA VIRT SWAP RES SHR S %CPU %MEM TIME
COMMAND
23131 root 17 0 52 1000 1052 0 1052 848 R 0.8 0.2 0:00 top
19846 xxxx 11 0 1044 5544 6616 4 6612 1692 S 0.4 1.3 3:15
/usr/bind-9.x.x/sbin//named -u xxxx
    1 root 8 0 32 468 500 0 500 448 S 0.0 0.1 0:00
init [2]
    2 root 9 0 0 0 0 0 0 0 S 0.0 0.0 0:00
[keventd]
    3 root 19 19 0 0 0 0 0 0 S 0.0 0.0 0:10
[ksoftirqd_CPU0]
    4 root 9 0 0 0 0 0 0 0 S 0.0 0.0 0:01
[kswapd]
    5 root 9 0 0 0 0 0 0 0 S 0.0 0.0 0:00
[bdflush]
    6 root 9 0 0 0 0 0 0 0 S 0.0 0.0 0:05
[kupdated]
    7 root 9 0 0 0 0 0 0 0 S 0.0 0.0 0:00
[ahc_dv_0]
    8 root 9 0 0 0 0 0 0 0 S 0.0 0.0 0:00
[scsi_eh_0]
    9 root 9 0 0 0 0 0 0 0 S 0.0 0.0 0:00
[kreiserfsd]
 4767 root 9 0 32 572 604 0 604 492 S 0.0 0.1 0:01
/sbin/syslogd
22120 root 9 0 24 1100 1128 4 1124 456 S 0.0 0.2 0:00
/sbin/klogd
 9434 xxxx 9 0 1044 5544 6616 4 6612 1692 S 0.0 1.3 0:00
/usr/bind-9.x.x/sbin//named -u xxxx
22474 xxxx 9 0 1044 5544 6616 4 6612 1692 S 0.0 1.3 0:00
/usr/bind-9.x.x/sbin//named -u xxxx
23459 xxxx 9 0 1044 5544 6616 4 6612 1692 S 0.0 1.3 0:04
/usr/bind-9.x.x/sbin//named -u xxxx
25150 xxxx 9 0 1044 5544 6616 4 6612 1692 S 0.0 1.3 0:27
/usr/bind-9.x.x/sbin//named -u xxxx
25350 snmpd 9 0 32 2304 2340 4 2336 1572 S 0.0 0.5 0:10
/usr/snmp/sbin/snmpd -C -c /etc/snmp/snmpd.conf -Lf
/var/log/snmp/snmpd.log
29048 root 9 0 148 1400 1552 4 1548 1400 S 0.0 0.3 0:00
/usr/sbin/sshd
 8946 yyyy 9 0 20 680 700 0 700 584 S 0.0 0.1 0:00
/usr/ulogd-1.22/sbin/ulogd -d -u yyyy
22443 root 9 0 20 1672 1696 4 1692 1288 S 0.0 0.3 0:01
/usr/snmp/sbin/snmptrapd -c /etc/snmp/snmptrapd.conf -On -Lf
/var/log/snmp/traps.log
30509 root 8 0 32 780 812 0 812 672 S 0.0 0.2 0:00
/usr/sbin/cron
18307 zzzz 8 0 44 600 644 0 644 568 S 0.0 0.1 0:00
/usr/oidend-2.0.7-1/sbin/oidentd -m -q --reply user -u zzzz
16902 root 9 0 16 456 472 0 472 420 S 0.0 0.1 0:00
/sbin/getty 38400 tty2
11939 root 9 0 16 456 472 0 472 420 S 0.0 0.1 0:00
/sbin/getty 38400 tty3
 4070 root 9 0 16 456 472 0 472 420 S 0.0 0.1 0:00
/sbin/getty 38400 tty1
17386 root 9 0 248 912 1168 8 1160 960 S 0.0 0.2 0:00
/usr/squid-13/sbin/squid
31627 squid 12 0 608 56m 58156 32 56m 1472 S 0.0 11.3 39:15
(squid)
 2352 squid 9 0 8 272 284 4 280 240 S 0.0 0.1 0:00
(unlinkd)
17672 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:00
(squid)
 1721 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:05
(squid)
10627 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:05
(squid)
32141 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:05
(squid)
15300 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:05
(squid)
29018 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:05
(squid)
 5266 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:05
(squid)
 7231 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:05
(squid)
20412 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:05
(squid)
17492 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:05
(squid)
23770 squid 9 0 608 56m 58156 32 56m 1472 S 0.0 11.3 0:05
(squid)
20070 root 9 0 240 1752 2000 8 1992 1824 S 0.0 0.4 0:00
sshd: aaaa [priv]
20660 aaaa 9 0 272 1824 2104 8 2096 1880 S 0.0 0.4 0:00
sshd: aaaa@pts/0
  595 aaaa 9 0 480 956 1436 0 1436 1132 S 0.0 0.3 0:00 -bash
 8630 root 9 0 520 984 1504 0 1504 1180 S 0.0 0.3 0:00 -su

>
> d) Kernel memory. Used by different components in the
> kernel. /proc/slabinfo gives some info on this usage.

gw:~# cat /proc/slabinfo
slabinfo - version: 1.1
kmem_cache 56 68 112 2 2 1
ip_conntrack 2637 5496 320 453 458 1
ip_fib_hash 357 448 32 4 4 1
tcp_tw_bucket 9 270 128 1 9 1
tcp_bind_bucket 12 336 32 3 3 1
tcp_open_request 0 59 64 0 1 1
inet_peer_cache 33930 33984 64 576 576 1
ip_dst_cache 3438 3440 192 172 172 1
arp_cache 480 510 128 17 17 1
blkdev_requests 2048 2070 128 69 69 1
dnotify_cache 0 0 20 0 0 1
file_lock_cache 1 40 96 1 1 1
fasync_cache 0 0 16 0 0 1
uid_cache 10 112 32 1 1 1
skbuff_head_cache 1333 1560 192 78 78 1
sock 46 68 960 14 17 1
sigqueue 0 29 132 0 1 1
kiobuf 0 0 64 0 0 1
cdev_cache 955 1003 64 17 17 1
bdev_cache 5 59 64 1 1 1
mnt_cache 14 59 64 1 1 1
inode_cache 451649 451892 512 64554 64556 1
dentry_cache 505383 505410 128 16847 16847 1
filp 588 600 128 20 20 1
names_cache 0 2 4096 0 2 1
buffer_head 21673 36090 128 1199 1203 1
mm_struct 21 40 192 2 2 1
vm_area_struct 557 630 128 19 21 1
fs_cache 20 59 64 1 1 1
files_cache 21 27 448 3 3 1
signal_act 25 30 1344 9 10 1
size-131072(DMA) 0 0 131072 0 0 32
size-131072 0 0 131072 0 0 32
size-65536(DMA) 0 0 65536 0 0 16
size-65536 0 0 65536 0 0 16
size-32768(DMA) 0 0 32768 0 0 8
size-32768 0 0 32768 0 0 8
size-16384(DMA) 0 0 16384 0 0 4
size-16384 1 1 16384 1 1 4
size-8192(DMA) 0 0 8192 0 0 2
size-8192 768 768 8192 768 768 2
size-4096(DMA) 0 0 4096 0 0 1
size-4096 67 67 4096 67 67 1
size-2048(DMA) 0 0 2048 0 0 1
size-2048 1344 1442 2048 675 721 1
size-1024(DMA) 0 0 1024 0 0 1
size-1024 44 48 1024 12 12 1
size-512(DMA) 0 0 512 0 0 1
size-512 855 856 512 107 107 1
size-256(DMA) 0 0 256 0 0 1
size-256 19 30 256 2 2 1
size-128(DMA) 0 0 128 0 0 1
size-128 612 630 128 21 21 1
size-64(DMA) 0 0 64 0 0 1
size-64 2201 2419 64 41 41 1
size-32(DMA) 0 0 64 0 0 1
size-32 15232 15399 64 259 261 1

>
>
> Regards
> Henrik
>

Regards,
Edvard
Received on Wed May 17 2006 - 00:38:26 MDT

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