fix naming of memory limit variables to use geth_ prefix

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-03-16 18:08:18 +01:00
parent a2b00619fc
commit c981226058
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 13 additions and 11 deletions

View File

@ -77,8 +77,6 @@ geth_network_name: 'ropsten'
# Port to listen on # Port to listen on
geth_port: 30303 geth_port: 30303
# Memory to use
geth_cache: 1536
# Address to advertise # Address to advertise
geth_public_addr: '{{ ansible_host }}' geth_public_addr: '{{ ansible_host }}'
@ -94,9 +92,13 @@ geth_consul_extra_tags: []
geth_consul_tags: '{{ geth_consul_default_tags + geth_consul_extra_tags }}' geth_consul_tags: '{{ geth_consul_default_tags + geth_consul_extra_tags }}'
# resources limits to avoid killing the host # resources limits to avoid killing the host
cont_mem_ratio: 0.7 # Geth cache usage limit
cont_mem_limit: '{{ (ansible_memtotal_mb * cont_mem_ratio|float) | int }}' geth_cache_ratio: 0.4
cont_swap_limit: '{{ (cont_mem_limit|int) + (ansible_swaptotal_mb * cont_mem_ratio|float) | int }}' geth_cache_size: '{{ (ansible_memtotal_mb * geth_cache_ratio|float) | int }}'
# 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 }}'
# generic container beaviour # generic container beaviour
cont_state: started cont_state: started

View File

@ -2,7 +2,7 @@
- name: Verify memory and cache sizes - name: Verify memory and cache sizes
assert: assert:
that: that:
- cont_mem_limit > geth_cache - geth_cont_mem_limit|int > geth_cache_size|int
fail_msg: 'Memory limit cant be lower than cache: {{ cont_mem_limit }} > {{ geth_cache }}' fail_msg: 'Memory limit cant be lower than cache: {{ geth_cont_mem_limit }} > {{ geth_cache_size }}'
success_msg: 'Memory limit is higher than cache size: {{ cont_mem_limit }} > {{ geth_cache }}' success_msg: 'Memory limit is higher than cache size: {{ geth_cont_mem_limit }} > {{ geth_cache_size }}'
quiet: true quiet: true

View File

@ -10,8 +10,8 @@
recreate: '{{ cont_recreate }}' recreate: '{{ cont_recreate }}'
restart: '{{ cont_restart }}' restart: '{{ cont_restart }}'
# some limits due to statusd hogging resources # some limits due to statusd hogging resources
memory: '{{ cont_mem_limit }}m' memory: '{{ geth_cont_mem_limit }}m'
memory_swap: '{{ cont_swap_limit }}m' memory_swap: '{{ geth_cont_swap_limit }}m'
ports: ports:
- '{{ geth_port }}:{{ geth_port }}/tcp' - '{{ geth_port }}:{{ geth_port }}/tcp'
- '{{ geth_port }}:{{ geth_port }}/udp' - '{{ geth_port }}:{{ geth_port }}/udp'
@ -46,7 +46,7 @@
--nousb --nousb
--extradata={{ geth_extra_data }} --extradata={{ geth_extra_data }}
--verbosity={{ geth_log_level_id }} --verbosity={{ geth_log_level_id }}
--cache={{ geth_cache }} --cache={{ geth_cache_size }}
--maxpeers={{ geth_max_peers }} --maxpeers={{ geth_max_peers }}
--maxpendpeers="{{ geth_max_pend_peers }}" --maxpendpeers="{{ geth_max_pend_peers }}"
--port={{ geth_port }} --port={{ geth_port }}