Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(): Failed opening '/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear') in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723
{"id":379,"date":"2013-10-23T22:57:44","date_gmt":"2013-10-23T14:57:44","guid":{"rendered":"http:\/\/blog.unethost.com\/?p=379"},"modified":"2015-04-23T14:13:39","modified_gmt":"2015-04-23T06:13:39","slug":"load-balancing","status":"publish","type":"post","link":"https:\/\/blog.unethost.com\/load-balancing\/","title":{"rendered":"\u5982\u4f55\u6c7a\u5b9a\u4e3b\u6a5f\u662f\u5426\u8981\u5206\u6d41\uff1f"},"content":{"rendered":"

disp.cc<\/a> \u662f\u500b\u5f88\u6709\u7279\u8272\u7684\u96fb\u5b50\u5e03\u544a\u6b04\u7db2\u7ad9\uff0c\u5b83\u7528http + Ajax\u505a\u51fa\u985e\u4f3cBBS\u7684\u700f\u89bd\u6548\u679c\uff0c\u800c\u4e14\u6bd4BBS\u66f4\u597d\u7528\u3002\u4f5c\u8005\u662f\u53f0\u5927\u96fb\u4fe1\u6240\u7562\u696d\u7684\u9ad8\u6750\u751f\u3002\u6700\u8fd1\uff0cdisp.cc\u7684\u4eba\u6c23\u6108\u4f86\u6108\u9ad8\uff0c\u6211\u4e5f\u9806\u4fbf\u770b\u4e86\u4e00\u4e0b\uff0cdisp.cc\u7684\u7ad9\u9577\uff0cknuckles\u662f\u5982\u4f55\u8655\u7406\u5206\u6d41\u554f\u984c\u7684\u3002<\/p>\n

\u5f15\u8ff0\u7ad9\u9577\u5728\u4ed6\u500b\u4eba\u7684\u6587\u7ae0\u4e2d\uff0c\u5beb\u4e0b\u7684\u6548\u80fd\u8abf\u6821\u65b9\u6cd5\uff1a<\/p>\n

\"disp.cc<\/a><\/p>\n

\u4e0d\u904e\u5f04\u4e86\u4e4b\u5f8c\u767c\u73fe\uff0c\u5728\u4e00\u6a23\u7684\u50f9\u9322\u4e0b\uff0c\u4e00\u53f016G + \u4e00\u53f08G \u7684\u6548\u80fd\uff0c\u6bd4\u4e00\u53f0 24G \u7684\u6548\u80fd\u597d\u592a\u591a\u4e86 \u4e4b\u524d\u7528\u55ae\u7368\u4e00\u53f024G\u6642\uff0c\u8a18\u61b6\u9ad4\u9084\u7a7a\u8457\u5f88\u591a\uff0c\u7cfb\u7d71\u8ca0\u8f09\u5c31\u98c6\u9ad8\u4e86… \u770b\u4f86\u8981\u589e\u52a0\u4f7f\u7528\u8005\u4e0d\u662f\u55ae\u7d14\u52a0\u8a18\u61b6\u9ad4\u5c31\u597d\u4e86<\/em><\/span><\/p>\n

disp.cc\u7684\u7ad9\u9577\u662f\u79df\u7528\u65e5\u672c\u7684\u4e3b\u6a5f\uff0c\u6240\u4ee5\u6709RTT\u4e0a\u7684\u512a\u52e2\u3002\u800c\u4e14\u8a72\u65e5\u672c\u7684\u4e3b\u6a5f\u5546\u6709\u63d0\u4f9b\u4e00\u4e9b\u9ad8\u7d1a\u7684\u5206\u6d41\u5de5\u5177\uff0c\u4f8b\u5982node balancer\uff0c\u6240\u4ee5\u7ad9\u9577\u4e5f\u53ef\u4ee5\u76f8\u5c0d\u5bb9\u6613\u5b8c\u6210\u5206\u6d41\u9019\u4ef6\u4e8b\u3002\u96d6\u7136\u6211\u500b\u4eba\u8a8d\u70ba\uff0cdisp.cc\u7ad9\u9577\u505a\u7684\u6c7a\u7b56\u975e\u5e38\u7684\u6b63\u78ba\uff0c\u4f46\u662f\uff0c\u6211\u537b\u4e0d\u6703\u5efa\u8b70\u6211\u6240\u6709\u7684\u5ba2\u6236\u63a1\u7528\u985e\u4f3c\u7684\u89e3\u6cd5\u3002\u8981\u8aaa\u660e\u9019\u500b\u89c0\u9ede\uff0c\u8981\u5148\u5f9edisp.cc\u7684web server \u8a2d\u5b9a\u958b\u59cb\u8b1b\u8d77\u3002<\/p>\n

Disp.cc\u7684web server\u67b6\u69cb<\/h2>\n

\u5728\u6211\u5beb\u9019\u7bc7\u6587\u7ae0\u7684\u6642\u9593\u9ede\uff0cdisp.cc\u4f7f\u7528\u7684web server\u662fapache 2.2.15\uff0cPHP\/5.4.20\u3002\u96d6\u7136\u8aaa\uff0c\u6211\u6c92\u6709\u9032\u4e00\u6b65\u7684\u6548\u80fd\u8abf\u7bc0\u8cc7\u8a0a\uff0c\u4f46\u662f\u5f9e\u7ad9\u9577\u63d0\u4f9b\u7684\u8cc7\u6599\uff0c\u6211\u6703\u731c\u6e2c\uff0c\u4e4b\u6240\u4ee5\u6703\u767c\u751f\u300e\u55ae\u7368\u4e00\u53f024G\u6642\uff0c\u8a18\u61b6\u9ad4\u9084\u7a7a\u8457\u5f88\u591a\uff0c\u7cfb\u7d71\u8ca0\u8f09\u5c31\u98c6\u9ad8\u4e86<\/span>\u300f<\/em>\u9019\u7a2e\u60c5\u6cc1\uff0c\u9019\u8ddfapache C10K\u554f\u984c\u6709\u95dc\u3002<\/p>\n

apache C10K\u554f\u984c<\/h2>\n

\u9019\u500b\u554f\u984c\u662f\u9019\u6a23\u5b50\u7522\u751f\u7684\uff1a\u5c0d\u65bc\u8981\u5beb\u7db2\u8def\u7a0b\u5f0f\uff0c\u6700\u76f4\u89ba\u7684\u5beb\u6cd5\uff0c\u5c31\u662f\u7528\u963b\u585e\u5f0fI\/O\u4e26\u4e14\u914d\u5408\u591a\u57f7\u884c\u7dd2\u3002( blocking I\/O & multi-thread )\uff0c\u53c8\u7a31\u4e4b\u70bathread-model\u7684\u5beb\u6cd5\u3002\u9019\u6a23\u5b50\u96d6\u7136\u662f\u6700\u7c21\u55ae\u6700\u76f4\u63a5\u7684\u5beb\u6cd5\uff0c\u5728\u9023\u63a5\u6578(connection number)\u5230\u9054\u4e00\u842c(10k)\u6642\uff0c\u56e0\u70ba\u5927\u91cf\u7684\u57f7\u884c\u7dd2\u4e0d\u505c\u5730\u505a\u74b0\u5883\u5207\u63db(context switch)\uff0c\u5c0e\u81f4\u589e\u52a0\u786c\u9ad4\u4e5f\u7121\u6cd5\u63d0\u5347\u6548\u80fd\u7684\u7a98\u5883\u3002Context switch\u5e36\u4f86\u7684\u6548\u80fd\u640d\u8017\u6703\u96a8\u8457\u57f7\u884c\u7dd2(thread)\u6108\u591a\u6108\u52a0\u56b4\u91cd\uff0c\u7d42\u65bc\u572810000\u500b\u9023\u63a5\u6578\u6642\uff0c\u5230\u9054\u5d29\u6f70\u7684\u6642\u9593\u9ede\u3002\u4ee5\u4eca\u65e5\u7684\u700f\u89bd\u5668\uff0c\u5f80\u5f80\u8f15\u6613\u5730\u53ef\u4ee5\u7522\u751f6~10\u500b\u5e73\u884c\u7684\u9023\u63a5\u6578\uff0c\u540c\u6642\u4e0a\u7dda\u4eba\u6578\u5230\u90542000\u4eba\u6642\uff0c\u9019\u500bC10K\u73fe\u8c61\u5c31\u6703\u65e5\u76ca\u56b4\u91cd\u3002<\/p>\n

C10K\u554f\u984c\u7684\u89e3\u6cd5<\/h2>\n

\u76f8\u5c0d\u65bc\u50b3\u7d71\u7684\u963b\u585e\u5f0fI\/O\u548c\u591a\u57f7\u884c\u7dd2\u5beb\u6cd5\uff0c\u53e6\u4e00\u7a2e\u5beb\u7a0b\u5f0f\u7684\u5beb\u6cd5\uff0c\u662f\u4f7f\u7528\u975e\u963b\u585e\u5f0f\u7684I\/O\uff0c\u55ae\u4e00\u57f7\u884c\u7dd2\u8655\u7406\u5927\u91cf\u9023\u63a5\u7684\u5beb\u6cd5\u3002\u4ee3\u8868\u4f5c\u54c1\u662fnginx\u3002( nginx\u70ba\u4e86\u53ef\u4ee5\u767c\u63ee\u591a\u6838\u5fc3\u8655\u7406\u5668\u7684\u6548\u80fd\uff0c\u4e5f\u662f\u53ef\u4ee5\u751f\u6210\u591a\u57f7\u884c\u7dd2\u7684\uff0c\u4f46\u662f\u672c\u8cea\u4e0a\uff0cnignx\u9084\u662f\u4f7f\u7528event-model\u4f86\u8655\u7406\u9023\u63a5\u6578\u7684\u554f\u984c\u3002)\u00a0\u6211\u7684\u5ba2\u6236\u4e2d\uff0c\u6709\u540c\u66421\u842c\u4eba\u4e0a\u7dda\u7684\u5927\u8ad6\u58c7\uff0c\u7528\u4e86nginx\u4e4b\u5f8c\uff0c\u5c31\u53ef\u4ee5\u7528\u7368\u7acb\u4e3b\u6a5f(dedicated server)\u9806\u9806\u5730\u8dd1\u3002<\/p>\n

disp.cc\u9019\u500b\u7ad9\uff0c\u96d6\u7136\u6c92\u6709\u4f7f\u7528event-model\u4f86\u8655\u7406\uff0c\u4f46\u662f\u56e0\u70ba\u5206\u6d41\u7684\u7de3\u6545\uff0c\u6bcf\u4e00\u53f0\u6a5f\u5668\u4e0a\u7684connection\u6578\u5269\u4e0b\u4e00\u534a\uff0c\u5982\u6b64\u4e00\u4f86\uff0c\u5c31\u5de7\u5999\u5730\u8ff4\u907f\u4e86C10K\u554f\u984c\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u4e00\u822c\u800c\u8a00\uff0cVPS\u7684\u67b6\u69cb\uff0c\u4e0d\u540c\u7684VPS\uff0c\u786c\u789f\u7684IOPS\u4e5f\u662f\u7368\u7acb\u7684\u3002\u6240\u4ee5\u9019\u7a2e\u5206\u6d41\u4e5f\u8ff4\u907f\u4e86\u786c\u789fI\/O\u7684\u74f6\u9838\u3002<\/p>\n

VPS \u8207 Dedicated Server<\/h2>\n

\u5f9e\u50f9\u683c\u4e0a\u4f86\u8aaa\uff0c\u4e00\u5b9a\u662fVPS\u4fbf\u5b9c\u3002\u4f46\u662f\u771f\u7684\u8981\u8b1b\u6027\u50f9\u6bd4\u7684\u6642\u5019\uff0c\u7368\u7acb\u4e3b\u6a5f(dedicated server)\u56e0\u70ba\u53ef\u4ee5\u4f7f\u7528\u767e\u5206\u4e4b\u767e\u7684\u786c\u9ad4\u8cc7\u6e90\uff0c\u53cd\u800c\u53ef\u4ee5\u6709\u66f4\u9ad8\u7684\u6027\u50f9\u6bd4\u3002\u4e5f\u5c31\u662f\u8aaa\uff0c\u540c\u6a23\u4e00\u584a\u9322\u8cb7\u5230\u7684\u786c\u9ad4\u904b\u7b97\u6548\u80fd\uff0cDedicated Server\u4e00\u822c\u800c\u8a00\u662f\u5927\u65bcVPS\u3002<\/p>\n

\u7368\u7acb\u4e3b\u6a5f\u96d6\u7136\u6027\u50f9\u6bd4\u9ad8\uff0c\u4f46\u662f\u5982\u679c\u9047\u5230\u4e86\u9019\u7a2eC10K\u554f\u984c\uff0c\u6c92\u6709\u4f7f\u7528event-model\u4f86\u8655\u7406\uff0c\u5c31\u8b8a\u6210\u4e00\u5b9a\u8981\u5206\u6d41\u3002\u800c\u4e14\u9019\u7a2e\u6642\u5019\u7684\u5206\u6d41\u662f\u4e0d\u7d93\u6fdf\u7684\uff0c\u56e0\u70ba\u5982\u679c\u4e3b\u6a5f\u4e0a\u7684\u8cc7\u6e90\u5c1a\u672a\u5145\u5206\u4f7f\u7528\u5c31\u5206\u6d41\uff0c\u9019\u5c31\u9020\u6210\u4e86\u8cc7\u6e90\u4e0a\u7684\u6d6a\u8cbb\u3002\u9664\u6b64\u4e4b\u5916\uff0cVPS\u6bd4\u8f03\u5177\u6709\u5f48\u6027\uff0c\u5982\u679c5000\u500bconnection\u53ea\u8981\u4f7f\u75282G\u7684RAM\uff0c\u6211\u5011\u53ef\u4ee5\u8f15\u6613\u627e\u5230\u63d0\u4f9b2G RAM\u7684VPS\u3002\u4f46\u662f\u7368\u7acb\u4e3b\u6a5f\u7684\u786c\u789f\u898f\u683c\u5c31\u4e0d\u80fd\u5982\u6b64\u96a8\u610f\u5730\u5ba2\u88fd\u5316\uff0c\u7368\u7acb\u4e3b\u6a5f\u914d\u5408\u4e0d\u540c\u4e16\u4ee3\u7684CPU\uff0cRAM\u7684\u5927\u5c0f\u6703\u6108\u4f86\u6108\u5927\u3002<\/p>\n

\u7e3d\u7d50\uff0c\u5982\u679c\u67d0\u500b\u5927\u7ad9\u7684\u7ad9\u9577\u60f3\u8981\u7bc0\u7701\u4e3b\u6a5f\u7684\u8cbb\u7528\uff0c\u4e00\u822c\u800c\u8a00\uff0c\u4f7f\u7528\u7368\u7acb\u4e3b\u6a5f\uff0c\u53ef\u4ee5\u6bd4VPS\u7701\u523030%~50%\u5de6\u53f3\u3002\u4f46\u662f\uff0c\u4f7f\u7528\u7368\u7acb\u4e3b\u6a5f\u6642\uff0c\u5c31\u53ef\u80fd\u4e0d\u9069\u5408\u53c3\u8003disp.cc\u73fe\u884c\u7684\u5206\u6d41\u65b9\u5f0f\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

disp.cc \u662f\u500b\u5f88\u6709\u7279\u8272\u7684\u96fb\u5b50\u5e03\u544a\u6b04\u7db2\u7ad9\uff0c\u5b83\u7528http + Ajax\u505a\u51fa\u985e\u4f3cBBS\u7684\u700f\u89bd\u6548\u679c\uff0c\u800c\u4e14\u6bd4BBS … \u95b1\u8b80\u5168\u6587 \u5982\u4f55\u6c7a\u5b9a\u4e3b\u6a5f\u662f\u5426\u8981\u5206\u6d41\uff1f<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[3],"tags":[47,91,89,88,87,90],"_links":{"self":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/379"}],"collection":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/comments?post=379"}],"version-history":[{"count":5,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/379\/revisions"}],"predecessor-version":[{"id":979,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/379\/revisions\/979"}],"wp:attachment":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/media?parent=379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/categories?post=379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/tags?post=379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}