Memory usage on nanoBSD 256MB Alix
-
Alix 2D13 265MB real memory
1 OpenVPN site-to-site server with 8 incoming site-to-site clients
1 OpenVPN site-to-site client connecting out to another main office
1 OpenVPN road warrior server (with only 1 client currently connected)It is currently showing 83% memory usage, and the site-2-site server died due to the system being out of real memory at some point in the last hour or so. The system log has a bunch of "killed: out of swap space" messages.
Output of top, sorted by "res" (type "ores" when top is running):last pid: 87291; load averages: 0.36, 0.45, 0.43 up 3+06:51:03 14:17:24 50 processes: 1 running, 47 sleeping, 2 zombie CPU: 7.4% user, 0.0% nice, 1.6% system, 6.6% interrupt, 84.4% idle Mem: 76M Active, 12M Inact, 114M Wired, 1072K Cache, 33M Buf, 27M Free Swap: PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 93625 root 1 76 0 40816K 18288K lockf 0:01 0.00% php 73595 root 1 76 0 32624K 15184K accept 0:21 0.00% php 38194 root 1 76 0 32624K 14192K accept 0:42 5.96% php 45732 root 1 44 0 11640K 8928K select 0:04 0.00% openvpn 74329 root 1 64 20 6352K 6372K select 0:00 0.00% ntpd 46152 root 1 44 0 6520K 3972K select 0:01 0.00% openvpn 48421 root 1 44 0 9072K 3956K kqread 6:27 0.00% lighttpd 14996 root 1 64 20 6520K 3036K select 0:25 0.00% openvpn 36642 root 14 44 0 27352K 2196K ucond 0:17 0.00% filterdns 28207 root 1 44 0 6952K 2156K bpf 1:42 0.00% tcpdump 615 root 1 44 0 4760K 2080K pause 0:00 0.00% tcsh 77558 root 1 44 0 8096K 2072K select 0:01 0.00% sshd 55955 dhcpd 1 44 0 8448K 2032K select 0:22 0.00% dhcpd 41634 root 1 44 0 3724K 1820K RUN 0:00 0.00% top 85128 root 1 44 0 5928K 1632K bpf 0:13 0.00% tcpdump 6967 root 1 44 0 4988K 1372K select 7:54 0.00% syslogd 50541 nobody 1 44 0 5576K 1288K select 5:17 0.00% dnsmasq 80768 root 1 64 20 3420K 1272K nanslp 0:00 0.00% cron 72283 root 1 64 20 4604K 1268K piperd 0:00 0.00% rrdtool 71274 root 1 64 20 3328K 1180K select 0:06 0.00% apinger 86521 root 1 76 0 3708K 1164K wait 0:00 0.00% sh 93462 root 1 64 20 3420K 1132K piperd 0:00 0.00% cron 31281 root 1 44 0 5344K 996K select 0:00 0.00% sshd 84813 root 1 64 20 3420K 932K piperd 0:00 0.00% cron 31518 root 2 44 0 3544K 876K nanslp 0:00 0.00% sshlockout_pf 18217 root 1 76 20 3708K 848K wait 2:12 0.00% sh 17696 root 1 76 20 3708K 844K wait 2:13 0.00% sh 85141 root 1 44 0 3328K 816K piperd 0:21 0.00% logger 23348 root 1 76 20 1576K 784K nanslp 0:00 0.00% sleep 70427 root 1 76 20 1576K 784K nanslp 0:00 0.00% sleep 25493 root 1 64 20 3420K 744K nanslp 0:01 0.00% cron 83983 root 1 64 20 3420K 744K nanslp 0:01 0.00% cron 35217 root 1 44 0 3448K 716K select 0:01 0.00% inetd 71752 root 1 76 0 3708K 684K ttyin 0:00 0.00% sh
When I restarted the OpenVPN site-2-site server, the "php" process in "lockf" state appeared at the top of the list, and stays for a long time (after about 10 minutes it seems to disappear).
The next 2 "php" are related to the WebGUI and lighttpd and are normally there. The 3 "openvpn" processes are taking about the space that they normally do. And there seem to be a few things called "cron" and "sh" - I wonder what the various "sh" shell processes are doing? And I would have thought that "cron" would just run 1 process that wakes up from time-to-time and spawns off whatever cron jobs are scheduled - why would it have 5 processes in this list?There are thousands of Alix 256MB systems out there running pfSense, so it is worth trying to stop useless stuff that hangs about in memory. I now run all 2.1 systems, so I don't have a feel for the memory usage of a similar-config 2.0.n system. And yes, it would be great if Alix would start making their boards with more memory - I would gladly pay a couple of bucks extra for 512MB or even 1GB!
Any thoughts are welcome, particularly about how to reduce/eliminate the big "php" process.
-
114M Wired
That is also much higher than another system that just has 2 OpenVPN clients connecting out - which has only 57M Wired.