Commit 28598099 authored by Daniele Venzano's avatar Daniele Venzano

Use the hard limit for memory when creating containers in the Docker back end

parent a51fe1dc
......@@ -104,10 +104,10 @@ class DockerClient:
log.error('Docker backend does not support volume type {}'.format(volume.type))
if service_instance.memory_limit is not None:
run_args['mem_limit'] = service_instance.memory_limit.max
run_args['mem_reservation'] = service_instance.memory_limit.min
if service_instance.memory_limit.max == service_instance.memory_limit.min:
run_args['mem_reservation'] -= 1
run_args['mem_limit'] = service_instance.memory_limit.min
# run_args['mem_reservation'] = service_instance.memory_limit.min
# if service_instance.memory_limit.max == service_instance.memory_limit.min:
# run_args['mem_reservation'] -= 1
if service_instance.core_limit is not None:
run_args['cpu_quota'] = int(100000 * service_instance.core_limit.min)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment