From 7760edf1411b7a38b3fb3d532d2078dbfdd30d23 Mon Sep 17 00:00:00 2001 From: Jan Jungnickel Date: Wed, 17 Jan 2018 15:03:07 +0100 Subject: [PATCH 1/2] Set `PROCESSORS` accordingly This change will set `PROCESSORS` to the actual number of available CPUs to the Container, allowing ES to properly adjust thread pool sizes. --- README.md | 2 ++ es-client.yaml | 4 ++++ es-data.yaml | 7 +++++++ es-master.yaml | 4 ++++ stateful/es-data-stateful.yaml | 7 +++++++ 5 files changed, 24 insertions(+) diff --git a/README.md b/README.md index 6aafe23..3fbe68d 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ One can change this in the deployment descriptors available in this repository. * The [stateful](stateful) directory contains an example which deploys the data pods as a `StatefulSet`. These use a `volumeClaimTemplates` to provision persistent storage for each pod. +* By default, `PROCESSORS` is set to `1`. This may not be enough for some deployments, especially at startup time. Adjust `resources.limits.cpu` and/or `livenessProbe` accordingly if required. Note that `resources.limits.cpu` must be an integer. + ## Pre-requisites diff --git a/es-client.yaml b/es-client.yaml index 55cbda4..701a51b 100644 --- a/es-client.yaml +++ b/es-client.yaml @@ -46,6 +46,10 @@ spec: value: -Xms256m -Xmx256m - name: NETWORK_HOST value: _site_,_lo_ + - name: PROCESSORS + valueFrom: + resourceFieldRef: + resource: limits.cpu ports: - containerPort: 9200 name: http diff --git a/es-data.yaml b/es-data.yaml index 30a3303..c017cab 100644 --- a/es-data.yaml +++ b/es-data.yaml @@ -44,6 +44,13 @@ spec: value: "false" - name: ES_JAVA_OPTS value: -Xms256m -Xmx256m + - name: PROCESSORS + valueFrom: + resourceFieldRef: + resource: limits.cpu + resources: + limits: + cpu: 1 ports: - containerPort: 9300 name: transport diff --git a/es-master.yaml b/es-master.yaml index 477455b..13b1429 100644 --- a/es-master.yaml +++ b/es-master.yaml @@ -48,6 +48,10 @@ spec: value: "false" - name: ES_JAVA_OPTS value: -Xms256m -Xmx256m + - name: PROCESSORS + valueFrom: + resourceFieldRef: + resource: limits.cpu ports: - containerPort: 9300 name: transport diff --git a/stateful/es-data-stateful.yaml b/stateful/es-data-stateful.yaml index e8be3d1..509a4f8 100644 --- a/stateful/es-data-stateful.yaml +++ b/stateful/es-data-stateful.yaml @@ -45,6 +45,13 @@ spec: value: "false" - name: ES_JAVA_OPTS value: -Xms256m -Xmx256m + - name: PROCESSORS + valueFrom: + resourceFieldRef: + resource: limits.cpu + resources: + limits: + cpu: 1 ports: - containerPort: 9300 name: transport From 155b2d103a0ff77520357be48d0acbab835487fc Mon Sep 17 00:00:00 2001 From: Jan Jungnickel Date: Wed, 17 Jan 2018 15:31:36 +0100 Subject: [PATCH 2/2] Default resources for client/master, too --- es-client.yaml | 3 +++ es-master.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/es-client.yaml b/es-client.yaml index 701a51b..7ef47cb 100644 --- a/es-client.yaml +++ b/es-client.yaml @@ -50,6 +50,9 @@ spec: valueFrom: resourceFieldRef: resource: limits.cpu + resources: + limits: + cpu: 1 ports: - containerPort: 9200 name: http diff --git a/es-master.yaml b/es-master.yaml index 13b1429..f0ae35d 100644 --- a/es-master.yaml +++ b/es-master.yaml @@ -52,6 +52,9 @@ spec: valueFrom: resourceFieldRef: resource: limits.cpu + resources: + limits: + cpu: 1 ports: - containerPort: 9300 name: transport