set memory and cpu limits on the container
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
2923405a9d
commit
eb798800c7
|
@ -19,6 +19,12 @@ beacon_node_metrics_port: 9200
|
|||
# rpc / administrative
|
||||
beacon_node_rpc_port: 9900
|
||||
|
||||
# resource limits, mem in MB
|
||||
beacon_node_cpu_limit: 0.60
|
||||
beacon_node_mem_limit: '{{ (ansible_memtotal_mb * 0.6) | int }}'
|
||||
beacon_node_cpu_reserve: 0.20
|
||||
beacon_node_mem_reserve: '{{ (ansible_memtotal_mb * 0.2) | int }}'
|
||||
|
||||
# general container management
|
||||
compose_state: 'present'
|
||||
compose_recreate: 'smart'
|
||||
|
|
|
@ -15,6 +15,14 @@
|
|||
container_name: '{{ beacon_node_cont_name }}'
|
||||
image: '{{ beacon_node_cont_image }}'
|
||||
restart: 'always'
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '{{ beacon_node_cpu_limit | string }}'
|
||||
memory: '{{ beacon_node_mem_limit }}M'
|
||||
reservations:
|
||||
cpus: '{{ beacon_node_cpu_reserve | string }}'
|
||||
memory: '{{ beacon_node_mem_reserve }}M'
|
||||
ports:
|
||||
- '127.0.0.1:{{ beacon_node_rpc_port }}:{{ beacon_node_rpc_port }}/tcp'
|
||||
- '{{ beacon_node_metrics_port }}:{{ beacon_node_metrics_port }}/tcp'
|
||||
|
|
Loading…
Reference in New Issue