technical:slurm:node-memory-sizes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
technical:slurm:node-memory-sizes [2019-02-18 11:19] – created freytechnical:slurm:node-memory-sizes [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Revisions to Slurm Configuration v1.1.3 on Caviness ====== 
  
-This document summarizes alterations to the Slurm job scheduler configuration on the Caviness cluster. 
- 
-===== Issues ===== 
- 
-==== Nominal node memory size is not an appropriate limit ==== 
- 
-When the [[technical:slurm:arraysize-and-nodecounts|v1.1.3 configuration]] was activated on 2019-02-18, all nodes in the cluster began transitioning into the DRAIN state.  The DRAIN state keeps a node online while preventing any new jobs from being scheduled to it.  The reason Slurm cited for this was: 
- 
-<code> 
-Reason=Low RealMemory 
-</code> 
- 
-Each node runs a Slurm job execution daemon (slurmd) that reports back to the scheduler every few minutes; included in that report are the base resource levels:  socket count, core count, physical memory size, /tmp disk size.  To effect the v1.1.3 changes we altered Slurm to use //FastSchedule=1// which only consults the resource levels explicitly specified in the Slurm configuration and ignores what the nodes report for those levels.  As it turns out: 
- 
-<WRAP negative round> 
-Slurm //FastSchedule=1// causes the scheduler to ignore resource levels reported by slurmd when scheduling jobs, but **does not** prevent it from noticing disparity between configured and actual levels and reacting by DRAINing the node. 
-</WRAP> 
- 
-Many nodes transitioned to the DRAIN state within the first 30 minutes after the v1.1.3 changes were activated:  the scheduler noticed that the reported memory size (e.g. 128813) was less than the configured size (nominal 128 GB = 131072). 
- 
-The changes did not need to be rolled-back, since an additional mode (//FastSchedule=2//) instructs Slurm to ignore such disparity.  Thus, the v1.1.3 changes went into production in that mode circa 10:00. 
- 
-One additional problem could present itself under the v1.1.3 use of nominal physical memory size for the nodes  Consider the following: 
- 
-  * A node runs a job requesting 28 cores and 100 GiB of memory, leaving 8 cores and 28 GiB of memory available according to the node configuration. 
-  * A second job from a different user, requesting 4 cores and 28 GiB of memory, is scheduled on the node. 
- 
-Since the OS itself occupies some non-trivial amount of the physical memory, the second job eventually extends memory usage above and beyond the amount of physical memory present.  This causes memory usage to spill into swap space, slowing all jobs on the node. 
- 
-<WRAP negative round> 
-Choosing to use the nominal memory size of each node for its RealMemory limit was meant to keep requests like ''--mem=128GB'' satisfiable by nodes with a nominal 128 GiB of memory.  However, that level does not reflect reality and is in conflict with Slurm's proper production functioning. 
-</WRAP> 
- 
-==== FastSchedule requires explicit specification of all resources ==== 
- 
-In previous configurations, the RealMemory and TmpDisk resource levels were not explicitly specified in the node configurations.  The TmpDisk level defaults to zero if not explicitly specified.  Thus, after the v1.1.3 changes were initially activated nodes were reporting: 
- 
-<code> 
-$ scontrol show node r00n22 
-NodeName=r00n22 Arch=x86_64 CoresPerSocket=18 
-      : 
-   State=IDLE ThreadsPerCore=1 TmpDisk=0 Weight=100 Owner=N/A MCS_label=N/A 
-      : 
-</code> 
- 
-Any user submitting a job which requests a minimum amount of /tmp space (e.g. ''--tmp=4G'') would be met with an error (no nodes with viable configuration given resource constraints). 
- 
-<WRAP negative round> 
-Slurm //FastSchedule=(1|2)// honors **only** the resource levels present in the node configuration file.  No operational mode exists that allows one or more levels reported by slurmd to be overridden by statically configured values. 
-</WRAP> 
- 
-This situation was addressed by augmenting the node configurations with explicit TmpDisk values shortly after the v1.1.3 configuration was activated. 
- 
-===== Solutions ===== 
- 
-==== Determine appropriate RealMemory levels ==== 
- 
-For each type of node present in Caviness, a RealMemory size less than that reported by slurmd (to prevent DRAIN state transitions) will be chosen.  The size will reflect the reality of the nodes to also prevent addition of jobs from pushing nodes into heavy swapping which will degrade performance of all jobs on the node((The use of node //features// can target specific memory-size nodes, e.g. ''--constraint=128GB'' Available node features are shown via ''scontrol show node <nodename>''.)). 
- 
-<WRAP positive round> 
-Node configurations will be  
-</WRAP> 
- 
-Slurm configures the memory size for each node in one of two ways: 
-  * When the job execution daemon (slurmd) starts, it reports the amount of available system memory //at that time// to the scheduler 
-  * The Slurm configuration file specifies a nominal memory size for the node 
-Caviness has been using the first method, since it discounts the memory consumed by the operating system and reflects what is truly available to jobs.  For example, baseline nodes in Caviness show a memory size of 125.8 GiB versus the 128 GiB of physical memory present in them.  What this has meant for users is that a job submitted with the requirement ''--mem=128G'' actually needs to run on a 256 or 512 GB node, when often the user believed the option was indicating a baseline node would suffice. 
- 
-Rather than letting the node report how much memory it has available, the second method cited above will now be used with the nominal amount of physical memory present in the node.  Thus, for baseline nodes the Slurm configuration would be changed to: 
- 
-<code> 
-NodeName=r00n[01-17,45-55] CPUS=36 Sockets=2 CoresPerSocket=18 ThreadsPerCore=1 Memory=131072 Feature="E5-2695,E5-2695v4,128GB" Weight=10 
-</code> 
- 
-The ''FastSchedule'' option will be enabled to force the scheduler to consult the values in the configuration file rather than the //real// values reported by the nodes themselves.   
- 
-Workgroup QOS aggregate memory sizes will be the sum over node types' nominal memory size times the number of each node type purchased.  In the example above, the workgroup would have the ''node=2'' limit removed, replaced with ''mem=393216''. 
- 
-=== Possible issues === 
- 
-The problem with being forced to use a single partition backed by a variety of node kinds is that the workgroup above — with a baseline node and a 256 GiB node — could submit a sequence of jobs that only require 1 GiB of memory each.  In that case, the jobs will tend to pack onto baseline nodes, leaving the 256 GiB node untouched.  Other workgroups with a similar purchase profile could submit jobs that require just 1 GiB of memory, but an absence of free baseline nodes would see those jobs running on the 256 GiB nodes.  The first workgroup's jobs complete and a job that requires an entire 256 GiB node is eligible to execute.  However, the 256 GiB node is currently occupied by the second workgroup's small-memory jobs, so the eligible job must wait for them to complete. 
- 
-Ideally, we would want to be able to express a workgroup limit that differentiates between the kinds of nodes that service a partition.  This is simply not possible in Slurm((We could invent our own generic resources (GRES) that qualify the cores in nodes, e.g. ''core_gen1_128GB'', ''core_gen1_256GB'' To enforce such limits would require that our job submission plugin determine what kind of node each job should run on and add the necessary GRES request.  Such determination would need to also be aware of the chosen partition, the workgroup, and possibly what kinds of node that workgroup purchased.  With each expansion the complexity of this determination would grow.  In short, this solution is not sustainable.)).  The only mitigation to the situation outlined above is to have additional capacity, above and beyond what was purchased; and to rely on walltime limits and workgroup inactivity to keep nodes free. 
-==== Increase MaxArraySize and MaxJobCount ==== 
- 
-The job scheduler currently uses the default job count limit of 10000.  Slurm documentation recommends this limit **not** be increased above a few hundred thousand.  The current MaxArraySize limit of 1001 has seemed to pair well with the MaxJobCount of 10000.  The scheduler nodes have a nominal 256 GiB of memory, and the scheduler is currently occupying just over 14 GiB of memory.   
- 
-<WRAP positive round> 
-Increasing both MaxArraySize and MaxJobCount by an order of magnitude should be permissible without negatively impacting the cluster. 
-</WRAP> 
- 
-The range for array job indices would become ''[0,10000]''. 
- 
-===== Implementation ===== 
- 
-All changes are effected by altering the Slurm configuration files, pushing the changed files to all nodes, and signaling a change in configuration so all daemons refresh their configuration. 
- 
-===== Impact ===== 
- 
-No downtime is expected to be required. 
- 
-===== Timeline ===== 
- 
-^Date ^Time ^Goal/Description ^ 
-|2019-02-04| |Authoring of this document| 
-|2019-02-06| |Document shared with Caviness community for feedback| 
-|2019-02-13| |Add announcement of impending change to login banner| 
-|2019-02-18|09:00|Configuration changes pushed to cluster nodes| 
-| |09:30|Restart scheduler, notify compute nodes of reconfiguration| 
-|2019-02-20| |Remove announcement from login banner| 
  • technical/slurm/node-memory-sizes.1550506773.txt.gz
  • Last modified: 2019-02-18 11:19
  • by frey