-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add I/O Priority Configuration for process group in Linux Containers #1191
Conversation
|
@AkihiroSuda Thanks for your quick review 😻
Thanks, I'll update it later.
I might try this against youki in my personal repository. This will take some time, so you'll have to wait. |
@AkihiroSuda I have implemented it to runc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AkihiroSuda |
@opencontainers/runtime-spec-maintainers PTAL |
schema/config-schema.json
Outdated
"ioPriority": { | ||
"class": "string", | ||
"priority": "integer" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be an enumeration of the supported values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@giuseppe Thanks for your review. It would be better! I have fixed it.
Signed-off-by: utam0k <k0ma@utam0k.jp>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
"ioPriority": { | ||
"class": "string", | ||
"enum": [ | ||
"IOPRIO_CLASS_RT", | ||
"IOPRIO_CLASS_BE", | ||
"IOPRIO_CLASS_IDLE" | ||
], | ||
"priority": "integer" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the enum is defined in the wrong location, because this enum
would now apply to ioPriority
as a whole, but the enum defines values for class
only.
So class
should probably be defined as "#/definitions/IOPriorityClass"
(e.g.) instead of a "string"
. Similar to
runtime-spec/schema/defs-linux.json
Line 102 in 720792f
"$ref": "#/definitions/SeccompOperators" |
runtime-spec/schema/defs-linux.json
Lines 77 to 88 in 504f70e
"SeccompOperators": { | |
"type": "string", | |
"enum": [ | |
"SCMP_CMP_NE", | |
"SCMP_CMP_LT", | |
"SCMP_CMP_LE", | |
"SCMP_CMP_EQ", | |
"SCMP_CMP_GE", | |
"SCMP_CMP_GT", | |
"SCMP_CMP_MASKED_EQ" | |
] | |
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This PR introduces a new configuration option to set the I/O priority for the entire process group within a Linux container. By allowing users to configure I/O priority, we enable better resource management and performance tuning for various workloads, particularly in Kubernetes environments where multiple containers may be running concurrently.
One specific use case is when running batch processing jobs alongside application Pods in a Kubernetes cluster. Batch jobs are often I/O-intensive and can cause resource contention, negatively affecting the performance of other containers running on the same node. By allowing I/O priority configuration for each container, cluster administrators can minimize the impact of I/O-intensive batch jobs on application Pods.
By adding I/O priority configuration to the OCI Runtime spec, we enable Kubernetes (and other container orchestration platforms) to take advantage of this feature and better manage container I/O resources. This can lead to improved overall performance and resource utilization on nodes running multiple containers with different I/O requirements.
Implement
This feature can be implemented using the ioprio_set system call on Linux, which allows setting the I/O priority for a given process or process group. In Go, the syscall package can be used to invoke the ioprio_set system call. A sample implementation in Go could look like this: https://go.dev/play/p/KsscUN8RITD