mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
kvm/amd64: don't limit a number of VCPU-s by GOMAXPROCS
We see some performance degradation after e98016263b
where we started limit a number of vcpu-s.
The memory limit for TestMemLimit is increased from 50MB to 128MB.
It is required because more vcpu-s require more memory. Before this
change, the test container required 46MB (8 vcpus). After this change,
the test container requires 60MB (328 vcpu-s).
PiperOrigin-RevId: 428879037
This commit is contained in:
@@ -21,7 +21,6 @@ import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
@@ -489,10 +488,6 @@ func (m *machine) getMaxVCPU() {
|
||||
} else {
|
||||
m.maxVCPUs = int(maxVCPUs)
|
||||
}
|
||||
rCPUs := runtime.GOMAXPROCS(0)
|
||||
if rCPUs < m.maxVCPUs {
|
||||
m.maxVCPUs = rCPUs
|
||||
}
|
||||
}
|
||||
|
||||
func archPhysicalRegions(physicalRegions []physicalRegion) []physicalRegion {
|
||||
|
||||
@@ -295,7 +295,7 @@ func TestMemLimit(t *testing.T) {
|
||||
d := dockerutil.MakeContainer(ctx, t)
|
||||
defer d.CleanUp(ctx)
|
||||
|
||||
allocMemoryKb := 50 * 1024
|
||||
allocMemoryKb := 128 * 1024
|
||||
opts := dockerutil.RunOpts{
|
||||
Image: "basic/alpine",
|
||||
Memory: allocMemoryKb * 1024, // In bytes.
|
||||
|
||||
Reference in New Issue
Block a user