{"id":4547,"date":"2014-11-26T14:59:43","date_gmt":"2014-11-26T12:59:43","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=4547"},"modified":"2015-01-08T16:58:18","modified_gmt":"2015-01-08T14:58:18","slug":"nginx-fastcgi_connect_timeout","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=4547","title":{"rendered":"[nginx] fastcgi_connect_timeout"},"content":{"rendered":"<p>\u0412\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<div class=\"directive\">\n<table cellspacing=\"0\">\n<tbody>\n<tr>\n<th>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:<\/th>\n<td><code><strong>fastcgi_connect_timeout<\/strong> <code><i>\u0432\u0440\u0435\u043c\u044f<\/i><\/code>;<\/code><\/td>\n<\/tr>\n<tr>\n<th>\u0423\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u0435:<\/th>\n<td><code>fastcgi_connect_timeout 60s;<\/code><\/td>\n<\/tr>\n<tr>\n<th>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442:<\/th>\n<td><code>http<\/code>, <code>server<\/code>, <code>location<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<blockquote><p><span style=\"color: #993366;\">\u0417\u0430\u0434\u0430\u0451\u0442 \u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 FastCGI-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c 75 \u0441\u0435\u043a\u0443\u043d\u0434.<\/span><\/p><\/blockquote>\n<p><!--more-->\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u043e\u0442\u043a\u0443\u0434\u0430 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0438 \u0435\u0441\u0442\u044c \u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 75 \u0441\u0435\u043a\u0443\u043d\u0434. \u0412 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0435 \u043f\u043e <strong>nginx<\/strong> \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043e\u0442\u0432\u0435\u0442. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043e\u0442\u0432\u0435\u0442 \u0446\u0438\u0442\u0430\u0442\u043e\u0439:<\/p>\n<blockquote><p><span style=\"color: #993366;\">nginx \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u0434 FreeBSD, \u043d\u0430 \u043d\u0435\u0439 (\u0446\u0438\u0442\u0430\u0442\u0430 \u0438\u0437 tcp(4)):<\/span><\/p>\n<p><span style=\"color: #993366;\">: Timeout, in milliseconds, for new, non-established TCP connections.<\/span><br \/>\n<span style=\"color: #993366;\">: The default is 75000 msec.<\/span><\/p><\/blockquote>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043f\u043d\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435, \u0442\u043e \u043d\u0430 <strong>Linux<\/strong> \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043e\u043d \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044c\u0448\u0435 (\u043f\u043e\u0440\u044f\u0434\u043a\u0430 20 \u0441\u0435\u043a\u0443\u043d\u0434). \u0422\u043e \u0435\u0441\u0442\u044c, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00a0<strong>fastcgi_connect_timeout<\/strong> \u043d\u0430 <strong>Linux&#8217;e<\/strong> \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 20, \u0438\u043d\u0430\u0447\u0435 \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044f\u0434\u0435\u0440\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f <strong>timeout&#8217;a<\/strong>. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. \u0412\u044b\u0445\u043e\u0434\u0438\u0442, \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u044d\u0442\u043e, \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <strong>timeout&#8217;a<\/strong>. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c<\/p>\n<h2><strong><span style=\"color: #0000ff;\">FreeBSD\/OpenBSD<\/span><\/strong><\/h2>\n<p><code># sysctl net.inet.tcp.keepinit=180000<\/code><\/p>\n<h2><strong><span style=\"color: #0000ff;\">Solaris<\/span><\/strong><\/h2>\n<p><code># ipadm set-prop -p _keepalive_interval=1800000 tcp<\/code><\/p>\n<h2><strong><span style=\"color: #0000ff;\">Linux<\/span><\/strong><\/h2>\n<p><code># sysctl net.ipv4.tcp_syn_retries = 8<\/code><\/p>\n<p>\u0414\u043b\u044f <strong>Linux<\/strong> \u0441\u0438\u0441\u0442\u0435\u043c \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u0430: \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u044b\u0442\u043e\u043a, \u0430 \u043d\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c \u0431\u044b\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 6 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 45 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u043c, 7 &#8211; 90, 8 &#8211; 190. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c <a href=\"http:\/\/www.sekuda.com\/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout\" target=\"_blank\">\u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441: fastcgi_connect_timeout \u0432\u0440\u0435\u043c\u044f; \u0423\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u0435: fastcgi_connect_timeout 60s; \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442: http, server, location \u0417\u0430\u0434\u0430\u0451\u0442 \u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 FastCGI-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c 75 \u0441\u0435\u043a\u0443\u043d\u0434.<\/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,25,24],"tags":[],"class_list":["post-4547","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-linux","category-openbsd","category-solaris"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4547","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=4547"}],"version-history":[{"count":2,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4547\/revisions"}],"predecessor-version":[{"id":4627,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4547\/revisions\/4627"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}