草稿
[WIP]perf(vmm): redirect stratovirt output to log and reduce unnecessary ResumeVM call #172
ytluo创建于 8月19日
[WIP]perf(vmm): redirect stratovirt output to log and reduce unnecessary ResumeVM call #172
草稿
ytluo创建于 8月19日
ytluo
8月19日

当前PR是否有AI参与:

[x] 否

[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :

参考:openEuler社区《生成式AI工具使用与开源贡献政策》

PR功能描述 / 为什么需要这个合入**:

 将VMM运行日志导入文件输出
 对stratovirt 的 ResumeVM 操作仅在 QMP query_status 返回 “paused”时执行
 两项优化可将250沙箱并发的时延从 2.6秒 降低至 1.3秒

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #

希望检视人员了解:

likedislike
合并受阻
Yytluo
8月19日 创建了 pull request,commit 433cfcc0
openeuler-ci-botopeneuler-ci-bot成员
8月19日 将weibaohui,yangzhao_kl,jimmieme,duguhaotian,wonleing,zmr_2020,gaodaweiky,lu-wei-army,zhaoyifan28设为审查人
openeuler-ci-botopeneuler-ci-bot成员
8月19日 添加了label:sig/sig-CloudNative
openeuler-ci-bot
openeuler-ci-bot成员
8月19日 评论:

Welcome To openEuler Community

Hey @ytluo , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: sig-CloudNative ,
and any of the maintainers: @duguhaotian, @gaodaweiky, @jimmieme, @lu-wei-army, @weibaohui, @wonleing, @yangzhao_kl, @zhaoyifan28, @zmr_2020 ,
and any of the committers: @Yekelu .

likedislike
openeuler-ci-botopeneuler-ci-bot成员
8月19日 添加了label:stat/needs-squash
此处折叠了8条事件消息 查看更多
openeuler-ci-botopeneuler-ci-bot成员
8月20日 添加了label:openeuler-cla/yes
jing-rui8月20日进行代码检视2
config/config.yaml
已过期
@@ -28,1 +28,4 @@
2828 binary: /usr/bin/stratovirt
29+ # Redirect VMM stdout/stderr to /var/log/stratovirt/<sandbox-id>.log.
30+ # Falls back to conchd's inherited stdout/stderr if the file cannot be opened.
31+ redirect_output: true
jing-rui8月20日评论:

这里建议先不要提供可配置,采用默认即最佳,当有两个输出需求的时候才需要做成可配置。
暴露给用户界面的参数越少越好

likedislike
System
系统消息系统
27 天前 评论:

changed this line on da77d1f6 view diff detail

jing-rui8月20日进行代码检视2
internal/vmm/process.go
已过期
@@ -19,6 +19,7 @@ import (
1919 
2020const SocketDirPerm = 0755
2121const unixSocketPathMax = 107
22+const stratovirtLogDir = "/var/log/stratovirt"
jing-rui8月20日评论:

输出应当统一到conch的日志中,而不是散到系统。
将 conchd 的日志、沙箱(vm)的日志统一在一个目录树下;

likedislike
System
系统消息系统
27 天前 评论:

changed this line on da77d1f6 view diff detail

jing-rui8月20日进行代码检视2
internal/vmm/stratovirt/stratovirt.go
已过期
@@ -9,6 +9,7 @@ import (
99 "net"
1010 "os"
1111 "os/exec"
12+ "path/filepath"
1213 "runtime"
1314 "strconv"
1415 "strings"
@@ -19,6 +20,8 @@ import (
1920 "github.com/openeuler/Conch/pkg/ulog"
2021)
2122 
23+const stratovirtLogDir = "/var/log/stratovirt"
jing-rui8月20日评论:

同一个常量重复定义,再sandbox.go已经定义过一遍了:const stratovirtLogDir = "/var/log/stratovirt",日志目录应该结合config.yaml来定义:
当前config.go是写死的目录:outputPath = "/var/log/conchd/"
在ulog.go也有默认值:OutputPath: "/var/log/conchd/"

可以考虑类似如下的结构:

/var/log/conch/
    conchd.log  // point to latest log
    conchd-<datetime>.log // old rotated log
    sandboxes/
        <sandbox-id>-<stratovirt|clh>.log

likedislike
System
系统消息系统
27 天前 评论:

changed this line on da77d1f6 view diff detail

jing-rui8月20日进行代码检视1
internal/vmm/stratovirt/stratovirt.go
@@ -57,3 +60,3 @@
5760{{ .PmemDevices }} \
5861-device vhost-vsock-pci,id=vsock0,guest-cid={{ .VsockCID }},bus=pcie.0,addr=0x11 \
59--disable-seccomp`
62+-disable-seccomp > "{{ .LogPath }}" 2>&1`
jing-rui8月20日评论:

stratovirt有专门的日志配置参数,应当使用官方用法:
-D [log path] output log to logfile (default stderr)

likedislike
Yytluo
8月20日 取消了草稿状态
此处折叠了10条事件消息 查看更多
openeuler-ci-botopeneuler-ci-bot成员
27 天前 删除了label:stat/needs-squash
openeuler-ci-bot
openeuler-ci-bot成员
27 天前 评论:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): stat/needs-squash.

likedislike
openeuler-ci-botopeneuler-ci-bot成员
27 天前 添加了label:openeuler-cla/yes
此处折叠了5条事件消息 查看更多
openeuler-ci-botopeneuler-ci-bot成员
27 天前 添加了label:openeuler-cla/yes
openeuler-ci-bot
openeuler-ci-bot成员
27 天前 评论:

CLA Signature Pass

ytluo, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
Yytluo
27 天前 取消了草稿状态
Yytluo
26 天前 设置为草稿状态