{"id":38,"date":"2022-02-07T10:16:00","date_gmt":"2022-02-07T02:16:00","guid":{"rendered":"http:\/\/www.cnee.com.cn\/wp\/?p=38"},"modified":"2022-05-09T10:17:38","modified_gmt":"2022-05-09T02:17:38","slug":"moodle%e7%9a%84%e6%80%a7%e8%83%bd%e5%92%8c%e5%8f%af%e4%bc%b8%e7%bc%a9%e6%80%a7","status":"publish","type":"post","link":"http:\/\/www.cnee.com.cn\/wp\/?p=38","title":{"rendered":"MOODLE\u7684\u6027\u80fd\u548c\u53ef\u4f38\u7f29\u6027"},"content":{"rendered":"\n
\u8fd9\u7bc7\u6587\u6863\u662f\u5982\u4f55\u63d0\u9ad8moodle\uff08\u9b54\u706f\uff09\u6027\u80fd\u3010performance\u3011\u548c\u53ef\u4f38\u7f29\u6027\u3010performance\u3011\u7684\u7f16\u7801\u6307\u5357\u3002<\/p>\n\n\n\n
\u6027\u80fd\u3010performance\u3011\u662f\u6307\u5141\u8bb8Moodle\uff08\u9b54\u706f\uff09\u4f7f\u7528\u4e00\u5b9a\u6570\u91cf\u7684\u786c\u4ef6\u652f\u6301\u5c3d\u53ef\u80fd\u591a\u7684\u7528\u6237\u3002
\u5f53\u7136\uff0c\u4f60\u603b\u662f\u53ef\u4ee5\u8d2d\u4e70\u66f4\u5927\u7684\u670d\u52a1\u5668\u3002\u53ef\u4f38\u7f29\u6027\u3010scalability\u3011\u610f\u5473\u7740\uff0c\u5982\u679c\u4f60\u8d2d\u4e70\u7684\u670d\u52a1\u5668\u7684\u529f\u80fd\u662f\u539f\u6765\u7684\u4e24\u500d\uff0c\u90a3\u4e48\u5b83\u53ef\u4ee5\u5904\u7406\u4e24\u500d\u7684\u8d1f\u8f7d\u3002<\/p>\n\n\n\n
\u4e0e\u6570\u636e\u5e93\u67e5\u8be2\u4e00\u6837\uff0c\u8fd8\u6709\u5176\u4ed6\u64cd\u4f5c\u6bd4\u53ea\u6267\u884cPHP\u4ee3\u7801\u6162\u5f97\u591a\u3002\u4f8b\u5982\uff1a<\/p>\n\n\n\n
\u65e0\u8bba\u4f55\u65f6\u505a\u8fd9\u4e9b\u4e8b\u60c5\uff0c\u90fd\u8981\u6ce8\u610f\u6027\u80fd\u95ee\u9898\u3002<\/p>\n\n\n\n
\u5982\u679c\u60a8\u4e0d\u9700\u8981\u4f1a\u8bdd\u9501\uff0c\u6216\u8005\u53ea\u9700\u8981\u5728\u9875\u9762\u7684\u4e00\u90e8\u5206\u4f7f\u7528\u5b83\uff0c\u8bf7\u89e3\u9501\u4f1a\u8bdd\u3002<\/p>\n\n\n\n
\/\/ Capture performance profiling data \r\ndefine('MDL_PERF', true);\r\n\/\/ Capture additional data from DB\r\ndefine('MDL_PERFDB', true);\r\n\/\/ Print to log (error_log(),for passive profiling of production servers)\r\ndefine('MDL_PERFTOLOG', true);\r\n\/\/ Print to footer (works with the default theme)\r\ndefine('MDL_PERFTOFOOT', true);<\/code><\/pre>\n\n\n\n\u5c0f\u6280\u5de7\uff1a\u5982\u679c\u5e0c\u671b\u53ea\u5bf9\u7ad9\u70b9\u7ba1\u7406\u5458\u663e\u793a\u6027\u80fd\u4fe1\u606f\uff0c\u53ef\u4ee5\u5728\u9002\u5f53\u7684\u4f4d\u7f6e\uff08\u6bd4\u5982\u5e03\u5c40\u9875\u9762\u7684\u9876\u90e8\uff09\uff0c\u52a0\u5165\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n\n\n\n
if (is_siteadmin()) {\r\n $CFG->perfdebug = 8;\r\n}<\/code><\/pre>\n\n\n\n- \u4f7f\u7528JMeter\uff08https:\/\/jmeter.apache.org\/\uff09\u7b49\u5de5\u5177\u5bf9\u65b0\u4ee3\u7801\u505a\u538b\u529b\u6d4b\u8bd5\u3002<\/li>
- \u4f7f\u7528https:\/\/github.com\/moodlehq\/moodle-performance-comparison \uff08moodle 2.5\u53ca\u4ee5\u4e0a\u7248\u672c\uff09\u6bd4\u8f83Moodle\u7684\u6027\u80fd\u3002\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u6d4b\u8bd5\u7ad9\u70b9\u751f\u6210\u5668\u3010Test site generator\u3011\u6216\u6d4b\u8bd5\u8bfe\u7a0b\u751f\u6210\u5668\u3010Test course generator\u3011\uff08Moodle 2.5\u53ca\u4ee5\u4e0a\u7248\u672c\uff09\u3002<\/li><\/ul>\n\n\n\n
\u5728\u8fd0\u884c\u4e2d\u8bc4\u4f30\u6027\u80fd<\/h3>\n\n\n\n
\u5982\u679c\u4f60\u4f7f\u7528postgres\uff0c\u6709\u4e00\u4e2a\u811a\u672c\u53ef\u4ee5\u89e3\u6790\u65e5\u5fd7\u5e76\u8f93\u51fa\u6700\u6162\u768410\u4e2a\u6570\u636e\u5e93\u67e5\u8be2\uff0c\u968f\u65f6\u53ef\u4ee5\u63d2\u5165cronjob\u5e76\u6bcf\u5929\u7ed9\u4f60\u53d1\u7535\u5b50\u90ae\u4ef6\u3002\u811a\u672c\u53ef\u4ee5\u5728\u8fd9\u91cc\u627e\u5230\uff1a<\/p>\n\n\n\n
http://git.catalyst.net.nz\/gw?p=pgtools.git;a=blob_plain;f=scripts\/pg-log-process.pl;hb=refs\/heads\/pg-log-process-multidb<\/code><\/pre>\n\n\n\n\u9700\u8981\u5bf9postgres\u8fdb\u884c\u4e00\u4e9b\u914d\u7f6e\uff0c\u4f7f\u5176\u4ee5\u6b63\u786e\u7684\u683c\u5f0f\u8bb0\u5f55\u5185\u5bb9\u3002<\/p>\n\n\n\n
MySQL\u6570\u636e\u5e93\u6709\u2f0f\u4e2a\u914d\u7f6e\u9009\u9879\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u53ca\u65f6\u6355\u83b7\u6162SQL\u8bed\u53e5\uff1a<\/p>\n\n\n\n
# \u5f00\u542f\u65e5\u5fd7\u8bb0\u5f55\u6162\u67e5\u8be2\r\nslow_query_log = ON\r\n# \u9608\u503c\uff0c\u8bb0\u5f55\u6267\u884c\u65f6\u95f4\u8d85\u8fc72\u79d2\u7684\u6162\u67e5\u8be2\r\nlong_query_time = 2\r\n# \u6307\u5b9a\u65e5\u5fd7\u6587\u4ef6\r\nslow_query_log_file = path\/to\/log\/file\/slowquery.log\r\n# \u8bb0\u5f55\u4e0d\u4f7f\u7528\u7d22\u5f15\u67e5\u8be2\uff0c\u5373\u4f7f\u67e5\u8be2\u6548\u7387\u4e0d\u6162\r\nlog_queries_not_using_indexes = ON\r\n# \u8bb0\u5f55\u6570\u636e\u5e93\u7ba1\u7406SQL\u4e2d\u6162sql\r\nlog-slow-admin-statements = ON<\/code><\/pre>\n\n\n\nMoodle\uff08\u9b54\u706f\uff09\u7f51\u7ad9\u80fd\u652f\u6301\u591a\u5927\u8d1f\u8377<\/h2>\n\n\n\n
\u4ece\u7edf\u8ba1\u6570\u636e\u6765\u770b\uff0c\u76ee\u524d\u4e16\u754c\u4e0a\u6700\u5927\u7684Moodle\uff08\u9b54\u706f\uff09\u7ad9\u70b9<\/p>\n\n\n\n
- \u591a\u8fbe100\u4e07\u7528\u6237<\/li>
- \u591a\u8fbe5\u4e07\u95e8\u8bfe\u7a0b<\/li>
- \u6bcf\u95e8\u8bfe\u7a0b\u591a\u8fbe5000\u540d\u7528\u6237<\/li>
- \u591a\u8fbe50\u4e2a\u89d2\u8272<\/li>
- \u591a\u8fbe100\u4e2a\u8bfe\u7a0b\u7c7b\u522b\uff0c\u5d4c\u5957\u6df1\u5ea6\u7ea6\u4e3a10\u7ea7\u3002<\/li>
- \u8bfe\u7a0b\u4e2d\u591a\u8fbeXXX\u9879\u6d3b\u52a8\u3002<\/li>
- \u66f4\u591a\u5185\u5bb9\u3002\u3002\u3002<\/li><\/ul>\n\n\n\n
\u5728\u89c4\u5212\u548c\u6d4b\u8bd5\u4ee3\u7801\u65f6\uff0c\u8fd9\u4e9b\u662f\u60a8\u5e94\u8be5\u8003\u8651\u7684\u6570\u5b57\u3002\u7136\u800c\uff0c\u4e0d\u8981\u8ba4\u4e3aMoodle\uff08\u9b54\u706f\uff09\u7f51\u7ad9\u6c38\u8fdc\u4e0d\u4f1a\u6bd4\u8fd9\u66f4\u5927\u3002
\u5373\u4f7f\u4e0d\u80fd\u5728\u5f00\u53d1\u670d\u52a1\u5668\u4e0a\u6d4b\u8bd5\u8fd9\u4e48\u5927\u7684\u7ad9\u70b9\uff0c\u4e5f\u5e94\u8be5\u4f7f\u7528\u751f\u6210\u5668\u811a\u672c\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5728\u4e00\u4e2a\u4e0d\u5c0f\u7684Moodle\uff08\u9b54\u706f\uff09\u7ad9\u70b9\u4e0a\u6d4b\u8bd5\u4ee3\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u8fd9\u7bc7\u6587\u6863\u662f\u5982\u4f55\u63d0\u9ad8moodle\uff08\u9b54\u706f\uff09\u6027\u80fd\u3010performance\u3011\u548c\u53ef\u4f38\u7f29\u6027\u3010performance\u3011\u7684\u7f16\u7801\u6307\u5357\u3002 \u7ee7\u7eed\u9605\u8bfb