From 9591893b873a0d30f5c56519bdd2dbd5bc9a1408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 24 Nov 2020 14:46:50 +0100 Subject: [PATCH] dont set --cache if not specified, it messes with things MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- README.md | 3 ++- defaults/main.yml | 6 ++---- tasks/container.yml | 4 +++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 673cd4e..bac619b 100644 --- a/README.md +++ b/README.md @@ -39,4 +39,5 @@ For the rest see the [`defaults/main.yml`](/defaults/main.yml) config file. # Known Issues -Currently only 3 networks are supported: `mainnet`, `ropsten`, and `goerli` +* Currently only 3 networks are supported: `mainnet`, `ropsten`, `goerli`, and `yolov1`. +* Setting `--cache` values higher than 1/3rd of available memory will cause trouble syncing. diff --git a/defaults/main.yml b/defaults/main.yml index 2ecd862..9ce4e66 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -93,10 +93,8 @@ 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 -# Geth cache usage limit -geth_cache_ratio: 0.4 -geth_cache_size: '{{ (((ansible_memtotal_mb * geth_cache_ratio|float) / 1204) | round | int) * 1024 | int }}' +# Geth cache size. WARNING: Values higher than 1GB cause issues. +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 }}' diff --git a/tasks/container.yml b/tasks/container.yml index b104d75..14cceef 100644 --- a/tasks/container.yml +++ b/tasks/container.yml @@ -42,10 +42,12 @@ {% if geth_metrics_enabled %} --metrics {% endif %} + {% if geth_cache_size %} + --cache={{ geth_cache_size }} + {% endif %} --nousb --extradata={{ geth_extra_data }} --verbosity={{ geth_log_level_id }} - --cache={{ geth_cache_size }} --maxpeers={{ geth_max_peers }} --maxpendpeers="{{ geth_max_pend_peers }}" --port={{ geth_port }}