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

cmd/geth: use automaxprocs to apply cpu quota correctly #21

Merged
merged 1 commit into from Sep 3, 2023

Conversation

0xcb9ff9
Copy link

@0xcb9ff9 0xcb9ff9 commented Sep 1, 2023

Description

upstream PR: go-ethereum#27506

As discussed with @rjl493456442 offline, if Geth was running in a container with CPU quota(set with cgroup limiting), and runtime.NumCPU returns the host's CPU cores(maybe bigger than the docker's setting), which may result in more Golang runtime schedule and context switch.

So I'm using the uber/atomaxprocs package to return the correct cpu quota.

@0xcb9ff9 0xcb9ff9 added the upstream upstream PR label Sep 1, 2023
@0xcb9ff9 0xcb9ff9 self-assigned this Sep 1, 2023
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

LGTM so far.
But we need to keep an eye on its upgrade and issues, it's not working on ECS (nested cgroups) yet.

@DarianShawn DarianShawn merged commit c16b360 into dev Sep 3, 2023
5 checks passed
@DarianShawn DarianShawn deleted the upstream/27506-container-cpu branch September 3, 2023 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream upstream PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants