Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
a64fd0c4
Commit
a64fd0c4
authored
7 years ago
by
Jainin Shah
Browse files
Options
Download
Email Patches
Plain Diff
changing the formula to correctly pass the CPUQota to docker
parent
7f1e01d3
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/driver/docker.go
+2
-1
client/driver/docker.go
with
2 additions
and
1 deletion
+2
-1
client/driver/docker.go
+
2
-
1
View file @
a64fd0c4
...
...
@@ -1139,8 +1139,9 @@ func (d *DockerDriver) createContainerConfig(ctx *ExecContext, task *structs.Tas
// Calculate CPU Quota
if
driverConfig
.
CPUHardLimit
{
numCores
:=
runtime
.
NumCPU
()
percentTicks
:=
float64
(
task
.
Resources
.
CPU
)
/
float64
(
d
.
node
.
Resources
.
CPU
)
hostConfig
.
CPUQuota
=
int64
(
percentTicks
*
defaultCFSPeriodUS
)
hostConfig
.
CPUQuota
=
int64
(
percentTicks
*
defaultCFSPeriodUS
)
*
int64
(
numCores
)
}
// Windows does not support MemorySwap/MemorySwappiness #2193
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help