Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
[logstash] increase pod memory resources
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlrt committed Nov 13, 2019
1 parent 7eb71d8 commit 42c5cfb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion logstash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ helm install --name logstash elastic/logstash --set imageTag=7.4.1
| `priorityClassName` | The [name of the PriorityClass](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass). No default is supplied as the PriorityClass must be created first. | `""` |
| `readinessProbe` | Configuration fields for the [readinessProbe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/) | `failureThreshold: 3`<br>`initialDelaySeconds: 30`<br>`periodSeconds: 10`<br>`successThreshold: 3`<br>`timeoutSeconds: 5` |
| `replicas` | Kubernetes replica count for the statefulset (i.e. how many pods) | `1` |
| `resources` | Allows you to set the [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) for the statefulset | `requests.cpu: 100m`<br>`requests.memory: 1280Mi`<br>`limits.cpu: 1000m`<br>`limits.memory: 1280Mi` |
| `resources` | Allows you to set the [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) for the statefulset | `requests.cpu: 100m`<br>`requests.memory: 1536Mi`<br>`limits.cpu: 1000m`<br>`limits.memory: 1536Mi` |
| `schedulerName` | Name of the [alternate scheduler](https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/#specify-schedulers-for-pods) | `""` |
| `secretMounts` | Allows you easily mount a secret as a file inside the statefulset. Useful for mounting certificates and other secrets. See [values.yaml](./values.yaml) for an example | `[]` |
| `securityContext` | Allows you to set the [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) for the container | `capabilities.drop:[ALL]`<br>`runAsNonRoot: true`<br>`runAsUser: 1000` |
Expand Down
4 changes: 2 additions & 2 deletions logstash/tests/logstash_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ def test_defaults():
assert c['resources'] == {
'requests': {
'cpu': '100m',
'memory': '1280Mi'
'memory': '1536Mi'
},
'limits': {
'cpu': '1000m',
'memory': '1280Mi'
'memory': '1536Mi'
}
}

Expand Down
4 changes: 2 additions & 2 deletions logstash/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ logstashJavaOpts: "-Xmx1g -Xms1g"
resources:
requests:
cpu: "100m"
memory: "1280Mi"
memory: "1536Mi"
limits:
cpu: "1000m"
memory: "1280Mi"
memory: "1536Mi"

volumeClaimTemplate:
accessModes: [ "ReadWriteOnce" ]
Expand Down

2 comments on commit 42c5cfb

@adrianlzt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jmlrt, why 1536Mi and not 1280Mi or 2Gi?

The doc does not give any hints to cofigure memory limits for containers.

Elasticsearch does:

Elasticsearch uses off-heap buffers for efficient network communication, relies on the operating system’s filesystem cache for efficient access to files, and the JVM itself requires some memory too. It is normal to observe the Elasticsearch process using more memory than the limit configured with the Xmx setting.

@jmlrt
Copy link
Member Author

@jmlrt jmlrt commented on 42c5cfb Jan 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @adrianlzt, Logstash Java heap is set to 1Gb in values.yaml:

logstashJavaOpts: "-Xmx1g -Xms1g"

If I remember right I think that during my tests I had some OOM errors and adding 256Mb to the container fixed these errors.

Of courses these values are working for simple tests and should be tuned according to your own usage.

Please sign in to comment.