{"id":42,"date":"2017-03-17T16:39:31","date_gmt":"2017-03-17T08:39:31","guid":{"rendered":"http:\/\/www.jsjs.org\/?p=42"},"modified":"2017-03-17T16:39:31","modified_gmt":"2017-03-17T08:39:31","slug":"mysql%e7%9a%84%e5%ae%9e%e6%97%b6%e6%80%a7%e8%83%bd%e7%9b%91%e6%8e%a7%e5%88%a9%e5%99%a8","status":"publish","type":"post","link":"https:\/\/blog.jsjs.org\/?p=42","title":{"rendered":"MySQL\u7684\u5b9e\u65f6\u6027\u80fd\u76d1\u63a7\u5229\u5668"},"content":{"rendered":"<p>\u64cd\u4f5c\u7cfb\u7edf\u53caMySQL\u6570\u636e\u5e93\u7684\u5b9e\u65f6\u6027\u80fd\u72b6\u6001\u6570\u636e\u5c24\u4e3a\u91cd\u8981\uff0c\u7279\u522b\u662f\u5728\u6709\u6027\u80fd\u6296\u52a8\u7684\u65f6\u5019\uff0c\u8fd9\u4e9b\u5b9e\u65f6\u7684\u6027\u80fd\u6570\u636e\u53ef\u4ee5\u5feb\u901f\u5e2e\u52a9\u4f60\u5b9a\u4f4d\u7cfb\u7edf\u6216MySQL\u6570\u636e\u5e93\u7684\u6027\u80fd\u74f6\u9888\uff0c\u5c31\u50cf\u4f60\u5728Linux\u7cfb\u7edf\u4e0a\u4f7f\u7528\u300ctop\uff0csar\uff0ciostat\u300d\u7b49\u547d\u4ee4\u5de5\u5177\u4e00\u6837\uff0c\u53ef\u4ee5\u7acb\u523b\u5b9a\u4f4dOS\u7684\u6027\u80fd\u74f6\u9888\u662f\u5728IO\u8fd8\u662fCPU\u4e0a\uff0c\u6240\u4ee5\u6536\u96c6\/\u5c55\u793a\u8fd9\u4e9b\u6027\u80fd\u6570\u636e\u5c31\u66f4\u4e3a\u91cd\u8981\uff0c\u90a3\u90fd\u6709\u54ea\u4e9b\u91cd\u8981\u7684\u5b9e\u65f6\u6027\u80fd\u72b6\u6001\u6307\u6807\u53ef\u4ee5\u53cd\u5e94\u51fa\u7cfb\u7edf\u548cMySQL\u6570\u636e\u5e93\u7684\u6027\u80fd\u8d1f\u8f7d\u5462\uff1f<\/p>\n<p data-source-line=\"5\"><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053501961.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.5265553869499241\" data-s=\"300,640\" data-type=\"png\" data-w=\"659\" \/><\/p>\n<p data-source-line=\"7\">\u76ee\u524d\u5728Linux\u8dd1MySQL\u662f\u5927\u591a\u6570\u4e92\u8054\u7f51\u516c\u53f8\u7684\u6807\u914d\uff0c\u4ee5\u4e0a\u56fe\u7247\u7684\u6027\u80fd\u6570\u636e\u6307\u6807\u9879\u662f\u6211\u8ba4\u4e3a\u5728Linux\uff0cMySQL\uff0cInnoDB\u4e2d\u8f83\u4e3a\u91cd\u8981\u7684\u5b9e\u65f6\u72b6\u6001\u6570\u636e\uff0c\u7136\u800c\u5728\u4ee5\u4e0a\u56fe\u7247Doing\u4e00\u680f\u5176\u5b9e\u66f4\u4e3a\u91cd\u8981\uff0c\u4e4b\u6240\u4ee5\u628a\u5b83\u53eb\u505aDoing\uff0c\u662f\u56e0\u4e3a\u300cprocesslist\uff0cengine innodb status\uff0clocks\u300d\u7b49\u6307\u6807\u9879\u624d\u771f\u6b63\u53cd\u6620\u4e86MySQL\u6b64\u65f6\u6b63\u5728\u505a\u4ec0\u4e48\u3002<\/p>\n<p data-source-line=\"9\"><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053512176.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.4778393351800554\" data-s=\"300,640\" data-type=\"png\" data-w=\"722\" \/><\/p>\n<p data-source-line=\"11\">\u6211\u4eec\u6765\u5bf9\u6807Oracle\u6570\u636e\u5e93\u770b\u4e00\u4e0b\uff0c\u5728Oracle\u6570\u636e\u5e93\u4e2d\u63d0\u4f9b\u4e86\u300cAWR\uff0cASH\uff0cSQL Monitor\u300d\u7b49\u4f17\u591a\u8bca\u65ad\u5de5\u5177\uff0c\u53ef\u4ee5\u4e00\u773c\u671b\u7a7f\u6570\u636e\u5e93\u6b63\u5728\u505a\u4ec0\u4e48\uff0c\u751a\u81f3\u90fd\u53ef\u4ee5\u77e5\u9053\u5728\u8fc7\u53bb30\u5929\u5185\u4efb\u4f55\u4e00\u4e2a\u65f6\u95f4\u533a\u95f4\u7684\u6027\u80fd\u8d1f\u8f7d\u548c\u5f53\u65f6\u6570\u636e\u5e93\u6b63\u5728\u505a\u4ec0\u4e48\u3002<\/p>\n<p data-source-line=\"13\">\u5728MySQL\u4e2d\u867d\u7136\u6709\u50cf\u300czabbix\uff0cPMM\u300d\u7b49\u4f18\u79c0\u7684\u76d1\u63a7\u5de5\u5177\uff0c\u4f46\u5b83\u4eec\u53ea\u80fd\u53cd\u6620\u6570\u636e\u5e93\u5386\u53f2\u7684\u4e00\u4e9b\u6027\u80fd\u6570\u636e\u66f2\u7ebf\uff0c\u4f8b\u5982\uff0cTPS\u9ad8\u4e86\uff0c\u4e34\u65f6\u8868\u4f7f\u7528\u591a\u4e86\uff0c\u6709InnoDB Deadlocks\uff0c\u4f46\u5bf9\u4e8eMySQL\u5f53\u65f6\u7684<strong>Doing<\/strong>\uff0c\u6211\u53ea\u80fd\u8bf4\u4e0d\u591f\u76f4\u63a5\u3002\u5982\u679c\u4f60\u5728\u73b0\u573a\uff0c\u4f60\u53ef\u4ee5\u6293\u5230MySQL\u6b63\u5728\u505a\u4ec0\u4e48\uff0c\u4f46\u662f\uff0c\u4f60\u603b\u6709\u4e0d\u5728\u73b0\u573a\u7684\u65f6\u5019\uff0c\u5982\u679c\u95ee\u4f60\u6628\u5929\u665a\u4e0a\u6570\u636e\u5e93\u7684\u6027\u80fd\u6296\u52a8\u662f\u4ec0\u4e48\u539f\u56e0\uff1f\u600e\u6837\u5feb\u901f\u91cd\u73b0\u73b0\u573a\u627e\u5230\u5f15\u8d77\u6296\u52a8\u7684\u539f\u56e0\u5462\uff1f<\/p>\n<h4 data-source-line=\"15\">\u7b54\u6848\u662f\u53ef\u4ee5\u4f7f\u7528\u300cdoDBA tools\u300d\uff0c\u8fd9\u662f\u4e00\u6b3e\u514d\u8d39\u7684\u57fa\u4e8e\u63a7\u5236\u53f0\u76d1\u63a7\u5de5\u5177\u3002<\/h4>\n<h4 data-source-line=\"17\">doDBA tools\u662f\u4ec0\u4e48<\/h4>\n<h5 data-source-line=\"18\">doDBA tools\u662f\u4e00\u4e2a\u57fa\u4e8e<mark>\u63a7\u5236\u53f0\u7684\u8fdc\u7a0b\u76d1\u63a7\u5de5\u5177<\/mark>\uff0c\u5b83\u4e0d\u9700\u8981\u5728\u672c\u5730\/\u8fdc\u7a0b\u7cfb\u7edf\u4e0a<mark>\u5b89\u88c5\u4efb\u4f55\u8f6f\u4ef6<\/mark>\uff0c\u5b83\u53ef\u4ee5\u5b9e\u65f6\u6536\u96c6\u64cd\u4f5c\u7cfb\u7edf\u3001MySQL\u3001InnoDB\u7684\u5b9e\u65f6\u6027\u80fd\u72b6\u6001\u6570\u636e\uff0c\u5e76\u53ef\u4ee5\u751f\u6210<mark>Doing\u65e5\u5fd7\u6587\u4ef6<\/mark>\uff0c\u6765\u5e2e\u52a9\u4f60<mark>\u5feb\u901f\u4e86\u89e3\/\u4f18\u5316<\/mark>\u7cfb\u7edf\u53caMySQL\u6570\u636e\u5e93\u3002<\/h5>\n<h4 data-source-line=\"20\">\u7279\u70b9<\/h4>\n<ul class=\"list-paddingleft-2\" data-source-line=\"21\">\n<li>\u57fa\u4e8egolang\u8bed\u8a00\u5f00\u53d1<\/li>\n<li>\u53ef\u6536\u96c6Linux\u3001MySQL\u76f8\u5173\u6027\u80fd\u6570\u636e<\/li>\n<li>\u53ef\u672c\u5730\u6216\u8fdc\u7a0b\u6536\u96c6\uff0c\u53ef\u591a\u53f0<\/li>\n<li>mytop\u00a0&#8211;Like Linux TOP<\/li>\n<li>\u57fa\u4e8e\u5e76\u53d1\u751f\u6210Doing\u65e5\u5fd7\uff0c\u590d\u73b0\u73b0\u573a<\/li>\n<li>\u53ef\u8bb0\u5f55\u5230\u65e5\u5fd7\u6587\u4ef6<\/li>\n<\/ul>\n<p><strong>doDBA tools \u5de5\u4f5c\u539f\u7406<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u8fdc\u7a0b\u6536\u96c6\u7cfb\u7edf\u4fe1\u606f\u662f\u901a\u8fc7ssh\uff08\u7528\u6237\u540d\u5bc6\u7801\u6216\u5efa\u7acb\u4fe1\u4efb\uff09\u7684\u65b9\u5f0f\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u6536\u96c6\uff0c\u6536\u96c6\u7684\u65b9\u6cd5\u90fd\u662f\u901a\u8fc7\u8bfb\u53d6Linux\u7684proc\u4e0b\u7684\u7b49meminfo\uff0cdiskstats\uff0cuptime\uff0cnet\uff0cvmstat \uff0ccpuinfo \uff0cloadavg\u7b49\u6587\u4ef6\uff0c\u8fd9\u548cpmm\uff0czabbix\u6536\u96c6\u65b9\u5f0f\u4e00\u81f4\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u8fdc\u7a0b\u6536\u96c6MySQL\u4fe1\u606f\u662f\u901a\u8fc7 MySQL tcp\u8fde\u63a5\u5230MySQL\u6570\u636e\u5e93\u4e0a\u6536\u96c6\uff0c\u53ea\u9700\u8981\u6388\u4e88\u8fde\u63a5\u7528\u6237PROCESS\u3001SELECT\u6743\u9650\u5373\u53ef\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u7cfb\u7edf\u4fe1\u606f\u548cMySQL\u4fe1\u606f\u7684\u6536\u96c6\u53ef\u4ee5\u5206\u79bb\uff0c\u5982\u679c\u53ea\u60f3\u6536\u96c6\u7cfb\u7edf\u4fe1\u606f\uff0c\u53ea\u9700\u8981\u63d0\u4f9b\u7cfb\u7edf\u7528\u6237\u540d\u5bc6\u7801\u5373\u53ef\uff0c\u5982\u679c\u53ea\u6536\u96c6MySQL\u53ef\u4ee5\u53ea\u63d0\u4f9bMySQL\u8fde\u63a5\u4fe1\u606f\uff0c\u5982\u679c\u662frds\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528-rds\u53c2\u6570\uff0c\u5728\u4f7f\u7528mytop\u65f6\u4f1a\u81ea\u52a8\u5ffd\u7565\u7cfb\u7edf\u4fe1\u606f\u7684\u6536\u96c6\u3002<\/p>\n<h4 data-source-line=\"29\">\u5982\u4f55\u4f7f\u7528<\/h4>\n<h5 data-source-line=\"31\">Github\u4e3b\u9875:<\/h5>\n<pre data-source-line=\"32\"><a href=\"https:\/\/github.com\/dblucyne\/dodba_tools\"><code>https:\/\/github.com\/dblucyne\/dodba_tools<\/code><\/a><\/pre>\n<h5 data-source-line=\"35\">Download\uff1a<\/h5>\n<pre data-source-line=\"36\"><code>wget <a href=\"https:\/\/raw.githubusercontent.com\/dblucyne\/dodba_tools\/master\/doDBA%20--no-check-certificate\">https:\/\/raw.githubusercontent.com\/dblucyne\/dodba_tools\/master\/doDBA --no-check-certificate<\/a>\nwget <a href=\"https:\/\/raw.githubusercontent.com\/dblucyne\/dodba_tools\/master\/doDBA.conf%20--no-check-certificate\">https:\/\/raw.githubusercontent.com\/dblucyne\/dodba_tools\/master\/doDBA.conf --no-check-certificate<\/a>\nchmod +x doDBA\n\u4e0b\u8f7d\u4e0b\u6765\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff0c\u4e0d\u4f9d\u8d56\u4e8e\u4efb\u4f55\u73af\u5883\u3002<\/code><\/pre>\n<h5 data-source-line=\"41\">\u4f7f\u7528\u5e2e\u52a9\uff1a<\/h5>\n<pre data-source-line=\"42\"><code>.\/doDBA -help\n \u00a0-c string\n \u00a0 \u00a0configuration file.(default \"doDBA.conf\")\n \u00a0-h string\n \u00a0 \u00a0Connect to host\/IP.\n \u00a0-sys\n \u00a0 \u00a0Print linux info.\n \u00a0-myall\n \u00a0 \u00a0Print linux and mysql info.\n \u00a0<\/code><code>-mysql<\/code><code>\n \u00a0 \u00a0Print mysql info.\n \u00a0-innodb\n \u00a0 \u00a0Print innodb info.\n \u00a0-mytop\n \u00a0 \u00a0Print mysql prcesslist,like top.\n \u00a0-i duration\n \u00a0 \u00a0refresh interval in seconds.(1s)\n \u00a0-t int\n \u00a0 \u00a0doing on Threads_running.(50)<\/code><code> \u00a0\n \u00a0-rds \u00a0 \u00a0 \u00a0 \u00a0\n \u00a0 \u00a0Ignore system info.<\/code><code>\n \u00a0-log\n \u00a0 \u00a0Print to file by day.\n \u00a0-nocolor\n \u00a0 \u00a0Print to nocolor.<\/code><\/pre>\n<h3 data-source-line=\"70\">\u4f7f\u7528\u5b9e\u4f8b<\/h3>\n<h5 data-source-line=\"72\">1. \u6536\u96c6Linux\u6027\u80fd\u6570\u636e<\/h5>\n<h5 data-source-line=\"73\">.\/doDBA -h=10.1.x.xx -sys<\/h5>\n<p><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053537264.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.45570971184631803\" data-s=\"300,640\" data-type=\"png\" data-w=\"937\" \/><\/p>\n<p>2. \u6536\u96c6MySQL\u6027\u80fd\u6570\u636e<\/p>\n<h5 data-source-line=\"76\">.\/doDBA -h=10.1.x.xx -mysql<\/h5>\n<p data-source-line=\"77\"><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053547703.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.4037735849056604\" data-s=\"300,640\" data-type=\"png\" data-w=\"1060\" \/><\/p>\n<h5 data-source-line=\"78\">3. \u6536\u96c6InnoDB\u6027\u80fd\u6570\u636e<\/h5>\n<h5 data-source-line=\"79\">.\/doDBA -h=10.1.x.xx -innodb<\/h5>\n<p data-source-line=\"80\"><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053603380.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.3972093023255814\" data-s=\"300,640\" data-type=\"png\" data-w=\"1075\" \/><\/p>\n<h5 data-source-line=\"81\">4. \u6536\u96c6MySQL\u53caLinux\u6027\u80fd\u6570\u636e<\/h5>\n<h5 data-source-line=\"82\">.\/doDBA -h=10.1.x.xx -myall<\/h5>\n<p data-source-line=\"83\"><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053624959.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.35774410774410775\" data-s=\"300,640\" data-type=\"png\" data-w=\"1188\" \/><\/p>\n<h5 data-source-line=\"84\">5. mytop &#8211;like linux top<\/h5>\n<h5 data-source-line=\"85\">.\/doDBA -h=10.1.x.xx -mytop<\/h5>\n<p data-source-line=\"86\"><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053640929.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.2722170252572498\" data-s=\"300,640\" data-type=\"png\" data-w=\"1069\" \/><\/p>\n<h5 data-source-line=\"87\">6. \u501f\u52a9Shell\u6536\u96c6\u591a\u53f0<\/h5>\n<h6 data-source-line=\"88\">cat ip.txt<\/h6>\n<pre data-source-line=\"89\"><code>10.1.x.x1\n10.1.x.x2<\/code><\/pre>\n<h6 data-source-line=\"93\">Shell<\/h6>\n<pre data-source-line=\"94\"><code>cat ip.txt | while read ip;\n do\n echo $ip;\n .\/doDBA -h=$ip -mysql -log <\/code><\/pre>\n<h5 data-source-line=\"101\"><code>7. \u6536\u96c6\u5230\u65e5\u5fd7\u6587\u4ef6<\/code><\/h5>\n<h5 data-source-line=\"102\"><code>.\/doDBA -h=10.1.x.xx -mysql -log<\/code><\/h5>\n<p data-source-line=\"103\"><code><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053655580.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.2842767295597484\" data-s=\"300,640\" data-type=\"png\" data-w=\"795\" \/><\/code><\/p>\n<h5 data-source-line=\"104\"><code>8. \u5f00\u542fDoing\u529f\u80fd<\/code><\/h5>\n<p data-source-line=\"105\"><code>\u4f7f\u7528\u3010-t\u3011\u53c2\u6570\u53ef\u4ee5\u57fa\u4e8eThreads_running\u7684\u6570\u91cf\u8bbe\u7f6e\u9608\u503c\uff0c\u8bbe\u7f6e\u540e\u53ef\u8bb0\u5f55\u300cprocesslist\uff0cengine innodb status\u300d\u4fe1\u606f\u5230dodba.log\u65e5\u5fd7\u4e2d\uff0c--\u590d\u73b0\u73b0\u573a\u3002<\/code><\/p>\n<h5 data-source-line=\"106\"><code>.\/doDBA -h=10.1.x.xx -myall -t=3<\/code><\/h5>\n<p data-source-line=\"107\"><code><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053708302.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.31780055917986955\" data-s=\"300,640\" data-type=\"png\" data-w=\"1073\" \/><\/code><\/p>\n<h5 data-source-line=\"108\"><code>9. \u67e5\u770bDoing\u65e5\u5fd7<\/code><\/h5>\n<h5 data-source-line=\"109\"><code>tail -f dodba.log<\/code><\/h5>\n<p data-source-line=\"110\"><code><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053740922.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.5643044619422573\" data-s=\"300,640\" data-type=\"png\" data-w=\"762\" \/><\/code><\/p>\n<p data-source-line=\"110\"><code><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223053753501.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"0.6341145833333334\" data-s=\"300,640\" data-type=\"png\" data-w=\"768\" \/><\/code><\/p>\n<p><code>\u00a0<\/code><\/p>\n<p><code>\u5982\u679c\u4f60\u5bf9golang\u611f\u5174\u8da3\uff0c\u5982\u679c\u4f60\u5bf9doDBA tools\u6709\u95ee\u9898\u6216\u8005\u5efa\u8bae\uff0c\u626b\u63cf\u4e8c\u7ef4\u7801\uff0c\u53ef\u8054\u7cfb\u4f5c\u8005\u3002\u00a0<\/code><\/p>\n<p data-source-line=\"115\"><code><img decoding=\"async\" src=\"http:\/\/dbaplus.cn\/uploadfile\/2016\/1223\/20161223080320203.jpg\" data-=\"\" data-fail=\"0\" data-ratio=\"1\" data-s=\"300,640\" data-type=\"jpeg\" data-w=\"737\" \/><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u64cd\u4f5c\u7cfb\u7edf\u53caMySQL\u6570\u636e\u5e93\u7684\u5b9e\u65f6\u6027\u80fd\u72b6\u6001\u6570\u636e\u5c24\u4e3a\u91cd\u8981\uff0c\u7279\u522b\u662f\u5728\u6709\u6027\u80fd\u6296\u52a8\u7684\u65f6\u5019\uff0c\u8fd9\u4e9b\u5b9e\u65f6\u7684\u6027\u80fd\u6570\u636e\u53ef\u4ee5\u5feb\u901f\u5e2e\u52a9\u4f60\u5b9a\u4f4d\u7cfb\u7edf\u6216MySQL\u6570\u636e\u5e93\u7684\u6027\u80fd\u74f6\u9888\uff0c\u5c31\u50cf\u4f60\u5728Linux\u7cfb\u7edf\u4e0a\u4f7f\u7528\u300ctop\uff0csar\uff0ciostat\u300d\u7b49\u547d\u4ee4\u5de5\u5177\u4e00\u6837\uff0c\u53ef\u4ee5\u7acb\u523b\u5b9a\u4f4dOS\u7684\u6027\u80fd\u74f6\u9888\u662f\u5728IO\u8fd8\u662fCPU\u4e0a\uff0c\u6240\u4ee5\u6536\u96c6\/\u5c55\u793a\u8fd9\u4e9b\u6027\u80fd\u6570\u636e\u5c31\u66f4\u4e3a\u91cd\u8981\uff0c\u90a3\u90fd\u6709\u54ea\u4e9b\u91cd\u8981\u7684\u5b9e\u65f6\u6027\u80fd\u72b6\u6001\u6307\u6807\u53ef\u4ee5\u53cd\u5e94\u51fa\u7cfb\u7edf\u548cMySQL\u6570\u636e\u5e93\u7684\u6027\u80fd\u8d1f\u8f7d\u5462\uff1f \u76ee\u524d\u5728Linux\u8dd1MySQL\u662f\u5927\u591a\u6570\u4e92\u8054\u7f51\u516c\u53f8\u7684\u6807\u914d\uff0c\u4ee5\u4e0a\u56fe\u7247\u7684\u6027\u80fd\u6570\u636e\u6307\u6807\u9879\u662f\u6211\u8ba4\u4e3a\u5728Linux\uff0cMySQL\uff0cInnoDB\u4e2d\u8f83\u4e3a\u91cd\u8981\u7684\u5b9e\u65f6\u72b6\u6001\u6570\u636e\uff0c\u7136\u800c\u5728\u4ee5\u4e0a\u56fe\u7247Doing\u4e00\u680f\u5176\u5b9e\u66f4\u4e3a\u91cd\u8981\uff0c\u4e4b\u6240\u4ee5\u628a\u5b83\u53eb\u505aDoing\uff0c\u662f\u56e0\u4e3a\u300cprocesslist\uff0cengine innodb status\uff0clocks\u300d\u7b49\u6307\u6807\u9879\u624d\u771f\u6b63\u53cd\u6620\u4e86MySQL\u6b64\u65f6\u6b63\u5728\u505a\u4ec0\u4e48\u3002 \u6211\u4eec\u6765\u5bf9\u6807Oracle\u6570\u636e\u5e93\u770b\u4e00\u4e0b\uff0c\u5728Oracle\u6570\u636e\u5e93\u4e2d\u63d0\u4f9b\u4e86\u300cAWR\uff0cASH\uff0cSQL Monitor\u300d\u7b49\u4f17\u591a\u8bca\u65ad\u5de5\u5177\uff0c\u53ef\u4ee5\u4e00\u773c\u671b\u7a7f\u6570\u636e\u5e93\u6b63\u5728\u505a\u4ec0\u4e48\uff0c\u751a\u81f3\u90fd\u53ef\u4ee5\u77e5\u9053\u5728\u8fc7\u53bb30\u5929\u5185\u4efb\u4f55\u4e00\u4e2a\u65f6\u95f4\u533a\u95f4\u7684\u6027\u80fd\u8d1f\u8f7d\u548c\u5f53\u65f6\u6570\u636e\u5e93\u6b63\u5728\u505a\u4ec0\u4e48\u3002 \u5728MySQL\u4e2d\u867d\u7136\u6709\u50cf\u300czabbix\uff0cPMM\u300d\u7b49\u4f18\u79c0\u7684\u76d1\u63a7\u5de5\u5177\uff0c\u4f46\u5b83\u4eec\u53ea\u80fd\u53cd\u6620\u6570\u636e\u5e93\u5386\u53f2\u7684\u4e00\u4e9b\u6027\u80fd\u6570\u636e\u66f2\u7ebf\uff0c\u4f8b\u5982\uff0cTPS\u9ad8\u4e86\uff0c\u4e34\u65f6\u8868\u4f7f\u7528\u591a\u4e86\uff0c\u6709InnoDB Deadlocks\uff0c\u4f46\u5bf9\u4e8eMySQL\u5f53\u65f6\u7684Doing\uff0c\u6211\u53ea\u80fd\u8bf4\u4e0d\u591f\u76f4\u63a5\u3002\u5982\u679c\u4f60\u5728\u73b0\u573a\uff0c\u4f60\u53ef\u4ee5\u6293\u5230MySQL\u6b63\u5728\u505a\u4ec0\u4e48\uff0c\u4f46\u662f\uff0c\u4f60\u603b\u6709\u4e0d\u5728\u73b0\u573a\u7684\u65f6\u5019\uff0c\u5982\u679c\u95ee\u4f60\u6628\u5929\u665a\u4e0a\u6570\u636e\u5e93\u7684\u6027\u80fd\u6296\u52a8\u662f\u4ec0\u4e48\u539f\u56e0\uff1f\u600e\u6837\u5feb\u901f\u91cd\u73b0\u73b0\u573a\u627e\u5230\u5f15\u8d77\u6296\u52a8\u7684\u539f\u56e0\u5462\uff1f \u7b54\u6848\u662f\u53ef\u4ee5\u4f7f\u7528\u300cdoDBA tools\u300d\uff0c\u8fd9\u662f\u4e00\u6b3e\u514d\u8d39\u7684\u57fa\u4e8e\u63a7\u5236\u53f0\u76d1\u63a7\u5de5\u5177\u3002 doDBA tools\u662f\u4ec0\u4e48 doDBA tools\u662f\u4e00\u4e2a\u57fa\u4e8e\u63a7\u5236\u53f0\u7684\u8fdc\u7a0b\u76d1\u63a7\u5de5\u5177\uff0c\u5b83\u4e0d\u9700\u8981\u5728\u672c\u5730\/\u8fdc\u7a0b\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4efb\u4f55\u8f6f\u4ef6\uff0c\u5b83\u53ef\u4ee5\u5b9e\u65f6\u6536\u96c6\u64cd\u4f5c\u7cfb\u7edf\u3001MySQL\u3001InnoDB\u7684\u5b9e\u65f6\u6027\u80fd\u72b6\u6001\u6570\u636e\uff0c\u5e76\u53ef\u4ee5\u751f\u6210Doing\u65e5\u5fd7\u6587\u4ef6\uff0c\u6765\u5e2e\u52a9\u4f60\u5feb\u901f\u4e86\u89e3\/\u4f18\u5316\u7cfb\u7edf\u53caMySQL\u6570\u636e\u5e93\u3002 \u7279\u70b9 \u57fa\u4e8egolang\u8bed\u8a00\u5f00\u53d1 \u53ef\u6536\u96c6Linux\u3001MySQL\u76f8\u5173\u6027\u80fd\u6570\u636e \u53ef\u672c\u5730\u6216\u8fdc\u7a0b\u6536\u96c6\uff0c\u53ef\u591a\u53f0 mytop\u00a0&#8211;Like Linux [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=42"}],"version-history":[{"count":0,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}