swap limits are not supported by docker-compose

https://stackoverflow.com/questions/44325949/

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-03-25 20:47:27 +01:00
parent 18382d60d1
commit c67fc0ef6c
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 4 additions and 3 deletions

View File

@ -107,7 +107,6 @@ geth_cache_size: ~
# Container memory limits
geth_cont_mem_ratio: 0.6
geth_cont_mem_limit: '{{ (ansible_memtotal_mb * geth_cont_mem_ratio|float) | int }}'
geth_cont_swap_limit: '{{ (geth_cont_mem_limit|int) + (ansible_swaptotal_mb * geth_cont_mem_ratio|float) | int }}'
# general container management
compose_recreate: 'smart'

View File

@ -6,8 +6,10 @@ services:
image: '{{ geth_cont_image }}'
user: root
restart: 'always'
mem_limit: '{{ geth_cont_mem_limit }}m'
memswap_limit: '{{ geth_cont_swap_limit }}m'
deploy:
resources:
limits:
memory: '{{ geth_cont_mem_limit }}m'
ports:
- '{{ geth_port }}:{{ geth_port }}/tcp'
- '{{ geth_port }}:{{ geth_port }}/udp'