Add PidsLimit to container creation for improved resource management
This commit is contained in:
parent
50fb0bec7e
commit
86a955a2b4
1 changed files with 3 additions and 0 deletions
|
|
@ -352,6 +352,8 @@ func (d *Driver) Create(name string, image string, volumePath string, HTTPPort i
|
|||
envList = append(envList, key+"="+value)
|
||||
}
|
||||
|
||||
pidLimit := int64(2024)
|
||||
|
||||
createdContainer, err := cli.ContainerCreate(
|
||||
context.Background(),
|
||||
&container.Config{
|
||||
|
|
@ -371,6 +373,7 @@ func (d *Driver) Create(name string, image string, volumePath string, HTTPPort i
|
|||
Memory: int64(memory*110/100) * 1024 * 1024, // Allow 10 % more memory so we have space for MemoryReservation
|
||||
MemoryReservation: int64(memory) * 1024 * 1024, // This should provide softer way how to limit the memory of our containers
|
||||
OomKillDisable: &OOMKillDisable,
|
||||
PidsLimit: &pidLimit,
|
||||
},
|
||||
PortBindings: portBindings,
|
||||
AutoRemove: false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue