Skip to content

take too long time for execution of CNI #10897

Open
containerd/go-cni
#127
@yylt

Description

@yylt

What is the problem you're trying to solve

solve the problem of long execution time for CNI which under the NUMA architecture, especially on a large number of core, as shown below

the node numa info:

Image

the cni conf is:

{ "cniVersion": "0.3.1", "name": "multus-cni-network", "type": "multus", "capabilities": { "bandwidth": true, "portMappings": true }, "kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig", "delegates": [ { "name":"cni0", "cniVersion":"0.3.1", "plugins":[ { "type":"flannel", "delegate":{ "forceAddress":true, "hairpinMode": true, "isDefaultGateway":true } }, { "type":"portmap", "capabilities":{ "portMappings":true } }, { "type":"bandwidth", "capabilities":{ "bandwidth":true } } ] } ] }

the sandbox log in containerd, Creating a sandbox takes about 7s

time="2024-10-25T11:27:44.228772089+08:00" level-info msg-"RunPodsandbox for &PodSandboxMetadata(Name:test-0,Uid:e286e138-fb 9b-4131-98df-2f27736b3444, Namespace:default, Attempt:0,)"
time-"2024-10-25T11:27:51.138399075+08:00" level-info msg-"starting signal loop" namespace-k8s.io path-/run/containerd/io.co ntainerd.runtime.v2.task/k8s.io/c01312a42e37def689f71b383bb55e4a9fcc1358bc8c84cf414c0d3e3cef6019 pid-53071
time-"2024-10-25T11:27:51.260613361+08:00" level-info msg-"RunPodSandbox for &PodSandboxMetadata(Name:test-0,Uid:e286e138-fb 9b-4131-98df-2f27736b3444,Namespace:default,Attempt:0,) returns sandbox id 1c01312a42e37def689f71b383bb55e4a9fcc1358bc8c84c f414c0d3e3cef6019\""

After setting the environment variable GOMAXPROC=20 on containerd.service, the log is as follows:

ime="2024-10-25T14: 45: 46.806184979+08: 00" level=info msg="RunPodsandbox for &PodSandboxMetadata{Name: test-0, Uid: e286e -fb9b-4131-98df-2f27736b3444,Namespace: default,Attempt: 0,}
time="2024-10-25T14: 45:48.249108995+08: 00" level=info msg="starting signal loop" namespace=k8s. io path=/run/containerd o. containerd. runtime. v2. task/k8sio/47750dald3f2ddce953bb694e05aa879cca2ce6850ccd291b3dE0b5d84fcof99 pid=7245
time="2024-10-25T14:45:48.363102482+08:00" level=info msg="RunPodSandbox for &PodSandboxMetadata(Name:test-0,Uid:e286e 8-fb9b-4131-98df-2f27736b3444, Namespace: default, Attempt: 0, } returns sandbox id 47750dald3f2ddce953bb694e05aa879cca2ce 850ccd291b3df0b5d84fcof99\""

I think this time change is related to the golang/go#28808. In the NUMA architecture, Golang scheduling has some negative optimization.

Just as GOMAXPROCS = 2 at startup in containerd-shim-runc-v2, could environment GOMAXPROCS also set during cni execution? this modification will improve the efficiency of cni allocation, especially on multi-core node

Describe the solution you'd like

Most CNN implementations use the Golang language, so setting environment GOMAXPROCS at cni execution, it could be makes sense.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    • Status

      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions