{"id":158785,"date":"2024-11-03T04:50:30","date_gmt":"2024-11-02T20:50:30","guid":{"rendered":"https:\/\/server.hk\/cnblog\/158785\/"},"modified":"2024-11-03T04:50:31","modified_gmt":"2024-11-02T20:50:31","slug":"%e9%97%9c%e6%96%bcmysql%e7%b7%9a%e7%a8%8b%e6%b1%a0%ef%bc%8c%e9%80%99%e4%b9%9f%e8%a8%b1%e6%98%af%e7%9b%ae%e5%89%8d%e6%9c%80%e5%85%a8%e9%9d%a2%e7%9a%84%e5%af%a6%e7%94%a8%e5%b8%96%ef%bc%81","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/158785\/","title":{"rendered":"\u95dc\u65bcMySQL\u7dda\u7a0b\u6c60\uff0c\u9019\u4e5f\u8a31\u662f\u76ee\u524d\u6700\u5168\u9762\u7684\u5be6\u7528\u5e16\uff01"},"content":{"rendered":"<h1 id=\"%e9%97%9c%e6%96%bcmysql%e7%b7%9a%e7%a8%8b%e6%b1%a0%ef%bc%8c%e9%80%99%e4%b9%9f%e8%a8%b1%e6%98%af%e7%9b%ae%e5%89%8d%e6%9c%80%e5%85%a8%e9%9d%a2%e7%9a%84%e5%af%a6%e7%94%a8%e5%b8%96%ef%bc%81-ErgroCfCPw\">\u95dc\u65bcMySQL\u7dda\u7a0b\u6c60\uff0c\u9019\u4e5f\u8a31\u662f\u76ee\u524d\u6700\u5168\u9762\u7684\u5be6\u7528\u5e16\uff01<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u6578\u64da\u9a45\u52d5\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u6027\u80fd\u5c0d\u65bc\u61c9\u7528\u7a0b\u5e8f\u7684\u6574\u9ad4\u8868\u73fe\u81f3\u95dc\u91cd\u8981\u3002MySQL\u4f5c\u70ba\u6700\u6d41\u884c\u7684\u958b\u6e90\u6578\u64da\u5eab\u4e4b\u4e00\uff0c\u5176\u6027\u80fd\u512a\u5316\u7684\u5404\u7a2e\u6280\u8853\u5c64\u51fa\u4e0d\u7aae\u3002\u5176\u4e2d\uff0c\u7dda\u7a0b\u6c60\u6280\u8853\u4fbf\u662f\u4e00\u500b\u91cd\u8981\u7684\u6027\u80fd\u512a\u5316\u624b\u6bb5\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0eMySQL\u7dda\u7a0b\u6c60\u7684\u6982\u5ff5\u3001\u5de5\u4f5c\u539f\u7406\u3001\u512a\u52e2\u53ca\u5176\u914d\u7f6e\u65b9\u6cd5\uff0c\u5e6b\u52a9\u8b80\u8005\u66f4\u597d\u5730\u7406\u89e3\u548c\u61c9\u7528\u9019\u4e00\u6280\u8853\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%afmysql%e7%b7%9a%e7%a8%8b%e6%b1%a0%ef%bc%9f-ErgroCfCPw\">\u4ec0\u9ebc\u662fMySQL\u7dda\u7a0b\u6c60\uff1f<\/h2>\n<p>MySQL\u7dda\u7a0b\u6c60\u662f\u4e00\u7a2e\u7ba1\u7406\u6578\u64da\u5eab\u9023\u63a5\u7684\u6280\u8853\uff0c\u65e8\u5728\u63d0\u9ad8\u6578\u64da\u5eab\u7684\u6027\u80fd\u548c\u97ff\u61c9\u901f\u5ea6\u3002\u50b3\u7d71\u7684MySQL\u9023\u63a5\u65b9\u5f0f\u662f\u6bcf\u7576\u6709\u8acb\u6c42\u6642\uff0c\u6578\u64da\u5eab\u90fd\u6703\u5275\u5efa\u4e00\u500b\u65b0\u7684\u7dda\u7a0b\u4f86\u8655\u7406\u8a72\u8acb\u6c42\u3002\u9019\u7a2e\u65b9\u5f0f\u5728\u9ad8\u4e26\u767c\u60c5\u6cc1\u4e0b\u6703\u5c0e\u81f4\u5927\u91cf\u7684\u7dda\u7a0b\u5275\u5efa\u548c\u92b7\u6bc0\uff0c\u5f9e\u800c\u589e\u52a0\u4e86\u7cfb\u7d71\u7684\u958b\u92b7\u548c\u5ef6\u9072\u3002<\/p>\n<p>\u7dda\u7a0b\u6c60\u7684\u6982\u5ff5\u662f\u9810\u5148\u5275\u5efa\u4e00\u7d44\u7dda\u7a0b\uff0c\u4e26\u5c07\u5176\u4fdd\u7559\u5728\u5167\u5b58\u4e2d\uff0c\u7576\u6709\u8acb\u6c42\u5230\u4f86\u6642\uff0c\u76f4\u63a5\u5f9e\u7dda\u7a0b\u6c60\u4e2d\u7372\u53d6\u53ef\u7528\u7684\u7dda\u7a0b\u4f86\u8655\u7406\u8acb\u6c42\u3002\u9019\u6a23\u53ef\u4ee5\u986f\u8457\u6e1b\u5c11\u7dda\u7a0b\u5275\u5efa\u548c\u92b7\u6bc0\u7684\u958b\u92b7\uff0c\u63d0\u9ad8\u7cfb\u7d71\u7684\u6027\u80fd\u3002<\/p>\n<h2 id=\"mysql%e7%b7%9a%e7%a8%8b%e6%b1%a0%e7%9a%84%e5%b7%a5%e4%bd%9c%e5%8e%9f%e7%90%86-ErgroCfCPw\">MySQL\u7dda\u7a0b\u6c60\u7684\u5de5\u4f5c\u539f\u7406<\/h2>\n<p>MySQL\u7dda\u7a0b\u6c60\u7684\u5de5\u4f5c\u539f\u7406\u53ef\u4ee5\u7c21\u55ae\u6982\u62ec\u70ba\u4ee5\u4e0b\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li><strong>\u7dda\u7a0b\u521d\u59cb\u5316\uff1a<\/strong>\u5728MySQL\u555f\u52d5\u6642\uff0c\u7dda\u7a0b\u6c60\u6703\u6839\u64da\u914d\u7f6e\u5275\u5efa\u4e00\u5b9a\u6578\u91cf\u7684\u7dda\u7a0b\u4e26\u4fdd\u6301\u5728\u5167\u5b58\u4e2d\u3002<\/li>\n<li><strong>\u8acb\u6c42\u8655\u7406\uff1a<\/strong>\u7576\u6709\u8acb\u6c42\u5230\u4f86\u6642\uff0c\u7dda\u7a0b\u6c60\u6703\u6aa2\u67e5\u662f\u5426\u6709\u53ef\u7528\u7684\u7dda\u7a0b\u3002\u5982\u679c\u6709\uff0c\u5247\u76f4\u63a5\u5206\u914d\u8a72\u7dda\u7a0b\u4f86\u8655\u7406\u8acb\u6c42\uff1b\u5982\u679c\u6c92\u6709\uff0c\u5247\u6839\u64da\u914d\u7f6e\u7684\u7b56\u7565\uff08\u5982\u7b49\u5f85\u6216\u62d2\u7d55\u8acb\u6c42\uff09\u4f86\u8655\u7406\u3002<\/li>\n<li><strong>\u7dda\u7a0b\u56de\u6536\uff1a<\/strong>\u8acb\u6c42\u8655\u7406\u5b8c\u6210\u5f8c\uff0c\u7dda\u7a0b\u4e0d\u6703\u88ab\u92b7\u6bc0\uff0c\u800c\u662f\u8fd4\u56de\u5230\u7dda\u7a0b\u6c60\u4e2d\uff0c\u7b49\u5f85\u4e0b\u4e00\u500b\u8acb\u6c42\u3002<\/li>\n<\/ol>\n<h2 id=\"mysql%e7%b7%9a%e7%a8%8b%e6%b1%a0%e7%9a%84%e5%84%aa%e5%8b%a2-ErgroCfCPw\">MySQL\u7dda\u7a0b\u6c60\u7684\u512a\u52e2<\/h2>\n<p>\u4f7f\u7528MySQL\u7dda\u7a0b\u6c60\u6709\u591a\u500b\u512a\u52e2\uff1a<\/p>\n<ul>\n<li><strong>\u63d0\u9ad8\u6027\u80fd\uff1a<\/strong>\u901a\u904e\u6e1b\u5c11\u7dda\u7a0b\u5275\u5efa\u548c\u92b7\u6bc0\u7684\u958b\u92b7\uff0c\u7dda\u7a0b\u6c60\u80fd\u5920\u986f\u8457\u63d0\u9ad8\u6578\u64da\u5eab\u7684\u97ff\u61c9\u901f\u5ea6\u3002<\/li>\n<li><strong>\u964d\u4f4e\u8cc7\u6e90\u6d88\u8017\uff1a<\/strong>\u7dda\u7a0b\u6c60\u80fd\u5920\u6709\u6548\u7ba1\u7406\u7cfb\u7d71\u8cc7\u6e90\uff0c\u907f\u514d\u56e0\u70ba\u904e\u591a\u7684\u7dda\u7a0b\u5c0e\u81f4\u7684\u8cc7\u6e90\u6d6a\u8cbb\u3002<\/li>\n<li><strong>\u66f4\u597d\u7684\u4e26\u767c\u8655\u7406\u80fd\u529b\uff1a<\/strong>\u7dda\u7a0b\u6c60\u80fd\u5920\u66f4\u597d\u5730\u8655\u7406\u9ad8\u4e26\u767c\u8acb\u6c42\uff0c\u5f9e\u800c\u63d0\u9ad8\u7cfb\u7d71\u7684\u6574\u9ad4\u541e\u5410\u91cf\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%aemysql%e7%b7%9a%e7%a8%8b%e6%b1%a0-ErgroCfCPw\">\u5982\u4f55\u914d\u7f6eMySQL\u7dda\u7a0b\u6c60<\/h2>\n<p>\u8981\u5728MySQL\u4e2d\u914d\u7f6e\u7dda\u7a0b\u6c60\uff0c\u9996\u5148\u9700\u8981\u78ba\u4fdd\u4f7f\u7528\u7684\u662f\u652f\u6301\u7dda\u7a0b\u6c60\u7684\u7248\u672c\uff08\u5982MySQL 5.7\u53ca\u4ee5\u4e0a\u7248\u672c\uff09\u3002\u4ee5\u4e0b\u662f\u57fa\u672c\u7684\u914d\u7f6e\u6b65\u9a5f\uff1a<\/p>\n<pre><code>\n# \u5728MySQL\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\n[mysqld]\nthread_pool_size = 16  # \u8a2d\u7f6e\u7dda\u7a0b\u6c60\u7684\u5927\u5c0f\nthread_pool_oversubscribe = 2  # \u8a2d\u7f6e\u8d85\u984d\u8a02\u95b1\u6bd4\u4f8b\n<\/code><\/pre>\n<p>\u914d\u7f6e\u5b8c\u6210\u5f8c\uff0c\u91cd\u555fMySQL\u670d\u52d9\u4ee5\u4f7f\u914d\u7f6e\u751f\u6548\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u7dda\u7a0b\u6c60\u7684\u72c0\u614b\uff1a<\/p>\n<pre><code>\nSHOW ENGINE THREAD_POOL STATUS;\n<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-ErgroCfCPw\">\u7e3d\u7d50<\/h2>\n<p>MySQL\u7dda\u7a0b\u6c60\u662f\u4e00\u7a2e\u6709\u6548\u7684\u6027\u80fd\u512a\u5316\u6280\u8853\uff0c\u80fd\u5920\u986f\u8457\u63d0\u9ad8\u6578\u64da\u5eab\u7684\u97ff\u61c9\u901f\u5ea6\u548c\u4e26\u767c\u8655\u7406\u80fd\u529b\u3002\u901a\u904e\u5408\u7406\u7684\u914d\u7f6e\u548c\u7ba1\u7406\uff0c\u7dda\u7a0b\u6c60\u53ef\u4ee5\u5e6b\u52a9\u958b\u767c\u8005\u548c\u7cfb\u7d71\u7ba1\u7406\u54e1\u66f4\u597d\u5730\u61c9\u5c0d\u9ad8\u4e26\u767c\u5834\u666f\u4e0b\u7684\u6311\u6230\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6027\u80fd\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\u7684\u7528\u6236\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u6216 <a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a> \u4f86\u904b\u884cMySQL\u7dda\u7a0b\u6c60\uff0c\u5c07\u6703\u662f\u63d0\u5347\u61c9\u7528\u6027\u80fd\u7684\u660e\u667a\u4e4b\u9078\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22MySQL\u7dda\u7a0b\u6c60\u7684\u5168\u9762\u6307\u5357\uff0c\u4e86\u89e3\u5176\u529f\u80fd\u3001\u512a\u52e2\u53ca\u6700\u4f73\u5be6\u8e10\uff0c\u63d0\u5347\u6578\u64da\u5eab\u6027\u80fd\u8207\u6548\u7387\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-158785","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/158785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=158785"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/158785\/revisions"}],"predecessor-version":[{"id":158786,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/158785\/revisions\/158786"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=158785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=158785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=158785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}