Squid Memory Useage /leak?
-
I have 2 pfsense boxes (mine and my friends). We are running identical setups (now 2.0 release on vmware server) except I am the openvpn server and he his a client. This was same scenario when we were on 1.2.3 and physical boxes.
I've noticed on my box for the last 6 months or so that my memory useage is always creeping up. I always seem to reboot for one reason or another before 30 days so I never see the machine fill up. Currently at 11 days I am 62% and climbing daily (at around 200 days it's over 80%).
A large part of the memory usage is squid, but I went screen by screen and compared to the other machine's setup. I can guess there is more usage on my box than my friends and the cache is just growing. I have my memory cache size to 256mb, but I see squid is consuming more than that. Can I expect to never hit 100%?
Why am I worried about it now? I plan on being away for 30 days, and am worried it will crash when I am gone.$ top
last pid: 16806; load averages: 0.00, 0.00, 0.00 up 11+19:46:27 16:45:53
63 processes: 1 running, 62 sleepingMem: 1065M Active, 472M Inact, 222M Wired, 213M Buf, 208M Free
Swap: 4096M Total, 4096M FreePID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
32136 snort 2 44 0 483M 396M nanslp 1 28:08 0.00% snort
37338 proxy 17 44 0 609M 593M ucond 0 17:24 0.00% squid
36053 root 1 64 20 5836K 1488K select 0 14:37 0.00% apinger
42393 root 1 76 20 8292K 1756K wait 1 9:47 0.00% sh
23081 root 1 44 0 66200K 19068K select 1 3:50 0.00% vmtoolsd
23662 root 1 44 0 10996K 3724K select 1 1:19 0.00% openvpn
50918 dhcpd 1 44 0 13056K 7600K select 1 0:53 0.00% dhcpd
7778 root 1 49 0 8292K 1676K wait 1 0:51 0.00% sh
53891 nobody 1 44 0 10144K 3232K select 0 0:46 0.00% dnsmasq
43165 root 1 44 0 25768K 4536K kqread 0 0:28 0.00% lighttpd
7277 root 1 60 0 7980K 1556K nanslp 1 0:28 0.00% cron
23997 root 1 44 0 11768K 2388K bpf 1 0:14 0.00% tcpdump
15465 _dhcp 1 44 0 5832K 1588K select 0 0:12 0.00% dhclient
21826 root 1 44 0 14772K 2764K select 0 0:06 0.00% syslogd
53342 proxy 1 44 0 59204K 12364K sbwait 0 0:06 0.00% squidGuard
53515 root 1 76 0 104M 26540K accept 1 0:04 0.00% php
4465 _ntp 1 44 0 5832K 1476K select 1 0:04 0.00% ntpd
2777 root 1 49 0 104M 26868K piperd 1 0:03 0.00% phpAnyone have any insight?
-
The squid memory usage depends on many things. On is your HARD DISK CACHE size. Every GB HDD is using ~10-15MB RAM.
The 256MB of RAM is NOT the maximum squid is using. It is the MINIMUM squid uses. If squid needs more RAM it takes more RAM.But you do not have to worry. If squid is using mem and hdd it is a good sign because than squid is working as it should - caching.
The high and low watermakrs will prevent your system to overload. If HDD or RAM reaches low water mark than squid starts to throw out "old" files. High watermark increases speed of throwing things out of mem and cache.