From 519a00e5c8345af4e809bc3e37094767fbe60655 Mon Sep 17 00:00:00 2001 From: Neeharika-Sompalli Date: Mon, 4 Apr 2022 17:47:46 -0500 Subject: [PATCH 1/2] update the properties and env variables --- .env | 13 ++++++++++--- README.md | 12 ++++++++++++ docker-compose.yml | 24 ++++++++++++------------ 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/.env b/.env index bdbe4e47..df57523d 100644 --- a/.env +++ b/.env @@ -15,20 +15,27 @@ POSTGRES_USER=swirlds POSTGRES_PASSWORD=password #### Java Process Settings #### -JAVA_HEAP_MIN=256m -JAVA_HEAP_MAX=2g -JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xlog:gc*:gc.log" +PLATFORM_JAVA_HEAP_MIN=256m +PLATFORM_JAVA_HEAP_MAX=2g +PLATFORM_JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xlog:gc*:gc.log" #### Bind Mount Settings #### NETWORK_NODE_LOGS_ROOT_PATH=./network-logs/node APPLICATION_ROOT_PATH=./compose-network/network-node +APPLICATION_CONFIG_PATH=./compose-network/network-node/data/config #### Network Node Memory Limits #### NETWORK_NODE_MEM_LIMIT=8gb #### MirrorNode settings #### MIRROR_POSTGRES_IMAGE=postgres:13.5-alpine +MIRROR_GRPC_MEM_LIMIT=512m +MIRROR_IMPORTER_MEM_LIMIT=768m +MIRROR_REST_MEM_LIMIT=512m +MIRROR_WEB3_MEM_LIMIT=512m + #### MINIO settings #### MINIO_ROOT_USER=minioadmin MINIO_ROOT_PASSWORD=minioadmin + diff --git a/README.md b/README.md index da970d6d..f4131856 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,18 @@ 1. `compose-network` folder has the static files needed for starting Local network. 2. `network-logs` folder will be created at runtime and will have all the log files generated after starting local node. +### Steps to change the memory limits and properties +1. Memory limits for consensus node can be changed with these settings in `.env` file + - NETWORK_NODE_MEM_LIMIT +2. Memory limits for mirror node containers can be changed by modifying the following settings in `.env` file + - MIRROR_GRPC_MEM_LIMIT - memory limit for mirror node gRPC + - MIRROR_IMPORTER_MEM_LIMIT - memory limit for mirror node importer + - MIRROR_REST_MEM_LIMIT - memory limit for mirror node rest api + - MIRROR_WEB3_MEM_LIMIT - memory limit for mirror node web3 +3. To change `application.properties`, `api-permission.properties` or `bootstrap.properties` properties, update the `APPLICATION_CONFIG_PATH` to the location of updated config folder in `.env` file + +**IMPORTANT :** Ensure to do `docker-compose down -v; git clean -xfd; git reset --hard` and then `docker-compose up -d` for the new changes to take any effect. + ### NOTE 1. Ensure to use Docker Compose version 1.29.2 on macOS, due to known bug in Docker Compose V2. 2. Ensure the `gRPC FUSE for file sharing` and `Use Docker Compose V2` settings are disabled in the docker settings. diff --git a/docker-compose.yml b/docker-compose.yml index c4da2d2f..99641a67 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,9 +42,9 @@ services: mem_limit: "${NETWORK_NODE_MEM_LIMIT}" memswap_limit: "${NETWORK_NODE_MEM_LIMIT}" environment: - JAVA_HEAP_MIN: "${JAVA_HEAP_MIN}" - JAVA_HEAP_MAX: "${JAVA_HEAP_MAX}" - JAVA_OPTS: "${JAVA_OPTS}" + JAVA_HEAP_MIN: "${PLATFORM_JAVA_HEAP_MIN}" + JAVA_HEAP_MAX: "${PLATFORM_JAVA_HEAP_MAX}" + JAVA_OPTS: "${PLATFORM_JAVA_OPTS}" POSTGRES_DB: "${POSTGRES_DB}" POSTGRES_HOST: "network-node-postgres" POSTGRES_PORT: "5432" @@ -66,7 +66,7 @@ services: volumes: - "${NETWORK_NODE_LOGS_ROOT_PATH}/accountBalances:/opt/hgcapp/accountBalances" - "${NETWORK_NODE_LOGS_ROOT_PATH}/recordStreams:/opt/hgcapp/recordStreams" - - "${APPLICATION_ROOT_PATH}/data/config:/opt/hgcapp/services-hedera/HapiApp2.0/data/config" + - "${APPLICATION_CONFIG_PATH}:/opt/hgcapp/services-hedera/HapiApp2.0/data/config" - "${NETWORK_NODE_LOGS_ROOT_PATH}/logs:/opt/hgcapp/services-hedera/HapiApp2.0/output" - "${APPLICATION_ROOT_PATH}/data/keys:/opt/hgcapp/services-hedera/HapiApp2.0/data/keys" - "${APPLICATION_ROOT_PATH}/data/onboard:/opt/hgcapp/services-hedera/HapiApp2.0/data/onboard" @@ -202,8 +202,8 @@ services: container_name: mirror-node-grpc restart: unless-stopped mem_swappiness: 0 - mem_limit: 512m - memswap_limit: 512m + mem_limit: "${MIRROR_GRPC_MEM_LIMIT}" + memswap_limit: "${MIRROR_GRPC_MEM_LIMIT}" depends_on: network-node: condition: service_started @@ -224,8 +224,8 @@ services: container_name: mirror-node-importer restart: unless-stopped mem_swappiness: 0 - mem_limit: 768m - memswap_limit: 768m + mem_limit: "${MIRROR_IMPORTER_MEM_LIMIT}" + memswap_limit: "${MIRROR_IMPORTER_MEM_LIMIT}" depends_on: minio: condition: service_started @@ -245,8 +245,8 @@ services: image: gcr.io/mirrornode/hedera-mirror-rest:0.49.0 container_name: mirror-node-rest mem_swappiness: 0 - mem_limit: 512m - memswap_limit: 512m + mem_limit: "${MIRROR_REST_MEM_LIMIT}" + memswap_limit: "${MIRROR_REST_MEM_LIMIT}" depends_on: importer: condition: service_started @@ -265,8 +265,8 @@ services: image: gcr.io/mirrornode/hedera-mirror-web3:0.49.0 container_name: mirror-node-web3 mem_swappiness: 0 - mem_limit: 512m - memswap_limit: 512m + mem_limit: "${MIRROR_WEB3_MEM_LIMIT}" + memswap_limit: "${MIRROR_WEB3_MEM_LIMIT}" depends_on: importer: condition: service_started From a24db5743b4a01ca982d769ab1d77406aa672496 Mon Sep 17 00:00:00 2001 From: Neeharika-Sompalli Date: Mon, 4 Apr 2022 22:24:40 -0500 Subject: [PATCH 2/2] change comments --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f4131856..7d9ce6b5 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,18 @@ 2. `network-logs` folder will be created at runtime and will have all the log files generated after starting local node. ### Steps to change the memory limits and properties -1. Memory limits for consensus node can be changed with these settings in `.env` file - - NETWORK_NODE_MEM_LIMIT -2. Memory limits for mirror node containers can be changed by modifying the following settings in `.env` file +The following environment variables can be changed in the `.env` file for various memory limits +1. Platform + - PLATFORM_JAVA_HEAP_MIN + - PLATFORM_JAVA_HEAP_MAX +2. Consensus node + - NETWORK_NODE_MEM_LIMIT +3. Mirror node - MIRROR_GRPC_MEM_LIMIT - memory limit for mirror node gRPC - MIRROR_IMPORTER_MEM_LIMIT - memory limit for mirror node importer - MIRROR_REST_MEM_LIMIT - memory limit for mirror node rest api - MIRROR_WEB3_MEM_LIMIT - memory limit for mirror node web3 -3. To change `application.properties`, `api-permission.properties` or `bootstrap.properties` properties, update the `APPLICATION_CONFIG_PATH` to the location of updated config folder in `.env` file +4. To change `application.properties`, `api-permission.properties` or `bootstrap.properties` properties, update the `APPLICATION_CONFIG_PATH` to the location of updated config folder in `.env` file **IMPORTANT :** Ensure to do `docker-compose down -v; git clean -xfd; git reset --hard` and then `docker-compose up -d` for the new changes to take any effect.