epam / cloud-pipeline

Cloud agnostic genomics analysis, scientific computation and storage platform
https://cloud-pipeline.com
Apache License 2.0
145 stars 58 forks source link

Improve pod memory requests and limits allocation #3354

Open tcibinan opened 1 year ago

tcibinan commented 1 year ago

Background

Support for pod memory requests/limits was introduced in #971. Through launch.container.memory.resource.policy system preference it is possible to configure pod requests/limits in three configurations:

Even though those configurations provide a way to hard limit pods memory consumption, they does not provide a required level of flexibility in terms of how to allow multiple services to run on the same node efficiently. Additionaly, such configuration does not include kubelet reserved memory which may lead to memory starvation in kubelet, system and pod altogether.

Approach

Existing mechanism can be replaced by a more efficient and flexible approach which allows to specify platform level requirements for kubelet daemon and system processes via the system preferences.

The following configuration shall be supported in launch.container.memory.resource.policy system preference:

The following system preferences shall be introduced:

Considerations behind extra mem ratio

A small research has been took that revealed a baseline for an amount of unallocatable memory on AWS EC2. It has been shown that for most instance types 95% of nominal memory is actually available for use. See more in #3397.

Screenshot 2023-11-03 at 15 50 28