Skip to content
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

fscache: enable multi-threading to process fscache requests #536

Merged
merged 1 commit into from
Jun 28, 2022

Conversation

jiangliu
Copy link
Collaborator

Add command line option "fscache-threads" to nydusd to support
multi-threading for fscache service. There's one thread to receive
fscache request from cachefile fd, and dispatch READ requests to
multiple working threads through a multi-producer, multi-consumer
channel.

We have observed about 40% performance boost when serving some multi
threading container workloads.

Signed-off-by: Jiang Liu gerry@linux.alibaba.com

@yqleng1987
Copy link
Contributor

@jiangliu , a new test job has been submitted. Please wait in patience.

@yqleng1987
Copy link
Contributor

@jiangliu , The CI test is completed, please check result:

Test CaseTest Result
merge-target-branch✅SUCCESS
build-docker-image✅SUCCESS
compile-nydus❌FAIL

Sorry, your test job failed. Please get the details in the link.

Add command line option "fscache-threads" to nydusd to support
multi-threading for fscache service. There's one thread to receive
fscache request from cachefile fd, and dispatch `READ` requests to
multiple working threads through a multi-producer, multi-consumer
channel.

We have observed about 40% performance boost when serving some multi
threading container workloads.

Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
@yqleng1987
Copy link
Contributor

@jiangliu , your pull request has been updated. A new test job will be submitted. Please wait in patience.

@yqleng1987
Copy link
Contributor

@jiangliu , the test job has been submitted. Please wait in patience.

@yqleng1987
Copy link
Contributor

@jiangliu , The CI test is completed, please check result:

Test CaseTest Result
merge-target-branch✅SUCCESS
build-docker-image✅SUCCESS
compile-nydus✅SUCCESS
compile-ctr-remote✅SUCCESS
compile-nydus-snapshotter✅SUCCESS
start-nydus-snapshotter-config-containerd✅SUCCESS
run-container-with-nydus-image✅SUCCESS

Congratulations, your test job passed!

@kevinXYin
Copy link
Contributor

LGTM,
I have a test for this, and I can see a performance gain for multithreaded reading scenarios.

@@ -117,16 +120,33 @@ impl ServiceController {
};
let tag = subargs.value_of("fscache-tag");

let mut threads = 1usize;
if let Some(threads_value) = subargs.value_of("fscache-threads") {
if let Ok(t) = threads_value.parse::<i32>() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can reuse the validator code above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please help to give more hints about the way to reuse code? I haven't found similar pieces of code yet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is like this :)

imeoer@30fa3f6

src/bin/nydusd/main.rs Show resolved Hide resolved
@imeoer imeoer merged commit 363665f into dragonflyoss:master Jun 28, 2022
@jiangliu jiangliu deleted the fscache-mt branch July 19, 2022 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants