diff --git a/anolis-courses/KeenTune/auto-tuning/finish.md b/anolis-courses/KeenTune/auto-tuning/finish.md new file mode 100644 index 0000000000000000000000000000000000000000..2149e0a0e2c62646b56afad3a9127098981a4447 --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/finish.md @@ -0,0 +1 @@ +恭喜您完成了profile的设置和回退实验 \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/index.yaml b/anolis-courses/KeenTune/auto-tuning/index.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b61843d0aeed564e54cf7e00e6d8bbf7eeb1b6b2 --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/index.yaml @@ -0,0 +1,24 @@ +name: Parameters Auto-Tuning in KeenTune +desc: 学习如何使用KeenTune进行参数智能优化 +image: "Anolis OS 8.4 ANCK 64位" +live_time: "60 min" +details: + steps: + start: start.md + finish: finish.md + - name: 启动KeenTune服务 + content: step1.md + - name: 获取baseline + content: step2.md + - name: 查询可调优的参数 + content: step3.md + - name: 查看参数内容 + content: step4.md + - name: 进行参数调优 + content: step5.md + - name: 查看调优日志 + content: step6.md + - name: 验证调优效果 + content: step7.md + - name: 恢复环境 + content: step8.md \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/start.md b/anolis-courses/KeenTune/auto-tuning/start.md new file mode 100644 index 0000000000000000000000000000000000000000..879bdfb1b0aa199fa3003921461782d09772ff65 --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/start.md @@ -0,0 +1 @@ +本场景提供一台部署了KeenTune和nginx服务的虚拟机环境作为性能优化的目标 \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step1.md b/anolis-courses/KeenTune/auto-tuning/step1.md new file mode 100644 index 0000000000000000000000000000000000000000..4cceca7ad1ffde815c1864bc8c8b987920ac4461 --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/step1.md @@ -0,0 +1,2 @@ +1. 运行下面的命令启动KeenTune服务 +[[ systemctl restart keentuned keentune-target]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step2.md b/anolis-courses/KeenTune/auto-tuning/step2.md new file mode 100644 index 0000000000000000000000000000000000000000..544b5f45c84401dd60d4010556ac9cea1cc42ef7 --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/step2.md @@ -0,0 +1,2 @@ +1. KeenTune提供了wrk的执行脚本,运行该脚本获得性能基准值(baseline) +[[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step3.md b/anolis-courses/KeenTune/auto-tuning/step3.md new file mode 100644 index 0000000000000000000000000000000000000000..058df2956db11058ecebc056a927e989f2482c5f --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/step3.md @@ -0,0 +1,2 @@ +1. 查询KeenTune内置的可调优的参数配置文件 +[[ keentune param list ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step4.md b/anolis-courses/KeenTune/auto-tuning/step4.md new file mode 100644 index 0000000000000000000000000000000000000000..5f1e604412cdfbab0282cc1b7b9d2e8d432a59f0 --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/step4.md @@ -0,0 +1,7 @@ +我们将会用到sysctl.json和nginx.json两个文件分别对内核参数和nginx参数进行调优 +1. 查看要调优的内核参数 +[[ cat /etc/keentune/parameter/sysctl.json ]] +2. 查看要调优的nginx配置参数 +[[ cat /etc/keentune/parameter/nginx.json ]] +3. 这两个参数已经在keentune的配置文件中指定, 可以通过以下命令查看 +[[ cat /etc/keentune/conf/keentuned.conf ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step5.md b/anolis-courses/KeenTune/auto-tuning/step5.md new file mode 100644 index 0000000000000000000000000000000000000000..2622c91cc5fa927ae240521ffb250d06441f4d2e --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/step5.md @@ -0,0 +1,2 @@ +1. 我们直接使用keentune param tune命令发起一次动态调优,使用-i指定调优轮次,--job指定任务名 +[[ keentune param tune -i 20 --job http_long_test ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step6.md b/anolis-courses/KeenTune/auto-tuning/step6.md new file mode 100644 index 0000000000000000000000000000000000000000..6b2a8193fcbbbdf17319a43f036a429e10631425 --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/step6.md @@ -0,0 +1,3 @@ +1. 调优过程会保存在日志中,我们使用tail命令查看调优过程日志 +[[ tail -f /var/log/keentune/http_long_test.log ]] +2. 等待调优结束, 日志中出现``[best] Tuning improvement``数据 \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step7.md b/anolis-courses/KeenTune/auto-tuning/step7.md new file mode 100644 index 0000000000000000000000000000000000000000..ff1e629c066da99a9190cdb7135cc08acc199a9e --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/step7.md @@ -0,0 +1,2 @@ +1. 我们再一次执行benchmark来查看调优效果 +[[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step8.md b/anolis-courses/KeenTune/auto-tuning/step8.md new file mode 100644 index 0000000000000000000000000000000000000000..1e61488fa5efaa68d3edc413fce5e35363509a7b --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/step8.md @@ -0,0 +1,2 @@ +1. 最后我们使用rollback命令恢复环境默认参数 +[[ keentune param rollback ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/index.yaml b/anolis-courses/KeenTune/index.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d4a0ced1d5388d81e162e68cde3e888434f192a9 --- /dev/null +++ b/anolis-courses/KeenTune/index.yaml @@ -0,0 +1,18 @@ +name: KeenTune智能调优 +desc: KeenTune是全栈参数智能调优工具,提供了profile设置和集成,Auto-tuning智能参数优化和敏感参数识别筛选等功能。为性能工程师、算法工程师、硬件评测工程师提供性能优化工具和解决方案。本课程将为您介绍如果通过KeenTune性能调优工具实现profile的设置、参数的智能优化和参数的敏感性分析。 +type: course +total_time: "60 min" +level: "intermediate" +chapters: + - name: "Profile Setting in KeenTune" + desc: "学习如何使用KeenTune进行profile设置" + content: "profile-setting" + live_time: "30 min" + - name: "Parameters Auto-Tuning in KeenTune" + desc: "学习如何使用KeenTune进行参数智能优化" + content: "auto-tuning" + live_time: "60 min" + - name: "Sensitivity identification in KeenTune" + desc: "学习如何使用KeenTune进行敏感参数识别" + content: "sensitizing" + live_time: "30 min" \ No newline at end of file diff --git a/anolis-courses/KeenTune/profile-setting/finish.md b/anolis-courses/KeenTune/profile-setting/finish.md new file mode 100644 index 0000000000000000000000000000000000000000..1903dcdb0470c1975bc5520e01d84dc1b6562431 --- /dev/null +++ b/anolis-courses/KeenTune/profile-setting/finish.md @@ -0,0 +1 @@ +恭喜您完成了参数的性能调优 \ No newline at end of file diff --git a/anolis-courses/KeenTune/profile-setting/index.yaml b/anolis-courses/KeenTune/profile-setting/index.yaml new file mode 100644 index 0000000000000000000000000000000000000000..91b34279ab9cdffa177257828ae63bf24eb35165 --- /dev/null +++ b/anolis-courses/KeenTune/profile-setting/index.yaml @@ -0,0 +1,20 @@ +name: Profile Setting in KeenTune +desc: 学习如何使用KeenTune进行profile设置 +image: "Anolis OS 8.4 ANCK 64位" +live_time: "30 min" +details: + steps: + start: start.md + finish: finish.md + - name: 启动KeenTune服务 + content: step1.md + - name: 获取baseline + content: step2.md + - name: 查看可用profile + content: step3.md + - name: profile设置 + content: step4.md + - name: 确认优化效果 + content: step5.md + - name: 恢复环境 + content: step6.md \ No newline at end of file diff --git a/anolis-courses/KeenTune/profile-setting/start.md b/anolis-courses/KeenTune/profile-setting/start.md new file mode 100644 index 0000000000000000000000000000000000000000..d79472d631c31cf9984d641babd376e8c901defb --- /dev/null +++ b/anolis-courses/KeenTune/profile-setting/start.md @@ -0,0 +1 @@ +本场景提供一台部署了KeenTune、wrk benchmark工具和nginx服务的虚拟机环境作为性能优化的目标和算法运行的环境 \ No newline at end of file diff --git a/anolis-courses/KeenTune/profile-setting/step1.md b/anolis-courses/KeenTune/profile-setting/step1.md new file mode 100644 index 0000000000000000000000000000000000000000..900dd88a7c6dd19840e04e58b7aaff03e2666869 --- /dev/null +++ b/anolis-courses/KeenTune/profile-setting/step1.md @@ -0,0 +1,2 @@ +运行下面的命令启动KeenTune服务 +[[ systemctl restart keentuned keentune-brain keentune-target keentune-bench ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/profile-setting/step2.md b/anolis-courses/KeenTune/profile-setting/step2.md new file mode 100644 index 0000000000000000000000000000000000000000..ebfa1f5a76eb53f7535dca84a0916910eaf49e9e --- /dev/null +++ b/anolis-courses/KeenTune/profile-setting/step2.md @@ -0,0 +1,2 @@ +KeenTune提供了wrk的执行脚本,运行该脚本获得性能基准值(baseline) +[[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/profile-setting/step3.md b/anolis-courses/KeenTune/profile-setting/step3.md new file mode 100644 index 0000000000000000000000000000000000000000..7b193dff533298b23872ab903db3306d6756d11f --- /dev/null +++ b/anolis-courses/KeenTune/profile-setting/step3.md @@ -0,0 +1,2 @@ +查看KeenTune中可使用的专家调优文件 +[[ keentune profile list ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/profile-setting/step4.md b/anolis-courses/KeenTune/profile-setting/step4.md new file mode 100644 index 0000000000000000000000000000000000000000..14b9110aeb3031535f47b3397a49dfbd1d16dc8b --- /dev/null +++ b/anolis-courses/KeenTune/profile-setting/step4.md @@ -0,0 +1,2 @@ +我们选择``http_long_group1.conf``这个profile文件设置到当前环境中 +[[ keentune profile set --group1 http_long_group1.conf ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/profile-setting/step5.md b/anolis-courses/KeenTune/profile-setting/step5.md new file mode 100644 index 0000000000000000000000000000000000000000..8d0d11da62740ac2eaeeab00ac2ecf1a66bc52bd --- /dev/null +++ b/anolis-courses/KeenTune/profile-setting/step5.md @@ -0,0 +1,2 @@ +设置成功后,我们再次执行benchmark查看调优后的性能得分 +[[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/profile-setting/step6.md b/anolis-courses/KeenTune/profile-setting/step6.md new file mode 100644 index 0000000000000000000000000000000000000000..931747604b3614b73c4522b42ae300352cee3a32 --- /dev/null +++ b/anolis-courses/KeenTune/profile-setting/step6.md @@ -0,0 +1,2 @@ +最后使用rollback命令恢复环境默认参数 +[[ keentune profile rollback ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/sensitizing/finish.md b/anolis-courses/KeenTune/sensitizing/finish.md new file mode 100644 index 0000000000000000000000000000000000000000..aa161e5ac1bbb6d68014ef214805e54a02989dcc --- /dev/null +++ b/anolis-courses/KeenTune/sensitizing/finish.md @@ -0,0 +1 @@ +恭喜您完成了参数敏感性识别,接下来您可以根据结果筛选要调优的参数列表 \ No newline at end of file diff --git a/anolis-courses/KeenTune/sensitizing/index.yaml b/anolis-courses/KeenTune/sensitizing/index.yaml new file mode 100644 index 0000000000000000000000000000000000000000..11c4759de763da37539ee3f8b1f66e29fad9a3bb --- /dev/null +++ b/anolis-courses/KeenTune/sensitizing/index.yaml @@ -0,0 +1,16 @@ +name: Sensitivity identification in KeenTune +desc: 学习如何使用KeenTune进行参数敏感性识别 +image: "Anolis OS 8.4 ANCK 64位" +live_time: "30 min" +details: + steps: + start: start.md + finish: finish.md + - name: 启动KeenTune服务 + content: step1.md + - name: 查看可用的数据列表 + content: step2.md + - name: 发起一次参数敏感性识别 + content: step3.md + - name: 查看日志和结果 + content: step4.md \ No newline at end of file diff --git a/anolis-courses/KeenTune/sensitizing/start.md b/anolis-courses/KeenTune/sensitizing/start.md new file mode 100644 index 0000000000000000000000000000000000000000..3ade33c64380fda7e1b59f7e4b29cf4093275a15 --- /dev/null +++ b/anolis-courses/KeenTune/sensitizing/start.md @@ -0,0 +1 @@ +本场景提供一台部署了KeenTune和实验所需数据的虚拟机用来体验敏感参数识别功能 \ No newline at end of file diff --git a/anolis-courses/KeenTune/sensitizing/step1.md b/anolis-courses/KeenTune/sensitizing/step1.md new file mode 100644 index 0000000000000000000000000000000000000000..e0c0238fae5df276435553838a03e6f693ccab29 --- /dev/null +++ b/anolis-courses/KeenTune/sensitizing/step1.md @@ -0,0 +1,2 @@ +运行下面的命令启动KeenTune服务 +[[ systemctl restart keentuned keentune-brain]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/sensitizing/step2.md b/anolis-courses/KeenTune/sensitizing/step2.md new file mode 100644 index 0000000000000000000000000000000000000000..8edc9aaf912ee80a7d9b691ba6bb5095e896e8dd --- /dev/null +++ b/anolis-courses/KeenTune/sensitizing/step2.md @@ -0,0 +1,2 @@ +查看可用的数据列表,我们已经提前完成了一个名为http_long的参数调优任务,并保留了它的数据作为敏感参数识别的输入 +[[ keentune param jobs ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/sensitizing/step3.md b/anolis-courses/KeenTune/sensitizing/step3.md new file mode 100644 index 0000000000000000000000000000000000000000..de6e72d409e641506ca5862fb657cd1b6bfd7a3d --- /dev/null +++ b/anolis-courses/KeenTune/sensitizing/step3.md @@ -0,0 +1,2 @@ +我们使用http_long调优任务的数据发起一次参数敏感性识别,--data指定使用的数据,--job表明本次参数敏感性识别任务的名称 +[[ keentune sensitize train --data http_long --job http_long_train ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/sensitizing/step4.md b/anolis-courses/KeenTune/sensitizing/step4.md new file mode 100644 index 0000000000000000000000000000000000000000..41b831762d552e81c3fdd7b808db31be332ac277 --- /dev/null +++ b/anolis-courses/KeenTune/sensitizing/step4.md @@ -0,0 +1,3 @@ +1. 使用tail命令查看参数识别过程日志 +[[ tail -f /var/log/keentune/keentuned-sensitize-train-http_long_train.log ]] +2. 等待参数识别完成,我们就可以在日志中看到参数敏感性排序 \ No newline at end of file