{"id":1464,"date":"2012-03-28T12:04:20","date_gmt":"2012-03-28T04:04:20","guid":{"rendered":"http:\/\/www.se.cuhk.edu.hk\/~hmleung\/wordpress\/?p=1464"},"modified":"2012-03-28T12:04:20","modified_gmt":"2012-03-28T04:04:20","slug":"kernel-out-of-socket-memory","status":"publish","type":"post","link":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/?p=1464","title":{"rendered":"kernel: Out of socket memory"},"content":{"rendered":"<p>One machine running CentOS 5.5 x64 becomes non-responsive yesteraday , and I could only find some records in \/var\/log\/messages :<br \/>\n<b>kernel: Out of socket memory<\/b><br \/>\nOther than that , nothing significant is found. In this case , I don&#8217;t know if the max memory  allocated for TCP stack usage is all used up , or due to other reasons like too many orphans socket . <\/p>\n<p>To see the current kernel parameter for maximum memory value on TCP stack : <\/p>\n<blockquote>\n<p>\n% <b>sysctl -a | grep tcp | grep mem<\/b><br \/>\nnet.ipv4.tcp_rmem = 4096        87380   4194304<br \/>\nnet.ipv4.tcp_wmem = 4096        16384   4194304<br \/>\nnet.ipv4.tcp_mem = 786432       1048576 1572864\n<\/p>\n<\/blockquote>\n<p><font size=-2><br \/>\nNote:<\/p>\n<p>net.ipv4.tcp_rmem  : setting for recieve buffer size for all types of connection<br \/>\nnet.ipv4.tcp_wmem  : setting for send buffer size for all types of connection<br \/>\nnet.ipv4.tcp_mem :  memory size for TCP Stack , including all TCP sockets <\/p>\n<p><\/font><\/p>\n<p>To see current  kernel parameter for maximum orphans socket :<\/p>\n<blockquote>\n<p>\n%<b>sysctl -a | grep tcp | grep orphans<\/b><br \/>\nnet.ipv4.tcp_max_orphans = 65536<\/p>\n<\/blockquote>\n<p>To know the current usage Value  of  socket memory :<\/p>\n<blockquote<p>\n<b><\/p>\n<p>% cat \/proc\/net\/sockstat<\/b><\/p>\n<p>sockets: used 997<br \/>\nTCP: inuse 49 orphan 14 tw 267 alloc 589 mem 905<br \/>\nUDP: inuse 18 mem 0<br \/>\nRAW: inuse 0<br \/>\nFRAG: inuse 0 memory 0<\/p>\n<\/blockquote>\n<p>The above example shows orphan 14 and TCP memory used 905 which are far lower than the corresponding kernal parameter . I logged down the above value periodically , and will use that to compare with kernal parameter with the last record once the machine got crashed again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One machine running CentOS 5.5 x64 becomes non-responsive yesteraday , and I could only find some records in \/var\/log\/messages : kernel: Out of socket memory Other than that , nothing significant is found. In&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1464","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1464"}],"version-history":[{"count":0,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1464\/revisions"}],"wp:attachment":[{"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}