mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 01:45:44 +03:00
Check for invalid CPU limit for cgroups
This commit is contained in:
@@ -196,6 +196,10 @@ func (e *LinuxExecutor) configureCgroups(resources *structs.Resources) error {
|
||||
}
|
||||
|
||||
if resources.CPU > 0.0 {
|
||||
if resources.CPU < 2.0 {
|
||||
return fmt.Errorf("resources.CPU must be equal to or greater than 2.0: %v", resources.CPU)
|
||||
}
|
||||
|
||||
// Set the relative CPU shares for this cgroup.
|
||||
// The simplest scale is 1 share to 1 MHz so 1024 = 1GHz. This means any
|
||||
// given process will have at least that amount of resources, but likely
|
||||
|
||||
Reference in New Issue
Block a user