From 2226780086524e62d96ed6518026135e89a83978 Mon Sep 17 00:00:00 2001 From: t3chn0m4g3 Date: Fri, 14 Jan 2022 18:08:55 +0000 Subject: [PATCH] Optimize RAM management for Elastic Stack. --- etc/compose/collector.yml | 6 ++++-- etc/compose/industrial.yml | 6 ++++-- etc/compose/log4j.yml | 6 ++++-- etc/compose/medical.yml | 6 ++++-- etc/compose/mini.yml | 6 ++++-- etc/compose/nextgen.yml | 6 ++++-- etc/compose/pot.yml | 2 +- etc/compose/standard.yml | 6 ++++-- 8 files changed, 29 insertions(+), 15 deletions(-) diff --git a/etc/compose/collector.yml b/etc/compose/collector.yml index 39dd4968..5226c35d 100644 --- a/etc/compose/collector.yml +++ b/etc/compose/collector.yml @@ -127,7 +127,7 @@ services: restart: always environment: - bootstrap.memory_lock=true -# - ES_JAVA_OPTS=-Xms2048m -Xmx2048m + - ES_JAVA_OPTS=-Xms2048m -Xmx2048m - ES_TMPDIR=/tmp cap_add: - IPC_LOCK @@ -138,7 +138,7 @@ services: nofile: soft: 65536 hard: 65536 -# mem_limit: 4g + mem_limit: 4g ports: - "127.0.0.1:64298:9200" image: "dtagdevsec/elasticsearch:2203" @@ -152,6 +152,7 @@ services: depends_on: elasticsearch: condition: service_healthy + mem_limit: 1g ports: - "127.0.0.1:64296:5601" image: "dtagdevsec/kibana:2203" @@ -167,6 +168,7 @@ services: condition: service_healthy env_file: - /opt/tpot/etc/compose/elk_environment + mem_limit: 2g image: "dtagdevsec/logstash:2203" volumes: - /data:/data diff --git a/etc/compose/industrial.yml b/etc/compose/industrial.yml index 146128b2..826abad6 100644 --- a/etc/compose/industrial.yml +++ b/etc/compose/industrial.yml @@ -334,7 +334,7 @@ services: restart: always environment: - bootstrap.memory_lock=true -# - ES_JAVA_OPTS=-Xms2048m -Xmx2048m + - ES_JAVA_OPTS=-Xms2048m -Xmx2048m - ES_TMPDIR=/tmp cap_add: - IPC_LOCK @@ -345,7 +345,7 @@ services: nofile: soft: 65536 hard: 65536 -# mem_limit: 4g + mem_limit: 4g ports: - "127.0.0.1:64298:9200" image: "dtagdevsec/elasticsearch:2203" @@ -359,6 +359,7 @@ services: depends_on: elasticsearch: condition: service_healthy + mem_limit: 1g ports: - "127.0.0.1:64296:5601" image: "dtagdevsec/kibana:2203" @@ -374,6 +375,7 @@ services: condition: service_healthy env_file: - /opt/tpot/etc/compose/elk_environment + mem_limit: 2g image: "dtagdevsec/logstash:2203" volumes: - /data:/data diff --git a/etc/compose/log4j.yml b/etc/compose/log4j.yml index 6fb8b9a5..0a43ac87 100644 --- a/etc/compose/log4j.yml +++ b/etc/compose/log4j.yml @@ -117,7 +117,7 @@ services: restart: always environment: - bootstrap.memory_lock=true -# - ES_JAVA_OPTS=-Xms2048m -Xmx2048m + - ES_JAVA_OPTS=-Xms2048m -Xmx2048m - ES_TMPDIR=/tmp cap_add: - IPC_LOCK @@ -128,7 +128,7 @@ services: nofile: soft: 65536 hard: 65536 -# mem_limit: 4g + mem_limit: 4g ports: - "127.0.0.1:64298:9200" image: "dtagdevsec/elasticsearch:2203" @@ -142,6 +142,7 @@ services: depends_on: elasticsearch: condition: service_healthy + mem_limit: 1g ports: - "127.0.0.1:64296:5601" image: "dtagdevsec/kibana:2203" @@ -157,6 +158,7 @@ services: condition: service_healthy env_file: - /opt/tpot/etc/compose/elk_environment + mem_limit: 2g image: "dtagdevsec/logstash:2203" volumes: - /data:/data diff --git a/etc/compose/medical.yml b/etc/compose/medical.yml index 1709076c..93594ead 100644 --- a/etc/compose/medical.yml +++ b/etc/compose/medical.yml @@ -111,7 +111,7 @@ services: restart: always environment: - bootstrap.memory_lock=true -# - ES_JAVA_OPTS=-Xms2048m -Xmx2048m + - ES_JAVA_OPTS=-Xms2048m -Xmx2048m - ES_TMPDIR=/tmp cap_add: - IPC_LOCK @@ -122,7 +122,7 @@ services: nofile: soft: 65536 hard: 65536 -# mem_limit: 4g + mem_limit: 4g ports: - "127.0.0.1:64298:9200" image: "dtagdevsec/elasticsearch:2203" @@ -136,6 +136,7 @@ services: depends_on: elasticsearch: condition: service_healthy + mem_limit: 1g ports: - "127.0.0.1:64296:5601" image: "dtagdevsec/kibana:2203" @@ -151,6 +152,7 @@ services: condition: service_healthy env_file: - /opt/tpot/etc/compose/elk_environment + mem_limit: 2g image: "dtagdevsec/logstash:2203" volumes: - /data:/data diff --git a/etc/compose/mini.yml b/etc/compose/mini.yml index d0a2e07f..08c183b3 100644 --- a/etc/compose/mini.yml +++ b/etc/compose/mini.yml @@ -136,7 +136,7 @@ services: restart: always environment: - bootstrap.memory_lock=true -# - ES_JAVA_OPTS=-Xms2048m -Xmx2048m + - ES_JAVA_OPTS=-Xms2048m -Xmx2048m - ES_TMPDIR=/tmp cap_add: - IPC_LOCK @@ -147,7 +147,7 @@ services: nofile: soft: 65536 hard: 65536 -# mem_limit: 4g + mem_limit: 4g ports: - "127.0.0.1:64298:9200" image: "dtagdevsec/elasticsearch:2203" @@ -161,6 +161,7 @@ services: depends_on: elasticsearch: condition: service_healthy + mem_limit: 1g ports: - "127.0.0.1:64296:5601" image: "dtagdevsec/kibana:2203" @@ -176,6 +177,7 @@ services: condition: service_healthy env_file: - /opt/tpot/etc/compose/elk_environment + mem_limit: 2g image: "dtagdevsec/logstash:2203" volumes: - /data:/data diff --git a/etc/compose/nextgen.yml b/etc/compose/nextgen.yml index 1f683bf8..233e5b75 100644 --- a/etc/compose/nextgen.yml +++ b/etc/compose/nextgen.yml @@ -497,7 +497,7 @@ services: restart: always environment: - bootstrap.memory_lock=true -# - ES_JAVA_OPTS=-Xms2048m -Xmx2048m + - ES_JAVA_OPTS=-Xms2048m -Xmx2048m - ES_TMPDIR=/tmp cap_add: - IPC_LOCK @@ -508,7 +508,7 @@ services: nofile: soft: 65536 hard: 65536 -# mem_limit: 4g + mem_limit: 4g ports: - "127.0.0.1:64298:9200" image: "dtagdevsec/elasticsearch:2203" @@ -522,6 +522,7 @@ services: depends_on: elasticsearch: condition: service_healthy + mem_limit: 1g ports: - "127.0.0.1:64296:5601" image: "dtagdevsec/kibana:2203" @@ -537,6 +538,7 @@ services: condition: service_healthy env_file: - /opt/tpot/etc/compose/elk_environment + mem_limit: 2g image: "dtagdevsec/logstash:2203" volumes: - /data:/data diff --git a/etc/compose/pot.yml b/etc/compose/pot.yml index 578b3504..8a792ccc 100644 --- a/etc/compose/pot.yml +++ b/etc/compose/pot.yml @@ -469,7 +469,6 @@ services: volumes: - /data/suricata/log:/var/log/suricata - ################## #### Tools ################## @@ -484,6 +483,7 @@ services: # - LS_JAVA_OPTS=-Xms2048m -Xmx2048m env_file: - /opt/tpot/etc/compose/elk_environment + mem_limit: 2g image: "dtagdevsec/logstash:2203" volumes: - /data:/data diff --git a/etc/compose/standard.yml b/etc/compose/standard.yml index 694920ce..11cc583d 100644 --- a/etc/compose/standard.yml +++ b/etc/compose/standard.yml @@ -510,7 +510,7 @@ services: restart: always environment: - bootstrap.memory_lock=true -# - ES_JAVA_OPTS=-Xms2048m -Xmx2048m + - ES_JAVA_OPTS=-Xms2048m -Xmx2048m - ES_TMPDIR=/tmp cap_add: - IPC_LOCK @@ -521,7 +521,7 @@ services: nofile: soft: 65536 hard: 65536 -# mem_limit: 4g + mem_limit: 4g ports: - "127.0.0.1:64298:9200" image: "dtagdevsec/elasticsearch:2203" @@ -535,6 +535,7 @@ services: depends_on: elasticsearch: condition: service_healthy + mem_limit: 1g ports: - "127.0.0.1:64296:5601" image: "dtagdevsec/kibana:2203" @@ -550,6 +551,7 @@ services: condition: service_healthy env_file: - /opt/tpot/etc/compose/elk_environment + mem_limit: 2g image: "dtagdevsec/logstash:2203" volumes: - /data:/data