Hi,
Please help to solve a kernel memory leak problem.
After few weeks searching forums and googling any help is welcome.
Here is the problem description:
We are installed the latest 9.0 FreeBSD with all recent patches.
Ports tree is also up to date.
Host running a nginx, php-fpm, memcached, mysqld, sphinxsearch.
Two WD HDD is gmirrored (each partition).
Also we are using a small ssd for nginx cache and mysql databases.
8 GB RAM.
We have always growing active memory till kernel panic.
(it's takes about 2 weeks till memory leak kills host)
According to top - active memory is always growing but sum of all processes memory is stable about 3.5 Gb.
So looks like kernel slowly eating all our memory
uname -r
9.0-RELEASE-p3
top:
sysctl.conf
mount
Where we should digg to catch a memory leak ?
It's not a userland process. TOP RES sum memory usage is stable.
Please help to solve a kernel memory leak problem.
After few weeks searching forums and googling any help is welcome.
Here is the problem description:
We are installed the latest 9.0 FreeBSD with all recent patches.
Ports tree is also up to date.
Host running a nginx, php-fpm, memcached, mysqld, sphinxsearch.
Two WD HDD is gmirrored (each partition).
Also we are using a small ssd for nginx cache and mysql databases.
8 GB RAM.
We have always growing active memory till kernel panic.
(it's takes about 2 weeks till memory leak kills host)
According to top - active memory is always growing but sum of all processes memory is stable about 3.5 Gb.
So looks like kernel slowly eating all our memory
uname -r
9.0-RELEASE-p3
Code:
vmstat -z
ITEM SIZE LIMIT USED FREE REQ FAIL SLEEP
UMA Kegs: 208, 0, 84, 1, 84, 0, 0
UMA Zones: 896, 0, 84, 0, 84, 0, 0
UMA Slabs: 568, 0, 6212, 186, 1121654, 0, 0
UMA RCntSlabs: 568, 0, 2210, 240, 299509, 0, 0
UMA Hash: 256, 0, 0, 0, 3, 0, 0
16 Bucket: 152, 0, 18, 107, 151, 0, 0
32 Bucket: 280, 0, 6, 36, 281, 29, 0
64 Bucket: 536, 0, 24, 4, 600, 71, 0
128 Bucket: 1048, 0, 390, 258, 421119,1231184, 0
VM OBJECT: 216, 0, 185074, 6122,802935160, 0, 0
MAP: 232, 0, 7, 25, 7, 0, 0
KMAP ENTRY: 120, 278008, 90, 685, 4371033, 0, 0
MAP ENTRY: 120, 0, 9149, 4057,2020509093, 0, 0
fakepg: 120, 0, 0, 744, 41083, 0, 0
mt_zone: 4112, 0, 302, 9, 302, 0, 0
16: 16, 0, 2023, 833,304257560, 0, 0
32: 32, 0, 3627, 1423,190401641, 0, 0
64: 64, 0, 3183, 1689,266850042, 0, 0
128: 128, 0, 9053, 9768,200576267, 0, 0
256: 256, 0, 1608, 4227,68949080, 0, 0
512: 512, 0, 7555, 3001,56527162, 0, 0
1024: 1024, 0, 89, 807,66007444, 0, 0
2048: 2048, 0, 188, 766, 5107006, 0, 0
4096: 4096, 0, 505, 472,29475994, 0, 0
Files: 80, 0, 1693, 1502,366697406, 0, 0
TURNSTILE: 136, 0, 1813, 847, 8107, 0, 0
umtx pi: 96, 0, 0, 0, 0, 0, 0
MAC labels: 40, 0, 0, 0, 0, 0, 0
PROC: 1160, 0, 126, 831,28414026, 0, 0
THREAD: 1112, 0, 1061, 751, 2959481, 0, 0
SLEEPQUEUE: 80, 0, 1813, 884, 8107, 0, 0
VMSPACE: 392, 0, 102, 878,28413995, 0, 0
cpuset: 72, 0, 2, 98, 2, 0, 0
audit_record: 960, 0, 0, 0, 0, 0, 0
mbuf_packet: 256, 0, 2103, 728,539089502, 0, 0
mbuf: 256, 0, 182, 1247,1761199755, 0, 0
mbuf_cluster: 2048, 25600, 2831, 511, 3053398, 0, 0
mbuf_jumbo_page: 4096, 12800, 14, 525,69180199, 0, 0
mbuf_jumbo_9k: 9216, 6400, 0, 0, 0, 0, 0
mbuf_jumbo_16k: 16384, 3200, 0, 0, 0, 0, 0
mbuf_ext_refcnt: 4, 0, 164, 1180,123080226, 0, 0
g_bio: 232, 0, 0, 2240,130363876, 0, 0
ttyinq: 160, 0, 810, 246, 1980, 0, 0
ttyoutq: 256, 0, 421, 134, 1032, 0, 0
ata_request: 328, 0, 0, 612,50944836, 0, 0
ata_composite: 336, 0, 0, 0, 0, 0, 0
VNODE: 480, 0, 181313, 4863,123109166, 0, 0
VNODEPOLL: 112, 0, 1, 131, 5, 0, 0
NAMEI: 1024, 0, 0, 708,490540140, 0, 0
S VFS Cache: 108, 0, 175290, 25317,122314420, 0, 0
L VFS Cache: 328, 0, 69, 1707, 349874, 0, 0
DIRHASH: 1024, 0, 13001, 447,98434805, 0, 0
NCLNODE: 560, 0, 0, 0, 0, 0, 0
Mountpoints: 768, 0, 7, 18, 8, 0, 0
pipe: 728, 0, 14, 731,31033156, 0, 0
ksiginfo: 112, 0, 949, 833, 1031495, 0, 0
itimer: 344, 0, 1, 43, 3, 0, 0
KNOTE: 128, 0, 2406, 1422,569901495, 0, 0
socket: 680, 25602, 1858, 1700,133143402, 0, 0
unpcb: 240, 25600, 45, 723,32000136, 0, 0
ipq: 56, 819, 0, 189, 36, 0, 0
udp_inpcb: 392, 25600, 34, 866,20225275, 0, 0
udpcb: 16, 25704, 34, 974,20225275, 0, 0
tcp_inpcb: 392, 25600, 8217, 9213,80917970, 0, 0
tcpcb: 976, 25600, 1752, 1712,80917970, 0, 0
tcptw: 72, 41000, 6465, 8785,42309523, 0, 0
syncache: 152, 15375, 34, 816,44953728, 0, 0
hostcache: 136, 15372, 6229, 1191, 448702, 0, 0
tcpreass: 40, 1680, 0, 840, 238618, 0, 0
sackhole: 32, 0, 0, 909, 3424643, 0, 0
sctp_ep: 1368, 25600, 0, 0, 0, 0, 0
sctp_asoc: 2280, 40000, 0, 0, 0, 0, 0
sctp_laddr: 48, 80064, 0, 216, 14, 0, 0
sctp_raddr: 704, 80000, 0, 0, 0, 0, 0
sctp_chunk: 136, 400008, 0, 0, 0, 0, 0
sctp_readq: 104, 400032, 0, 0, 0, 0, 0
sctp_stream_msg_out: 112, 400026, 0, 0, 0, 0, 0
sctp_asconf: 40, 400008, 0, 0, 0, 0, 0
sctp_asconf_ack: 48, 400032, 0, 0, 0, 0, 0
ripcb: 392, 25600, 0, 50, 10, 0, 0
rtentry: 200, 0, 37, 39, 37, 0, 0
selfd: 56, 0, 2270, 880,551066611, 0, 0
SWAPMETA: 288, 116519, 133, 907,110049288, 0, 0
FFS inode: 168, 0, 181259, 21427,123107512, 0, 0
FFS1 dinode: 128, 0, 0, 0, 0, 0, 0
FFS2 dinode: 256, 0, 181259, 15046,123106981, 0, 0
top:
Code:
last pid: 66247; load averages: 0.50, 0.54, 0.59 up 4+02:14:13 12:50:42
98 processes: 1 running, 95 sleeping, 2 zombie
CPU: 2.6% user, 0.2% nice, 3.6% system, 0.0% interrupt, 93.6% idle
Mem: 3520M Active, 2910M Inact, 1080M Wired, 370M Cache, 827M Buf, 36M Free
Swap: 2048M Total, 2800K Used, 2045M Free
sysctl.conf
Code:
kern.maxfiles=25000
kern.maxfilesperproc=24000
net.inet.tcp.maxtcptw=40960
kern.ipc.somaxconn=16384
# do reboot after panic
debug.debugger_on_panic=0
mount
Code:
/dev/mirror/p2 on / (ufs, local, soft-updates)
devfs on /dev (devfs, local, multilabel)
/dev/mirror/p4 on /tmp (ufs, local, noatime, soft-updates)
/dev/mirror/p5 on /var (ufs, local, noatime, soft-updates)
/dev/mirror/p6 on /usr (ufs, local, noatime, soft-updates)
/dev/ada1 on /ssd (ufs, local, noatime, soft-updates)
devfs on /var/named/dev (devfs, local, multilabel)
Code:
gmirror status
Name Status Components
mirror/p1 COMPLETE ada0p1 (ACTIVE)
ada2p1 (ACTIVE)
mirror/p2 COMPLETE ada0p2 (ACTIVE)
ada2p2 (ACTIVE)
mirror/p3 COMPLETE ada0p3 (ACTIVE)
ada2p3 (ACTIVE)
mirror/p4 COMPLETE ada0p4 (ACTIVE)
ada2p4 (ACTIVE)
mirror/p5 COMPLETE ada0p5 (ACTIVE)
ada2p5 (ACTIVE)
mirror/p6 COMPLETE ada0p6 (ACTIVE)
ada2p6 (ACTIVE)
Where we should digg to catch a memory leak ?
It's not a userland process. TOP RES sum memory usage is stable.