From 9343ec30a6e62d5cec7af1af9f130f4e46735cfd Mon Sep 17 00:00:00 2001 From: "runzhe.wrz" Date: Thu, 21 Jul 2022 16:18:52 +0800 Subject: [PATCH 1/2] add 3 Lesson of KeenTune Signed-off-by: runzhe.wrz --- anolis-courses/KeenTune/auto-tuning/finish.md | 1 + .../KeenTune/auto-tuning/index.yaml | 26 +++++++++++++++++++ anolis-courses/KeenTune/auto-tuning/start.md | 1 + anolis-courses/KeenTune/auto-tuning/step1.md | 2 ++ anolis-courses/KeenTune/auto-tuning/step2.md | 2 ++ anolis-courses/KeenTune/auto-tuning/step3.md | 2 ++ anolis-courses/KeenTune/auto-tuning/step4.md | 7 +++++ anolis-courses/KeenTune/auto-tuning/step5.md | 2 ++ anolis-courses/KeenTune/auto-tuning/step6.md | 3 +++ anolis-courses/KeenTune/auto-tuning/step7.md | 2 ++ anolis-courses/KeenTune/auto-tuning/step8.md | 2 ++ anolis-courses/KeenTune/index.yaml | 18 +++++++++++++ .../KeenTune/profile-setting/finish.md | 1 + .../KeenTune/profile-setting/index.yaml | 22 ++++++++++++++++ .../KeenTune/profile-setting/start.md | 1 + .../KeenTune/profile-setting/step1.md | 2 ++ .../KeenTune/profile-setting/step2.md | 2 ++ .../KeenTune/profile-setting/step3.md | 2 ++ .../KeenTune/profile-setting/step4.md | 2 ++ .../KeenTune/profile-setting/step5.md | 2 ++ .../KeenTune/profile-setting/step6.md | 2 ++ anolis-courses/KeenTune/sensitizing/finish.md | 1 + .../KeenTune/sensitizing/index.yaml | 18 +++++++++++++ anolis-courses/KeenTune/sensitizing/start.md | 1 + anolis-courses/KeenTune/sensitizing/step1.md | 2 ++ anolis-courses/KeenTune/sensitizing/step2.md | 2 ++ anolis-courses/KeenTune/sensitizing/step3.md | 2 ++ anolis-courses/KeenTune/sensitizing/step4.md | 3 +++ 28 files changed, 133 insertions(+) create mode 100644 anolis-courses/KeenTune/auto-tuning/finish.md create mode 100644 anolis-courses/KeenTune/auto-tuning/index.yaml create mode 100644 anolis-courses/KeenTune/auto-tuning/start.md create mode 100644 anolis-courses/KeenTune/auto-tuning/step1.md create mode 100644 anolis-courses/KeenTune/auto-tuning/step2.md create mode 100644 anolis-courses/KeenTune/auto-tuning/step3.md create mode 100644 anolis-courses/KeenTune/auto-tuning/step4.md create mode 100644 anolis-courses/KeenTune/auto-tuning/step5.md create mode 100644 anolis-courses/KeenTune/auto-tuning/step6.md create mode 100644 anolis-courses/KeenTune/auto-tuning/step7.md create mode 100644 anolis-courses/KeenTune/auto-tuning/step8.md create mode 100644 anolis-courses/KeenTune/index.yaml create mode 100644 anolis-courses/KeenTune/profile-setting/finish.md create mode 100644 anolis-courses/KeenTune/profile-setting/index.yaml create mode 100644 anolis-courses/KeenTune/profile-setting/start.md create mode 100644 anolis-courses/KeenTune/profile-setting/step1.md create mode 100644 anolis-courses/KeenTune/profile-setting/step2.md create mode 100644 anolis-courses/KeenTune/profile-setting/step3.md create mode 100644 anolis-courses/KeenTune/profile-setting/step4.md create mode 100644 anolis-courses/KeenTune/profile-setting/step5.md create mode 100644 anolis-courses/KeenTune/profile-setting/step6.md create mode 100644 anolis-courses/KeenTune/sensitizing/finish.md create mode 100644 anolis-courses/KeenTune/sensitizing/index.yaml create mode 100644 anolis-courses/KeenTune/sensitizing/start.md create mode 100644 anolis-courses/KeenTune/sensitizing/step1.md create mode 100644 anolis-courses/KeenTune/sensitizing/step2.md create mode 100644 anolis-courses/KeenTune/sensitizing/step3.md create mode 100644 anolis-courses/KeenTune/sensitizing/step4.md diff --git a/anolis-courses/KeenTune/auto-tuning/finish.md b/anolis-courses/KeenTune/auto-tuning/finish.md new file mode 100644 index 0000000..2149e0a --- /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 0000000..1fc4ff0 --- /dev/null +++ b/anolis-courses/KeenTune/auto-tuning/index.yaml @@ -0,0 +1,26 @@ +name: Parameters Auto-Tuning in KeenTune +desc: 学习如何使用KeenTune进行参数智能优化 +image: "Anolis OS 8.4 ANCK 64位" +live_time: "60 min" +machine: # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g +max_clients: # 最大并发使用数,不填则默认不限制 +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 0000000..879bdfb --- /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 0000000..4cceca7 --- /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 0000000..544b5f4 --- /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 0000000..058df29 --- /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 0000000..5f1e604 --- /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 0000000..2622c91 --- /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 0000000..6b2a819 --- /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 0000000..ff1e629 --- /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 0000000..1e61488 --- /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 0000000..66813e8 --- /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: "medium" # beginner、intermediate、advanced +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" diff --git a/anolis-courses/KeenTune/profile-setting/finish.md b/anolis-courses/KeenTune/profile-setting/finish.md new file mode 100644 index 0000000..1903dcd --- /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 0000000..efbf947 --- /dev/null +++ b/anolis-courses/KeenTune/profile-setting/index.yaml @@ -0,0 +1,22 @@ +name: Profile Setting in KeenTune +desc: 学习如何使用KeenTune进行profile设置 +image: "Anolis OS 8.4 ANCK 64位" +live_time: "30 min" +machine: # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g +max_clients: # 最大并发使用数,不填则默认不限制 +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 0000000..d79472d --- /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 0000000..900dd88 --- /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 0000000..ebfa1f5 --- /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 0000000..7b193df --- /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 0000000..14b9110 --- /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 0000000..8d0d11d --- /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 0000000..9317476 --- /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 0000000..aa161e5 --- /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 0000000..3795c76 --- /dev/null +++ b/anolis-courses/KeenTune/sensitizing/index.yaml @@ -0,0 +1,18 @@ +name: Sensitivity identification in KeenTune +desc: 学习如何使用KeenTune进行参数敏感性识别 +image: "Anolis OS 8.4 ANCK 64位" +live_time: "30 min" +machine: # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g +max_clients: # 最大并发使用数,不填则默认不限制 +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 0000000..3ade33c --- /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 0000000..e0c0238 --- /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 0000000..8edc9aa --- /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 0000000..de6e72d --- /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 0000000..41b8317 --- /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 -- Gitee From 9892b7a60819dcee964dba4af44b799e9cb6fd26 Mon Sep 17 00:00:00 2001 From: "runzhe.wrz" Date: Thu, 21 Jul 2022 20:16:27 +0800 Subject: [PATCH 2/2] fix: wrong level name and empty data 1. rename level 'medium' to 'intermediate' 2. remove empty(default) data Signed-off-by: runzhe.wrz --- anolis-courses/KeenTune/auto-tuning/index.yaml | 2 -- anolis-courses/KeenTune/index.yaml | 4 ++-- anolis-courses/KeenTune/profile-setting/index.yaml | 2 -- anolis-courses/KeenTune/sensitizing/index.yaml | 2 -- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/anolis-courses/KeenTune/auto-tuning/index.yaml b/anolis-courses/KeenTune/auto-tuning/index.yaml index 1fc4ff0..b61843d 100644 --- a/anolis-courses/KeenTune/auto-tuning/index.yaml +++ b/anolis-courses/KeenTune/auto-tuning/index.yaml @@ -2,8 +2,6 @@ name: Parameters Auto-Tuning in KeenTune desc: 学习如何使用KeenTune进行参数智能优化 image: "Anolis OS 8.4 ANCK 64位" live_time: "60 min" -machine: # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g -max_clients: # 最大并发使用数,不填则默认不限制 details: steps: start: start.md diff --git a/anolis-courses/KeenTune/index.yaml b/anolis-courses/KeenTune/index.yaml index 66813e8..d4a0ced 100644 --- a/anolis-courses/KeenTune/index.yaml +++ b/anolis-courses/KeenTune/index.yaml @@ -2,7 +2,7 @@ name: KeenTune智能调优 desc: KeenTune是全栈参数智能调优工具,提供了profile设置和集成,Auto-tuning智能参数优化和敏感参数识别筛选等功能。为性能工程师、算法工程师、硬件评测工程师提供性能优化工具和解决方案。本课程将为您介绍如果通过KeenTune性能调优工具实现profile的设置、参数的智能优化和参数的敏感性分析。 type: course total_time: "60 min" -level: "medium" # beginner、intermediate、advanced +level: "intermediate" chapters: - name: "Profile Setting in KeenTune" desc: "学习如何使用KeenTune进行profile设置" @@ -15,4 +15,4 @@ chapters: - name: "Sensitivity identification in KeenTune" desc: "学习如何使用KeenTune进行敏感参数识别" content: "sensitizing" - live_time: "30 min" + live_time: "30 min" \ No newline at end of file diff --git a/anolis-courses/KeenTune/profile-setting/index.yaml b/anolis-courses/KeenTune/profile-setting/index.yaml index efbf947..91b3427 100644 --- a/anolis-courses/KeenTune/profile-setting/index.yaml +++ b/anolis-courses/KeenTune/profile-setting/index.yaml @@ -2,8 +2,6 @@ name: Profile Setting in KeenTune desc: 学习如何使用KeenTune进行profile设置 image: "Anolis OS 8.4 ANCK 64位" live_time: "30 min" -machine: # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g -max_clients: # 最大并发使用数,不填则默认不限制 details: steps: start: start.md diff --git a/anolis-courses/KeenTune/sensitizing/index.yaml b/anolis-courses/KeenTune/sensitizing/index.yaml index 3795c76..11c4759 100644 --- a/anolis-courses/KeenTune/sensitizing/index.yaml +++ b/anolis-courses/KeenTune/sensitizing/index.yaml @@ -2,8 +2,6 @@ name: Sensitivity identification in KeenTune desc: 学习如何使用KeenTune进行参数敏感性识别 image: "Anolis OS 8.4 ANCK 64位" live_time: "30 min" -machine: # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g -max_clients: # 最大并发使用数,不填则默认不限制 details: steps: start: start.md -- Gitee