IBM Support

How does LSF calculate max memory usage from cgroup?

Question & Answer


Question

When cgroup is enabled, LSF uses cgroup to track the memory usage of jobs through the files under .../cgroup/lsf//job...

Answer

Three cgroup memory files are used by LSF to calculate max memory usage:


    memory.usage_in_bytes
    memory.max_usage_in_bytes
    memory.stat.
Relationship between them:
    memory.usage_in_bytes = rss (in memory.stat) + cache (in memory.stat)
    memory.max_usage_in_bytes = max(memory.usage_in_bytes)
Sbatchd reads memory.usage_in_bytes (when LSB_CGROUP_MEM_INCLUDE_CACHE=Y) or extracts rss from memory.stat (when LSB_CGROUP_MEM_INCLUDE_CACHE=N) periodically, and take the max value as Max Memory of a job.

For extremely short jobs when sbatchd has no chance to read memory.usage_in_bytes or memory.stat, memory.max_usage_in_bytes will be read when job finish, and the value is used as Max Memory.

Refer to https://www.ibm.com/support/knowledgecenter/SSWRJV_10.1.0/lsf_config_ref/lsf.conf.lsb_cgroup_mem_include_cache.5.html for the usage of LSB_CGROUP_MEM_INCLUDE_CACHE in lsf.conf.

[{"Product":{"code":"SSETD4","label":"Platform LSF"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF016","label":"Linux"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
17 June 2018

UID

isg3T1024992