{"id":304231,"date":"2020-05-26T03:00:11","date_gmt":"2020-05-26T03:00:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304231"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304231","title":{"rendered":"\u0427\u0442\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u044b\u0432\u043e\u0434 \u00abss -s\u00bb"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/503648\/\">\u041d\u0430 \u0441\u043c\u0435\u043d\u0443 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 <a href=\"http:\/\/man7.org\/linux\/man-pages\/man8\/netstat.8.html\" rel=\"nofollow\">netstat<\/a> \u043f\u0440\u0438\u0448\u043b\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <a href=\"http:\/\/man7.org\/linux\/man-pages\/man8\/ss.8.html\" rel=\"nofollow\">ss<\/a> \u0438 \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u0432\u043e\u0434 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 (\u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e\u0439) \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u00ab<b>ss -s<\/b>\u00bb (\u0438\u043b\u0438 \u00ab<b>ss &#8212;summary<\/b>\u00bb) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0443\u0436\u0434 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, \u0447\u0442\u043e \u0436\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439? <\/p>\n<pre><code class=\"bash\"># ss -s Total: 15046 (kernel 16739) TCP:   39306 (estab 11458, closed 25092, orphaned 110, synrecv 0, timewait 24929\/0), ports 0  Transport Total     IP        IPv6 *\t  16739     -         -         RAW\t  0         0         0         UDP\t  15        5         10        TCP\t  14214     1214      13000     INET\t  14229     1219      13010     FRAG\t  0         0         0         <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0438\u0441\u0442\u0438\u043d\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u00abss\u00bb \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/git.kernel.org\/pub\/scm\/network\/iproute2\/iproute2.git\/tree\/misc\/ss.c\" rel=\"nofollow\">iproute2\/misc\/ss.c<\/a>. \u0412\u044b\u0432\u043e\u0434 \u00abss -s\u00bb \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/git.kernel.org\/pub\/scm\/network\/iproute2\/iproute2.git\/tree\/misc\/ss.c?h=v5.6.0#n4937\" rel=\"nofollow\">print_summary<\/a>.<\/p>\n<p>  \u0414\u043e \u0432\u0435\u0440\u0441\u0438\u0438 4.17.0 \u0432\u044b\u0432\u043e\u0434 \u00abss -s\u00bb \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d \u0432\u044b\u0448\u0435. \u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u0430 <a href=\"https:\/\/git.kernel.org\/pub\/scm\/network\/iproute2\/iproute2.git\/commit\/misc\/ss.c?h=v4.17.0&amp;id=10f687736b8dd538fb5e2bdacf6bef2c690ee99d\" rel=\"nofollow\">90ee99d<\/a> \u043e\u043d \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"bash\"># ss -s Total: 15046 TCP:   39306 (estab 11458, closed 25092, orphaned 110, timewait 24929)  Transport Total     IP        IPv6 RAW\t  0         0         0         UDP\t  15        5         10        TCP\t  14214     1214      13000     INET\t  14229     1219      13010     FRAG\t  0         0         0         <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u00abTotal\u00bb \u0443\u0434\u0430\u043b\u0435\u043d\u043e \u043f\u043e\u043b\u0435 \u00abkernel\u00bb. \u0412 \u0441\u0442\u0440\u043e\u043a\u0435 \u00abTCP\u00bb \u0443\u0434\u0430\u043b\u0435\u043d\u043e \u043f\u043e\u043b\u0435 \u00absynrecv\u00bb, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043e\u0434\u043d\u043e (\u043f\u0435\u0440\u0432\u043e\u0435) \u0447\u0438\u0441\u043b\u043e \u00abtimewait\u00bb, \u0443\u0434\u0430\u043b\u0435\u043d\u043e \u043f\u043e\u043b\u0435 \u00abports\u00bb. \u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u00abTransport\u00bb \u0443\u0434\u0430\u043b\u0435\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u00ab*\u00bb. \u041e\u0431\u0449\u0438\u0439 \u0441\u043c\u044b\u0441\u043b \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u043a: &quot;<b>\u041c\u044b \u0443\u0434\u0430\u043b\u0438\u043b\u0438 \u0438\u0437 \u0432\u044b\u0432\u043e\u0434\u0430 \u0442\u043e, \u0447\u0442\u043e \u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u043c\u0430\u043d\u043e<\/b>&quot;.<\/p>\n<h4>\u0427\u0442\u043e \u0436\u0435 \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u043c\u0430\u043d\u043e?<\/h4>\n<p>  \u0412 <a href=\"https:\/\/git.kernel.org\/pub\/scm\/network\/iproute2\/iproute2.git\/tree\/misc\/ss.c?h=v4.16.0#n4515\" rel=\"nofollow\">print_summary<\/a> \u0432\u0435\u0440\u0441\u0438\u0438 4.16.0 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <a href=\"https:\/\/git.kernel.org\/pub\/scm\/network\/iproute2\/iproute2.git\/tree\/misc\/ss.c?h=v4.16.0#n718\" rel=\"nofollow\">slabstat<\/a>, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u043c <a href=\"https:\/\/git.kernel.org\/pub\/scm\/network\/iproute2\/iproute2.git\/tree\/misc\/ss.c?h=v4.16.0#n728\" rel=\"nofollow\">get_slabstat<\/a>. \u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432\u044b\u0437\u043e\u0432 \u00abget_slabstat\u00bb \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b shell, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\"># egrep '^(sock|tcp_bind_bucket|tcp_tw_bucket|tcp_open_request|skbuff_head_cache)' \/proc\/slabinfo | awk '{ print $1, $2; }'<\/code><\/pre>\n<p>  \u0413\u0434\u0435 \u043a\u043b\u044e\u0447\u0438 \u0438\u0437 \u00ab\/proc\/slabinfo\u00bb \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u043e\u043b\u044f\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u00abslabstat\u00bb:<\/p>\n<pre><code class=\"cpp\">struct slabstat { \tint socks;       \/\/ sock, net\/core\/sock.c:sk_init, \u0443\u0434\u0430\u043b\u0435\u043d\u043e \u0432 2.6.12 \tint tcp_ports;   \/\/ tcp_bind_bucket, net\/ipv4\/tcp.c:tcp_init \tint tcp_tws;     \/\/ tcp_tw_bucket, net\/ipv4\/tcp.c:tcp_init, \u0443\u0434\u0430\u043b\u0435\u043d\u043e \u0432 2.6.14 \tint tcp_syns;    \/\/ tcp_open_request, net\/ipv4\/tcp.c:tcp_init, \u0443\u0434\u0430\u043b\u0435\u043d\u043e \u0432 2.6.13 \tint skbs;        \/\/ skbuff_head_cache, net\/core\/skbuff:skb_init, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f }; <\/code><\/pre>\n<p>  \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0438\u0437 \u0432\u0441\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0438\u0437 \u00ab\/proc\/slabinfo\u00bb \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u00abtcp_bind_bucket\u00bb, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u0435 \u00abports\u00bb. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0437 \u043a\u043d\u0438\u0433\u0438 \u00abTCP\/IP Architecture, Design, and Implementation in Linux. By S. Seth and M. A. Venkatesulu 2008 the IEEE Computer Society\u00bb:  <\/p>\n<blockquote><p>This structure keeps information about the port number usage by sockets and the way the port number is being used. The information is useful enough to tell the new binding socket whether it can bind itself to a particular port number that is already in use. The data structure also keeps track of all the socket\u2019s that are associated with this port number.<\/p><\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0449\u0435 \u0440\u0430\u0437 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0432 \u0432\u0438\u0434\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 (\u0445\u0443\u0434\u043e\u0436\u043d\u0438\u043a \u0438\u0437 \u043c\u0435\u043d\u044f \u0442\u0430\u043a \u0441\u0435\u0431\u0435):<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nh\/do\/ym\/nhdoym9qq9nhakjcq0qs8pubpuu.png\"><\/p>\n<p>  \u041d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442\u0435? Slab \u00absock\u00bb (\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 2.6.12) \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u2014 \u0438\u0437 \u0437\u0430 <a href=\"https:\/\/git.kernel.org\/pub\/scm\/network\/iproute2\/iproute2.git\/tree\/misc\/ss.c?h=v4.16.0#n761\" rel=\"nofollow\">\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a<\/a> \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u043b\u044e\u0431\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u044e\u0447 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u00absock\u00bb. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u00absock_inode_cache\u00bb \u0438\u0437 \u00abnet\/socket.c:init_inodecache\u00bb \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0439\u0441\u044f \u043a \u00absockfs\u00bb \u2014 \u0441\u043f\u0438\u0441\u043e\u043a \u00abinode\u00bb, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u00absocket struct\u00bb (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043b \u0430\u0432\u0442\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442\u044b):<\/p>\n<pre><code class=\"bash\"># egrep '^sock' \/proc\/slabinfo | awk '{ print $1, $2; }' sock_inode_cache 16739 <\/code><\/pre>\n<p>  \u041d\u0443 \u0430 \u00abtcp_bind_bucket\u00bb \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438\u0437 \u0437\u0430 \u043e\u043f\u0446\u0438\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u044f\u0434\u0440\u0430 (\u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u043b\u0435 \u00abports\u00bb \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u00ab0\u00bb).<\/p>\n<h4>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u00abss -s\u00bb<\/h4>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0432 \u0445\u0438\u0442\u0440\u043e\u0441\u043f\u043b\u0435\u0442\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043e\u0441\u0432\u0435\u0436\u0438\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u043e\u043a\u0435\u0442\u043e\u0432 (ESTABLISHED, CLOSE-WAIT, TIME-WAIT \u0438 \u0442.\u0434.). \u0414\u043b\u044f \u0442\u0435\u0445 \u043f\u043e\u0434\u0437\u0430\u0431\u044b\u043b, \u0432\u0438\u043a\u0438 \u0432 \u043f\u043e\u043c\u043e\u0449\u044c: <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Transmission_Control_Protocol#%D0%A1%D0%BE%D1%81%D1%82%D0%BE%D1%8F%D0%BD%D0%B8%D1%8F_%D1%81%D0%B5%D0%B0%D0%BD%D1%81%D0%B0_TCP\" rel=\"nofollow\">RU<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Transmission_Control_Protocol#Protocol_operation\" rel=\"nofollow\">EN<\/a>.<\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u0431\u0430\u0437\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<pre><code class=\"bash\"># cat \/proc\/net\/sockstat sockets: used 15046 TCP: inuse 1205 orphan 111 tw 24952 alloc 14368 mem 5890 UDP: inuse 5 mem 86 UDPLITE: inuse 0 RAW: inuse 0 FRAG: inuse 0 memory 0  # cat \/proc\/net\/sockstat6 TCP6: inuse 13000 UDP6: inuse 10 UDPLITE6: inuse 0 RAW6: inuse 0 FRAG6: inuse 0 memory 0  # egrep '^Tcp:' \/proc\/net\/snmp Tcp: RtoAlgorithm RtoMin RtoMax ... AttemptFails EstabResets CurrEstab ... Tcp: 1 200 120000 ... 1348218 4095008 11458 ... <\/code><\/pre>\n<p>  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 \u00abnet\/sockstat\u00bb (\u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445):<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ll\/y9\/r_\/lly9r_hmfcfhkf1-tyu0opkbyg8.png\"><\/p>\n<ul>\n<li><b>Total<\/b> \u2014 \u043e\u0431\u0449\u0435\u0435 \u0447\u0438\u0441\u043b\u043e \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f unix-\u0441\u043e\u043a\u0435\u0442\u044b) \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043a\u0440\u043e\u043c\u0435 TIME_WAIT;<\/li>\n<li><b>TCP:<\/b> \u2014 \u043e\u0431\u0449\u0435\u0435 \u0447\u0438\u0441\u043b\u043e TCP \u0441\u043e\u043a\u0435\u0442\u043e\u0432 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f IPv6) \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, <b>tw<\/b> \u0441\u043e\u043a\u0435\u0442\u044b \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u044b \u043e\u0442 <b>alloc<\/b> \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0438\u0437 \u0437\u0430 \u0442.\u043d. \u00ab<b>death row<\/b>\u00bb \u2014 \u0438\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 CLOSED.<br \/> \n<ul>\n<li><b>orphaned<\/b> \u2014 \u043e\u0431\u0449\u0435\u0435 \u0447\u0438\u0441\u043b\u043e \u00ab\u043e\u0441\u0438\u0440\u043e\u0442\u0435\u0432\u0448\u0438\u0445\u00bb TCP \u0441\u043e\u043a\u0435\u0442\u043e\u0432 (\u0441\u043e\u043a\u0435\u0442\u043e\u0432, \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c\u0438 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445);<\/li>\n<li><b>timewait<\/b> \u2014 \u043e\u0431\u0449\u0435\u0435 \u0447\u0438\u0441\u043b\u043e TCP \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 TIME_WAIT;<\/li>\n<li><b>inuse TCP, UDP, RAW<\/b> \u2014 \u043e\u0431\u0449\u0435\u0435 \u0447\u0438\u0441\u043b\u043e <b>v4<\/b> \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u0438\u043f\u0430 \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c CLOSED \u0438 TIME_WAIT;<\/li>\n<li><b>inuse FRAG<\/b> (bool) \u2014 \u0444\u043b\u0430\u0433 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, <b>memory<\/b> \u2014 \u043e\u0431\u044a\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u0434\u0435\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445 (\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 <b>mem<\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 \u00abnet\/sockstat6\u00bb:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oq\/i7\/ja\/oqi7jaqtagey4sy-kkgkejirudw.png\"><\/p>\n<p>  \u0422\u0443\u0442 \u0432\u0440\u043e\u0434\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u00ab<b>Transport \/ Total<\/b>\u00bb \u0435\u0441\u0442\u044c \u043f\u043e\u043a\u043e\u043b\u043e\u043d\u043e\u0447\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u00ab<b>IP<\/b>\u00bb \u0438 \u00ab<b>IPv6<\/b>\u00bb.<\/p>\n<p>  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 \u00abnet\/snmp\u00bb. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/tools.ietf.org\/html\/rfc4022\" rel=\"nofollow\">RFC-4022<\/a>, \u00ab<b>tcpCurrEstab<\/b>\u00bb \u0435\u0441\u0442\u044c \u00abThe number of TCP connections for which the current state is either ESTABLISHED or CLOSE-WAIT\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qo\/2x\/as\/qo2xascklqre17kvzw9yxktyo-o.png\"><\/p>\n<p>  \u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u043e\u043b\u0435 \u00ab<b>closed<\/b>\u00bb \u2014 \u0435\u0441\u0442\u044c \u0441\u0443\u043c\u043c\u0430 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0438 \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 TIME_WAIT \u0437\u0430 \u0432\u044b\u0447\u0435\u0442\u043e\u043c \u0441\u0443\u043c\u043c\u044b TCPv4 \u0438 TCPv6 \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0432 \u043b\u044e\u0431\u043e\u043c \u0438\u0437 \u043d\u0435\u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1_\/sp\/oa\/1_spoafqh2_qydt6jxtrsszmf_s.png\"><\/p>\n<p>  P.S. \u0418 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0441\u0438 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/503648\/\"> https:\/\/habr.com\/ru\/post\/503648\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/503648\/\">\u041d\u0430 \u0441\u043c\u0435\u043d\u0443 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 <a href=\"http:\/\/man7.org\/linux\/man-pages\/man8\/netstat.8.html\" rel=\"nofollow\">netstat<\/a> \u043f\u0440\u0438\u0448\u043b\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <a href=\"http:\/\/man7.org\/linux\/man-pages\/man8\/ss.8.html\" rel=\"nofollow\">ss<\/a> \u0438 \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u0432\u043e\u0434 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 (\u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e\u0439) \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u00ab<b>ss -s<\/b>\u00bb (\u0438\u043b\u0438 \u00ab<b>ss &#8212;summary<\/b>\u00bb) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0443\u0436\u0434 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, \u0447\u0442\u043e \u0436\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439? <\/p>\n<pre><code class=\"bash\"># ss -s Total: 15046 (kernel 16739) TCP:   39306 (estab 11458, closed 25092, orphaned 110, synrecv 0, timewait 24929\/0), ports 0  Transport Total     IP        IPv6 *\t  16739     -         -         RAW\t  0         0         0         UDP\t  15        5         10        TCP\t  14214     1214      13000     INET\t  14229     1219      13010     FRAG\t  0         0         0         <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-304231","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=304231"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304231\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}