1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/cluster-logging-logstore-limits.adoc
Satyajeet Munje cc94fd4ee0 OBSDOCS-693
2024-04-24 18:11:38 +00:00

82 lines
3.0 KiB
Plaintext

// Module included in the following assemblies:
//
// * observability/logging/cluster-logging-elasticsearch.adoc
:_mod-docs-content-type: PROCEDURE
[id="cluster-logging-logstore-limits_{context}"]
= Configuring CPU and memory requests for the log store
Each component specification allows for adjustments to both the CPU and memory requests.
You should not have to manually adjust these values as the OpenShift Elasticsearch
Operator sets values sufficient for your environment.
[NOTE]
====
In large-scale clusters, the default memory limit for the Elasticsearch proxy container might not be sufficient, causing the proxy container to be OOMKilled. If you experience this issue, increase the memory requests and limits for the Elasticsearch proxy.
====
Each Elasticsearch node can operate with a lower memory setting though this is *not* recommended for production deployments.
For production use, you should have no less than the default 16Gi allocated to each pod. Preferably you should allocate as much as possible, up to 64Gi per pod.
.Prerequisites
* The Red Hat OpenShift Logging and Elasticsearch Operators must be installed.
.Procedure
. Edit the `ClusterLogging` custom resource (CR) in the `openshift-logging` project:
+
[source,terminal]
----
$ oc edit ClusterLogging instance
----
+
[source,yaml]
----
apiVersion: "logging.openshift.io/v1"
kind: "ClusterLogging"
metadata:
name: "instance"
....
spec:
logStore:
type: "elasticsearch"
elasticsearch:<1>
resources:
limits: <2>
memory: "32Gi"
requests: <3>
cpu: "1"
memory: "16Gi"
proxy: <4>
resources:
limits:
memory: 100Mi
requests:
memory: 100Mi
----
<1> Specify the CPU and memory requests for Elasticsearch as needed. If you leave these values blank,
the OpenShift Elasticsearch Operator sets default values that should be sufficient for most deployments. The default values are `16Gi` for the memory request and `1` for the CPU request.
<2> The maximum amount of resources a pod can use.
<3> The minimum resources required to schedule a pod.
<4> Specify the CPU and memory requests for the Elasticsearch proxy as needed. If you leave these values blank, the OpenShift Elasticsearch Operator sets default values that are sufficient for most deployments. The default values are `256Mi` for the memory request and `100m` for the CPU request.
When adjusting the amount of Elasticsearch memory, the same value should be used for both `requests` and `limits`.
For example:
[source,yaml]
----
resources:
limits: <1>
memory: "32Gi"
requests: <2>
cpu: "8"
memory: "32Gi"
----
<1> The maximum amount of the resource.
<2> The minimum amount required.
Kubernetes generally adheres the node configuration and does not allow Elasticsearch to use the specified limits.
Setting the same value for the `requests` and `limits` ensures that Elasticsearch can use the memory you want, assuming the node has the memory available.