{"id":35671,"date":"2025-05-06T03:10:53","date_gmt":"2025-05-05T19:10:53","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/35671.html"},"modified":"2025-05-06T03:10:53","modified_gmt":"2025-05-05T19:10:53","slug":"nginx%e9%85%8d%e7%bd%ae%e9%9b%86%e7%be%a4%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%ad%e7%9a%84tcp%e8%b4%9f%e8%bd%bd%e5%9d%87%e8%a1%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/35671.html","title":{"rendered":"nginx\u914d\u7f6e\u96c6\u7fa4\u670d\u52a1\u5668\u4e2d\u7684tcp\u8d1f\u8f7d\u5747\u8861\u5668"},"content":{"rendered":"<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\u524d\u8a00<\/li>\n<li>1. Ubuntu\u4e0bnginx\u5b89\u88c5<\/li>\n<li>2. nginx\u7684tcp\u8d1f\u8f7d\u914d\u7f6e<\/li>\n<\/ul>\n<hr \/>\n<h2>\u524d\u8a00<\/h2>\n<p>\u5047\u8bbe\u4e00\u53f0\u673a\u5668\u652f\u6301\u4e24\u4e07\u7684\u5e76\u53d1\u91cf&#xff0c;\u73b0\u5728\u6211\u4eec\u9700\u8981\u4fdd\u8bc1\u516b\u4e07\u7684\u5e76\u53d1\u91cf\u3002\u9996\u5148\u60f3\u5230\u7684\u662f\u5347\u7ea7\u670d\u52a1\u5668\u7684\u914d\u7f6e&#xff0c;\u6bd4\u5982\u63d0\u9ad8 CPU \u6267\u884c\u9891\u7387&#xff0c;\u52a0\u5927\u5185\u5b58\u7b49\u63d0\u9ad8\u673a\u5668\u7684\u7269\u7406\u6027\u80fd\u6765\u89e3\u51b3\u6b64\u95ee\u9898\u3002\u4f46\u662f\u5355\u53f0\u673a\u5668\u7684\u6027\u80fd\u6bd5\u7adf\u662f\u6709\u9650\u7684\u3002<\/p>\n<p>\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u589e\u52a0\u670d\u52a1\u5668\u7684\u6570\u91cf&#xff0c;\u5c06\u7528\u6237\u8bf7\u6c42\u5206\u53d1\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5668\u4e0a\u5206\u62c5\u538b\u529b&#xff0c;\u8fd9\u5c31\u662f\u8d1f\u8f7d\u5747\u8861\u3002\u90a3\u6211\u4eec\u5c31\u9700\u8981\u6709\u4e00\u4e2a\u7b2c\u4e09\u65b9\u7ec4\u4ef6\u5145\u5f53\u8d1f\u8f7d\u5747\u8861\u5668&#xff0c;\u7531\u5b83\u8d1f\u8d23\u5c06\u4e0d\u540c\u7684\u8bf7\u6c42\u5206\u53d1\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5668\u4e0a\u3002\u8fd9\u91cc\u4ecb\u7ecd Nginx \u7684\u8d1f\u8f7d\u5747\u8861\u529f\u80fd\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250505191052-68190d3c12c05.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> Nginx\u4f5c\u4e3a tcp \u8d1f\u8f7d\u5747\u8861\u6a21\u5757\u7684\u539f\u56e0&#xff1a;<\/p>\n<li>\u628aclient\u7684\u8bf7\u6c42\u6309\u7167\u8d1f\u8f7d\u7b97\u6cd5\u5206\u53d1\u5230\u5177\u4f53\u7684\u4e1a\u52a1\u670d\u52a1\u5668ChatServer\u4e0a<\/li>\n<li>\u80fd\u591fChantServer\u4fdd\u6301\u5fc3\u8df3\u673a\u5236&#xff0c;\u68c0\u6d4bChatServer\u6545\u969c<\/li>\n<li>\u80fd\u591f\u53d1\u73b0\u65b0\u6dfb\u52a0\u7684ChatServer\u8bbe\u5907&#xff0c;\u65b9\u4fbf\u6269\u5c55\u670d\u52a1\u5668\u6570\u91cf<\/li>\n<h2>1. Ubuntu\u4e0bnginx\u5b89\u88c5<\/h2>\n<p>\u5728\u670d\u52a1\u5668\u5feb\u901f\u96c6\u7fa4\u73af\u5883\u642d\u5efa\u4e2d&#xff0c;\u90fd\u8feb\u5207\u9700\u8981\u4e00\u4e2a\u80fd\u62ff\u6765\u5373\u7528\u7684\u8d1f\u8f7d\u5747\u8861\u5668&#xff0c;nginx\u57281.9\u7248\u672c\u4e4b\u524d&#xff0c;\u53ea\u652f\u6301http\u534f\u8baeweb\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u5747\u8861&#xff0c;\u4ece1.9\u7248\u672c\u5f00\u59cb\u4ee5\u540e&#xff0c;nginx\u5f00\u59cb\u652f\u6301tcp\u7684\u957f\u8fde\u63a5\u8d1f\u8f7d\u5747\u8861&#xff0c;\u4f46\u662fnginx\u9ed8\u8ba4\u5e76\u6ca1\u6709\u7f16\u8bd1tcp\u8d1f\u8f7d\u5747\u8861\u6a21\u5757&#xff0c;\u7f16\u5199\u5b83\u65f6&#xff0c;\u9700\u8981\u52a0\u5165\u2013with-stream\u53c2\u6570\u6765\u6fc0\u6d3b\u8fd9\u4e2a\u6a21\u5757\u3002 nginx\u7f16\u8bd1\u52a0\u5165\u2013with-stream\u53c2\u6570\u6fc0\u6d3btcp\u8d1f\u8f7d\u5747\u8861\u5757<\/p>\n<p>1\u3001\u5b89\u88c5\u5305\u4e0b\u8f7d \u5730\u5740&#xff1a;https:\/\/nginx.org\/download\/<\/p>\n<p>2\u3001\u4e0a\u4f20\u81f3Ubuntu\u4e2d\u5e76\u89e3\u538b\u7f29 tar -zxvf nginx-1.16.1.tar.gz<\/p>\n<p>nginx\u7f16\u8bd1\u5b89\u88c5\u9700\u8981\u5148\u5b89\u88c5pcre\u3001openssl\u3001zlib\u7b49\u5e93\u3002\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7f16\u8bd1\u6267\u884c\u4e0b\u9762\u7684configure\u547d\u4ee4&#xff0c; \u6839\u636e\u9519\u8bef\u63d0\u793a\u4fe1\u606f&#xff0c;\u5b89\u88c5\u76f8\u5e94\u7f3a\u5c11\u7684\u5e93\u5373\u53ef\u3002<\/p>\n<p>\u4e0b\u9762\u7684make\u547d\u4ee4\u4f1a\u5411\u7cfb\u7edf\u8def\u5f84\u62f7\u8d1d\u6587\u4ef6&#xff0c;\u9700\u8981\u5728root\u7528\u6237\u4e0b\u6267\u884c<\/p>\n<p><span class=\"token function\">sudo<\/span> .\/configure -with-stream<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">make<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">make<\/span> <span class=\"token function\">install<\/span><\/p>\n<p>\u7f16\u8bd1\u5b8c\u6210\u540e&#xff0c;\u9ed8\u8ba4\u5b89\u88c5\u5728\u4e86\/usr\/local\/aginx\u76ee\u5f55\u3002<\/p>\n<p><span class=\"token builtin class-name\">cd<\/span> \/usr\/local\/nginx<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250505191052-68190d3c39131.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u53ef\u6267\u884c\u6587\u4ef6\u5728sbin\u76ee\u5f55\u91cc\u9762&#xff0c;\u914d\u7f6e\u6587\u4ef6\u5728conf\u65e5\u5f55\u91cc\u9762\u3002<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">vim<\/span> .\/conf\/nginx.conf<br \/>\n<span class=\"token function\">sudo<\/span> .\/sbin\/nginx -s reload<span class=\"token comment\">#\u91cd\u8bfbconf<\/span><br \/>\n<span class=\"token function\">sudo<\/span> .\/sbin\/nginx<span class=\"token comment\">#\u542f\u52a8<\/span><\/p>\n<h2>2. nginx\u7684tcp\u8d1f\u8f7d\u914d\u7f6e<\/h2>\n<p>\u5728bash\u4e2d\u4f7f\u7528<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">netstat<\/span> -tanp<\/p>\n<p>\u67e5\u770b\u5f53\u524dtcp\u8fde\u63a5\u60c5\u51b5 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250505191052-68190d3c45f58.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u5b89\u88c5\u7684nginx\u9ed8\u8ba4\u4f1a\u542f\u52a8\u76d1\u542c&#xff0c;\u8981\u6ce8\u610f\u4e00\u4e0b\u4ed6\u4eec\u7684\u7aef\u53e3\u4f4d\u7f6e \u5728events\u4e0ehttp\u4e4b\u95f4\u6dfb\u52a0tcp\u7684\u914d\u7f6e&#xff0c;\u5982\u4e0b&#xff1a;<\/p>\n<p><span class=\"token comment\">#user  nobody;<\/span><br \/>\nworker_processes  <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">#error_log  logs\/error.log;<\/span><br \/>\n<span class=\"token comment\">#error_log  logs\/error.log  notice;<\/span><br \/>\n<span class=\"token comment\">#error_log  logs\/error.log  info;<\/span><\/p>\n<p><span class=\"token comment\">#pid        logs\/nginx.pid;<\/span><\/p>\n<p>events <span class=\"token punctuation\">{<\/span><br \/>\n    worker_connections  <span class=\"token number\">1024<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># nginx tcp loadbalance config<\/span><br \/>\nstream <span class=\"token punctuation\">{<\/span><br \/>\nupstream MyServer <span class=\"token punctuation\">{<\/span><br \/>\nserver <span class=\"token number\">127.0<\/span>.0.1:6000 <span class=\"token assign-left variable\">weight<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span> <span class=\"token assign-left variable\">max_fails<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">3<\/span> <span class=\"token assign-left variable\">fail_timeout<\/span><span class=\"token operator\">&#061;<\/span>30s<span class=\"token punctuation\">;<\/span><br \/>\nserver <span class=\"token number\">127.0<\/span>.0.1:6002 <span class=\"token assign-left variable\">weight<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span> <span class=\"token assign-left variable\">max_fails<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">3<\/span> <span class=\"token assign-left variable\">fail_timeout<\/span><span class=\"token operator\">&#061;<\/span>30s<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>server <span class=\"token punctuation\">{<\/span><br \/>\nproxy_connect_timeout 1s<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\">#proxy_timeout 3s;<\/span><br \/>\nlisten <span class=\"token number\">8080<\/span><span class=\"token punctuation\">;<\/span><br \/>\nproxy_pass MyServer<span class=\"token punctuation\">;<\/span><br \/>\ntcp_nodelay on<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>http <span class=\"token punctuation\">{<\/span><br \/>\n    include       mime.types<span class=\"token punctuation\">;<\/span><br \/>\n    default_type  application\/octet-stream<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">#log_format  main  &#039;$remote_addr &#8211; $remote_user [$time_local] &#034;$request&#034; &#039;<\/span><br \/>\n    <span class=\"token comment\">#                  &#039;$status $body_bytes_sent &#034;$http_referer&#034; &#039;<\/span><br \/>\n    <span class=\"token comment\">#                  &#039;&#034;$http_user_agent&#034; &#034;$http_x_forwarded_for&#034;&#039;;<\/span><\/p>\n<p>    <span class=\"token comment\">#access_log  logs\/access.log  main;<\/span><\/p>\n<p>    sendfile        on<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">#tcp_nopush     on;<\/span><\/p>\n<p>    <span class=\"token comment\">#keepalive_timeout  0;<\/span><br \/>\n    keepalive_timeout  <span class=\"token number\">65<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">#gzip  on;<\/span><\/p>\n<p>    server <span class=\"token punctuation\">{<\/span><br \/>\n        listen       <span class=\"token number\">90<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        server_name  localhost<span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\">#charset koi8-r;<\/span><\/p>\n<p>        <span class=\"token comment\">#access_log  logs\/host.access.log  main;<\/span><\/p>\n<p>        location \/ <span class=\"token punctuation\">{<\/span><br \/>\n            root   html<span class=\"token punctuation\">;<\/span><br \/>\n            index  index.html index.htm<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        <span class=\"token comment\">#error_page  404              \/404.html;<\/span><\/p>\n<p>        <span class=\"token comment\"># redirect server error pages to the static page \/50x.html<\/span><br \/>\n        <span class=\"token comment\">#<\/span><br \/>\n        error_page   <span class=\"token number\">500<\/span> <span class=\"token number\">502<\/span> <span class=\"token number\">503<\/span> <span class=\"token number\">504<\/span>  \/50x.html<span class=\"token punctuation\">;<\/span><br \/>\n        location <span class=\"token operator\">&#061;<\/span> \/50x.html <span class=\"token punctuation\">{<\/span><br \/>\n            root   html<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5176\u4e2d&#xff0c;tcp\u90e8\u5206\u4e3a<\/p>\n<p><span class=\"token comment\"># nginx tcp loadbalance config<\/span><br \/>\nstream <span class=\"token punctuation\">{<\/span> <span class=\"token comment\">#\u8fd9\u91cc\u7684\u7aef\u53e3\u6307\u5411\u7684\u662f\u670d\u52a1\u5668\u7aef\u53e3<\/span><br \/>\nupstream MyServer <span class=\"token punctuation\">{<\/span> <span class=\"token comment\">#\u8981\u6dfb\u52a0\u591a\u5c11\u4e2a\u670d\u52a1\u5668&#xff0c;\u5c31\u5728\u4e0b\u9762\u5f00\u653e\u591a\u5c11\u4e2a\u7aef\u53e3<\/span><br \/>\nserver <span class=\"token number\">127.0<\/span>.0.1:6000 <span class=\"token assign-left variable\">weight<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span> <span class=\"token assign-left variable\">max_fails<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">3<\/span> <span class=\"token assign-left variable\">fail_timeout<\/span><span class=\"token operator\">&#061;<\/span>30s<span class=\"token punctuation\">;<\/span><br \/>\nserver <span class=\"token number\">127.0<\/span>.0.1:6002 <span class=\"token assign-left variable\">weight<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span> <span class=\"token assign-left variable\">max_fails<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">3<\/span> <span class=\"token assign-left variable\">fail_timeout<\/span><span class=\"token operator\">&#061;<\/span>30s<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>server <span class=\"token punctuation\">{<\/span><br \/>\nproxy_connect_timeout 1s<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">#\u8bbe\u7f6e\u4ee3\u7406\u8fde\u63a5\u8d85\u65f6\u65f6\u95f4<\/span><br \/>\n<span class=\"token comment\">#proxy_timeout 3s;<\/span><br \/>\nlisten <span class=\"token number\">8080<\/span><span class=\"token punctuation\">;<\/span><span class=\"token comment\">#\u76d1\u542c\u7aef\u53e3&#xff0c;\u5ba2\u6237\u7aef\u8fde\u63a5\u6b64\u7aef\u53e3\u5373\u53ef&#xff0c;nginx\u81ea\u52a8\u5904\u7406\u5206\u914d\u6d88\u606f\u7ed9\u670d\u52a1\u5668<\/span><br \/>\nproxy_pass MyServer<span class=\"token punctuation\">;<\/span><span class=\"token comment\">#\u4ee3\u7406\u7684\u540d\u5b57<\/span><br \/>\ntcp_nodelay on<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5ba2\u6237\u7aef\u53ea\u9700\u8fde\u63a5nginx\u914d\u7f6e\u7684\u76d1\u542c\u7aef\u53e3&#xff0c;\u5373\u53ef\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u901a\u4fe1 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250505191052-68190d3c61981.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250505191052-68190d3c81abd.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb746\u6b21\uff0c\u70b9\u8d5e26\u6b21\uff0c\u6536\u85cf12\u6b21\u3002\u5047\u8bbe\u4e00\u53f0\u673a\u5668\u652f\u6301\u4e24\u4e07\u7684\u5e76\u53d1\u91cf\uff0c\u73b0\u5728\u6211\u4eec\u9700\u8981\u4fdd\u8bc1\u516b\u4e07\u7684\u5e76\u53d1\u91cf\u3002\u9996\u5148\u60f3\u5230\u7684\u662f\u5347\u7ea7\u670d\u52a1\u5668\u7684\u914d\u7f6e\uff0c\u6bd4\u5982\u63d0\u9ad8 CPU \u6267\u884c\u9891\u7387\uff0c\u52a0\u5927\u5185\u5b58\u7b49\u63d0\u9ad8\u673a\u5668\u7684\u7269\u7406\u6027\u80fd\u6765\u89e3\u51b3\u6b64\u95ee\u9898\u3002\u4f46\u662f\u5355\u53f0\u673a\u5668\u7684\u6027\u80fd\u6bd5\u7adf\u662f\u6709\u9650\u7684\u3002\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u589e\u52a0\u670d\u52a1\u5668\u7684\u6570\u91cf\uff0c\u5c06\u7528\u6237\u8bf7\u6c42\u5206\u53d1\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5668\u4e0a\u5206\u62c5\u538b\u529b\uff0c\u8fd9\u5c31\u662f\u8d1f\u8f7d\u5747\u8861\u3002\u90a3\u6211\u4eec\u5c31\u9700\u8981\u6709\u4e00\u4e2a\u7b2c\u4e09\u65b9\u7ec4\u4ef6\u5145\u5f53\u8d1f\u8f7d\u5747\u8861\u5668\uff0c\u7531\u5b83\u8d1f\u8d23\u5c06\u4e0d\u540c\u7684\u8bf7\u6c42\u5206\u53d1\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5668\u4e0a\u3002\u8fd9\u91cc\u4ecb\u7ecdNginx\u7684\u8d1f\u8f7d\u5747\u8861\u529f\u80fd\u3002Nginx\u4f5c\u4e3atcp\u628aclient\u7684\u8bf7\u6c42\u6309\u7167\u8d1f\u8f7d\u7b97\u6cd5\u5206\u53d1\u5230\u5177\u4f53\u7684\u4e1a\u52a1\u670d\u52a1\u5668ChatServer\u4e0a\u80fd\u591f\u3002_agent \u96c6\u7fa4 tcp<\/p>\n","protected":false},"author":2,"featured_media":35666,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3044,117,205,43],"topic":[],"class_list":["post-35671","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-nginx","tag-tcp-ip","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>nginx\u914d\u7f6e\u96c6\u7fa4\u670d\u52a1\u5668\u4e2d\u7684tcp\u8d1f\u8f7d\u5747\u8861\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/35671.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"nginx\u914d\u7f6e\u96c6\u7fa4\u670d\u52a1\u5668\u4e2d\u7684tcp\u8d1f\u8f7d\u5747\u8861\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb746\u6b21\uff0c\u70b9\u8d5e26\u6b21\uff0c\u6536\u85cf12\u6b21\u3002\u5047\u8bbe\u4e00\u53f0\u673a\u5668\u652f\u6301\u4e24\u4e07\u7684\u5e76\u53d1\u91cf\uff0c\u73b0\u5728\u6211\u4eec\u9700\u8981\u4fdd\u8bc1\u516b\u4e07\u7684\u5e76\u53d1\u91cf\u3002\u9996\u5148\u60f3\u5230\u7684\u662f\u5347\u7ea7\u670d\u52a1\u5668\u7684\u914d\u7f6e\uff0c\u6bd4\u5982\u63d0\u9ad8 CPU \u6267\u884c\u9891\u7387\uff0c\u52a0\u5927\u5185\u5b58\u7b49\u63d0\u9ad8\u673a\u5668\u7684\u7269\u7406\u6027\u80fd\u6765\u89e3\u51b3\u6b64\u95ee\u9898\u3002\u4f46\u662f\u5355\u53f0\u673a\u5668\u7684\u6027\u80fd\u6bd5\u7adf\u662f\u6709\u9650\u7684\u3002\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u589e\u52a0\u670d\u52a1\u5668\u7684\u6570\u91cf\uff0c\u5c06\u7528\u6237\u8bf7\u6c42\u5206\u53d1\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5668\u4e0a\u5206\u62c5\u538b\u529b\uff0c\u8fd9\u5c31\u662f\u8d1f\u8f7d\u5747\u8861\u3002\u90a3\u6211\u4eec\u5c31\u9700\u8981\u6709\u4e00\u4e2a\u7b2c\u4e09\u65b9\u7ec4\u4ef6\u5145\u5f53\u8d1f\u8f7d\u5747\u8861\u5668\uff0c\u7531\u5b83\u8d1f\u8d23\u5c06\u4e0d\u540c\u7684\u8bf7\u6c42\u5206\u53d1\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5668\u4e0a\u3002\u8fd9\u91cc\u4ecb\u7ecdNginx\u7684\u8d1f\u8f7d\u5747\u8861\u529f\u80fd\u3002Nginx\u4f5c\u4e3atcp\u628aclient\u7684\u8bf7\u6c42\u6309\u7167\u8d1f\u8f7d\u7b97\u6cd5\u5206\u53d1\u5230\u5177\u4f53\u7684\u4e1a\u52a1\u670d\u52a1\u5668ChatServer\u4e0a\u80fd\u591f\u3002_agent \u96c6\u7fa4 tcp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/35671.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-05T19:10:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250505191052-68190d3c12c05.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/35671.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/35671.html\",\"name\":\"nginx\u914d\u7f6e\u96c6\u7fa4\u670d\u52a1\u5668\u4e2d\u7684tcp\u8d1f\u8f7d\u5747\u8861\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-05T19:10:53+00:00\",\"dateModified\":\"2025-05-05T19:10:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/35671.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/35671.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/35671.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"nginx\u914d\u7f6e\u96c6\u7fa4\u670d\u52a1\u5668\u4e2d\u7684tcp\u8d1f\u8f7d\u5747\u8861\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"nginx\u914d\u7f6e\u96c6\u7fa4\u670d\u52a1\u5668\u4e2d\u7684tcp\u8d1f\u8f7d\u5747\u8861\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/35671.html","og_locale":"zh_CN","og_type":"article","og_title":"nginx\u914d\u7f6e\u96c6\u7fa4\u670d\u52a1\u5668\u4e2d\u7684tcp\u8d1f\u8f7d\u5747\u8861\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb746\u6b21\uff0c\u70b9\u8d5e26\u6b21\uff0c\u6536\u85cf12\u6b21\u3002\u5047\u8bbe\u4e00\u53f0\u673a\u5668\u652f\u6301\u4e24\u4e07\u7684\u5e76\u53d1\u91cf\uff0c\u73b0\u5728\u6211\u4eec\u9700\u8981\u4fdd\u8bc1\u516b\u4e07\u7684\u5e76\u53d1\u91cf\u3002\u9996\u5148\u60f3\u5230\u7684\u662f\u5347\u7ea7\u670d\u52a1\u5668\u7684\u914d\u7f6e\uff0c\u6bd4\u5982\u63d0\u9ad8 CPU \u6267\u884c\u9891\u7387\uff0c\u52a0\u5927\u5185\u5b58\u7b49\u63d0\u9ad8\u673a\u5668\u7684\u7269\u7406\u6027\u80fd\u6765\u89e3\u51b3\u6b64\u95ee\u9898\u3002\u4f46\u662f\u5355\u53f0\u673a\u5668\u7684\u6027\u80fd\u6bd5\u7adf\u662f\u6709\u9650\u7684\u3002\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u589e\u52a0\u670d\u52a1\u5668\u7684\u6570\u91cf\uff0c\u5c06\u7528\u6237\u8bf7\u6c42\u5206\u53d1\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5668\u4e0a\u5206\u62c5\u538b\u529b\uff0c\u8fd9\u5c31\u662f\u8d1f\u8f7d\u5747\u8861\u3002\u90a3\u6211\u4eec\u5c31\u9700\u8981\u6709\u4e00\u4e2a\u7b2c\u4e09\u65b9\u7ec4\u4ef6\u5145\u5f53\u8d1f\u8f7d\u5747\u8861\u5668\uff0c\u7531\u5b83\u8d1f\u8d23\u5c06\u4e0d\u540c\u7684\u8bf7\u6c42\u5206\u53d1\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5668\u4e0a\u3002\u8fd9\u91cc\u4ecb\u7ecdNginx\u7684\u8d1f\u8f7d\u5747\u8861\u529f\u80fd\u3002Nginx\u4f5c\u4e3atcp\u628aclient\u7684\u8bf7\u6c42\u6309\u7167\u8d1f\u8f7d\u7b97\u6cd5\u5206\u53d1\u5230\u5177\u4f53\u7684\u4e1a\u52a1\u670d\u52a1\u5668ChatServer\u4e0a\u80fd\u591f\u3002_agent \u96c6\u7fa4 tcp","og_url":"https:\/\/www.wsisp.com\/helps\/35671.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-05T19:10:53+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250505191052-68190d3c12c05.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/35671.html","url":"https:\/\/www.wsisp.com\/helps\/35671.html","name":"nginx\u914d\u7f6e\u96c6\u7fa4\u670d\u52a1\u5668\u4e2d\u7684tcp\u8d1f\u8f7d\u5747\u8861\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-05T19:10:53+00:00","dateModified":"2025-05-05T19:10:53+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/35671.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/35671.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/35671.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"nginx\u914d\u7f6e\u96c6\u7fa4\u670d\u52a1\u5668\u4e2d\u7684tcp\u8d1f\u8f7d\u5747\u8861\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/35671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=35671"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/35671\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/35666"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=35671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=35671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=35671"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=35671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}