From 205ad61b8c44ca0b7d79cd80cce7c1d5f5cb2726 Mon Sep 17 00:00:00 2001 From: Sas Swart Date: Fri, 14 Jan 2022 18:31:49 +0200 Subject: [PATCH] Docs: Update memory ballast documentation (#5106) * Add memory ballast * Add changelog entry * Add documentation Add additional information to Flag description * Ensure that ballast_bytes can be configured from config file Add documentation * Add Operational scalability documentation related to memory ballast * Restore config.ballast-bytes cli flag * Move config.ballast-bytes cli flag declaration * Update memory ballast documentation as per https://github.com/grafana/loki/pull/5081\#pullrequestreview-848460132 Co-authored-by: Owen Diehl --- docs/sources/configuration/_index.md | 2 +- docs/sources/operations/scalability.md | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/sources/configuration/_index.md b/docs/sources/configuration/_index.md index 8a3fc39f8b..78ab5af2ee 100644 --- a/docs/sources/configuration/_index.md +++ b/docs/sources/configuration/_index.md @@ -93,7 +93,7 @@ Pass the `-config.expand-env` flag at the command line to enable this way of set # if true. If false, the OrgID will always be set to "fake". [auth_enabled: | default = true] -# The amount of virtual memory to reserve as a ballast in order to optimise +# The amount of virtual memory in bytes to reserve as ballast in order to optimize # garbage collection. Larger ballasts result in fewer garbage collection passes, reducing CPU overhead at # the cost of heap size. The ballast will not consume physical memory, because it is never read from. # It will, however, distort metrics, because it is counted as live memory. diff --git a/docs/sources/operations/scalability.md b/docs/sources/operations/scalability.md index 86edc21ae0..bdebcc2dd4 100644 --- a/docs/sources/operations/scalability.md +++ b/docs/sources/operations/scalability.md @@ -23,7 +23,8 @@ It is not valid to start the querier with both a configured frontend and a sched The query scheduler process itself can be started via the `-target=query-scheduler` option of the Loki Docker image. For instance, `docker run grafana/loki:latest -config.file=/cortex/config/cortex.yaml -target=query-scheduler -server.http-listen-port=8009 -server.grpc-listen-port=9009` starts the query scheduler listening on ports `8009` and `9009`. -## Memory Ballast -In compute constrained environments, garbage collection can become a significant factor. This can be optimised, at the expense of memory consumption, by configuring a memory ballast using the `ballast_bytes` configuration option. +## Memory ballast -A larger memory ballast will mean that standard heap size volatility is less relatively significant, and therefore less likely to trigger garbage collection. This will result in lower compute overhead, but higher memory consumption, as the heap is cleaned less frequently. \ No newline at end of file +In compute-constrained environments, garbage collection can become a significant performance factor. Frequently-run garbage collection interferes with running the application by using CPU resources. The use of memory ballast can mitigate the issue. Memory ballast allocates extra, but unused virtual memory in order to inflate the quantity of live heap space. Garbage collection is triggered by the growth of heap space usage. The inflated quantity of heap space reduces the perceived growth, so garbage collection occurs less frequently. + +Configure memory ballast using the ballast_bytes configuration option.