{"id":5455,"date":"2018-03-07T16:24:09","date_gmt":"2018-03-07T14:24:09","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=5455"},"modified":"2025-05-20T13:06:52","modified_gmt":"2025-05-20T10:06:52","slug":"reuseport","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=5455","title":{"rendered":"REUSEPORT"},"content":{"rendered":"<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <strong>REUSEPORT<\/strong>? \u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e, \u0442\u043e \u0432 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u0447\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u043a <strong>tcp socket&#8217;y<\/strong> (\u0430\u0434\u0440\u0435\u0441:\u043f\u043e\u0440\u0442). \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b (\u0431\u0435\u0437 <strong>REUSEPORT<\/strong> \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u0441\u0442\u0435\u0440-\u043f\u0440\u043e\u0446\u0435\u0441\u0441).<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c\/\u043f\u043e\u043d\u044f\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043b\u0438 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <strong>REUSEPORT<\/strong> \u0448\u0442\u0430\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u041e\u0421. \u041e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <strong>REUSEPORT<\/strong> \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u041e\u0421 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u0430\u044f <a href=\"https:\/\/stackoverflow.com\/questions\/14388706\/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a>, \u043d\u043e \u0432\u043e\u0442 \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e <strong>Solaris<\/strong> \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u043c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435.<\/p>\n<p><!--more--><\/p>\n<h2><span style=\"color: #0000ff;\"><strong>FreeBSD<\/strong><\/span><\/h2>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <strong>REUSEPORT<\/strong>, \u0432\u0442\u043e\u0440\u043e\u0439 &#8211; \u0441 \u043d\u0438\u043c.<\/p>\n<pre># procstat -f 94919\n  PID COMM                FD T V FLAGS    REF  OFFSET PRO NAME\n...\n95154 unbound              3 s - rw---n--   5       0 UDP 0.0.0.0:53 0.0.0.0:0\n95154 unbound              4 s - rw---n--   5       0 TCP 0.0.0.0:53 0.0.0.0:0\n...\n<\/pre>\n<pre># procstat -f 94919\n  PID COMM                FD T V FLAGS    REF  OFFSET PRO NAME\n...\n94919 unbound              3 s - rw---n--   2       0 UDP 0.0.0.0:53 0.0.0.0:0\n94919 unbound              4 s - rw---n--   2       0 TCP 0.0.0.0:53 0.0.0.0:0\n94919 unbound              5 s - rw---n--   2       0 UDP 0.0.0.0:53 0.0.0.0:0\n94919 unbound              6 s - rw---n--   2       0 TCP 0.0.0.0:53 0.0.0.0:0\n94919 unbound              7 s - rw---n--   2       0 UDP 0.0.0.0:53 0.0.0.0:0\n94919 unbound              8 s - rw---n--   2       0 TCP 0.0.0.0:53 0.0.0.0:0\n94919 unbound              9 s - rw---n--   2       0 UDP 0.0.0.0:53 0.0.0.0:0\n94919 unbound             10 s - rw---n--   2       0 TCP 0.0.0.0:53 0.0.0.0:0\n...\n<\/pre>\n<h2><span style=\"color: #0000ff;\"><strong>Solaris<\/strong><\/span><\/h2>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043c\u043d\u0435 \u0442\u0430\u043a \u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u041f\u041e \u043f\u043e\u0434 <strong>Solaris<\/strong>, \u0447\u0442\u043e \u0431\u044b \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b <strong>REUSEPORT<\/strong>, \u0445\u043e\u0442\u044f \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u041e\u0421 \u044d\u0442\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b <a href=\"https:\/\/docs.oracle.com\/cd\/E26502_01\/html\/E29044\/tcp-7p.html\">\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d<\/a>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u0438 <strong>reuseport<\/strong>, \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<p><code># pfiles &lt;PID&gt;<\/code><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <strong>REUSEPORT<\/strong>, \u0437\u043d\u0430\u0447\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<h2><span style=\"color: #0000ff;\"><strong>Linux<\/strong><\/span><\/h2>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0443 <a href=\"http:\/\/veithen.github.io\/2013\/12\/19\/inspecting-socket-options-on-linux.html\">\u043c\u043e\u0434\u0443\u043b\u044f<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0432\u044b\u0432\u043e\u0434 <strong>netstat SO_<\/strong> \u043e\u043f\u0446\u0438\u0438. \u0414\u0440\u0443\u0433\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u0438 <strong>REUSEPORT<\/strong> \u044f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 REUSEPORT? \u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e, \u0442\u043e \u0432 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u0447\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u043a tcp socket&#8217;y (\u0430\u0434\u0440\u0435\u0441:\u043f\u043e\u0440\u0442). \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b (\u0431\u0435\u0437 REUSEPORT \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u0441\u0442\u0435\u0440-\u043f\u0440\u043e\u0446\u0435\u0441\u0441). \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c\/\u043f\u043e\u043d\u044f\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043b\u0438 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 REUSEPORT \u0448\u0442\u0430\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u041e\u0421. \u041e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 REUSEPORT \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u041e\u0421 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5,10,24],"tags":[],"class_list":["post-5455","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-linux","category-others","category-solaris"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5455"}],"version-history":[{"count":5,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5455\/revisions"}],"predecessor-version":[{"id":6585,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5455\/revisions\/6585"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}