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

KBS/perf: promote the concurrency performance of KBS #275

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

Lu-Biao
Copy link
Contributor

@Lu-Biao Lu-Biao commented Jan 3, 2024

Currently we are using a global Mutex to protect the only one attestation service client from unsafe thread sync & send. This brings performance bottle neck.

This commit brings some optimization to promote the performance and stability.

  1. Abondon the global Mutex of the attestation service and change the API definition of Attest to non-mut. This would let the developers to handle the concurrency safe inside the concrete attestation-service inside. In this way, we prevent to lock the whole process logic.
  2. Bring in a gRPC client pool to grpc-coco-as mode. This will help to avoid errors that caused by runing out all the temporaty ports provided by OS.
  3. Replace the Mutex of session map with a concurrency-safe HashMap to avoid bottle neck.

Fixes #256

Currently we are using a global Mutex to protect the only one
attestation service client from unsafe thread sync & send. This brings
performance bottle neck.

This commit brings some optimization to promote the performance and
stability.

1. Abondon the global Mutex of the attestation service and change the API definition of
Attest to non-mut. This would let the developers to handle the
concurrency safe inside the concrete attestation-service inside. In this
way, we prevent to lock the whole process logic.
2. Bring in a gRPC client pool to grpc-coco-as mode. This will help to
avoid errors that caused by runing out all the temporaty ports provided
by OS.
3. Replace the Mutex of session map with a concurrency-safe HashMap to
avoid bottle neck.

Fixes confidential-containers#256

Signed-off-by: Xynnn007 <[email protected]>
Signed-off-by: Biao Lu <[email protected]>
@Lu-Biao Lu-Biao requested a review from sameo as a code owner January 3, 2024 04:44
Copy link
Member

@Xynnn007 Xynnn007 left a comment

Choose a reason for hiding this comment

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

LGTM. Let me put another part upon this

@Xynnn007 Xynnn007 merged commit 557945f into confidential-containers:main Jan 3, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KBS: Abondon the Mutex to promote the concurrency performance
2 participants