Add PidsLimit to container creation for improved resource management
Some checks failed
Unittests / deploy-dev (push) Successful in 1m4s
Unittests / unittests (push) Successful in 1m6s
Release / deploy-production (release) Failing after 1m23s

This commit is contained in:
Adam Štrauch 2026-01-05 16:10:39 +01:00
parent 50fb0bec7e
commit 86a955a2b4
Signed by: cx
GPG key ID: 7262DAFE292BCE20

View file

@ -352,6 +352,8 @@ func (d *Driver) Create(name string, image string, volumePath string, HTTPPort i
envList = append(envList, key+"="+value) envList = append(envList, key+"="+value)
} }
pidLimit := int64(2024)
createdContainer, err := cli.ContainerCreate( createdContainer, err := cli.ContainerCreate(
context.Background(), context.Background(),
&container.Config{ &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 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 MemoryReservation: int64(memory) * 1024 * 1024, // This should provide softer way how to limit the memory of our containers
OomKillDisable: &OOMKillDisable, OomKillDisable: &OOMKillDisable,
PidsLimit: &pidLimit,
}, },
PortBindings: portBindings, PortBindings: portBindings,
AutoRemove: false, AutoRemove: false,