Memory Ballast extension (deprecated)
Use the Memory Ballast extension to allow your applications to configure memory ballast for processing.
memory_ballast
extension is deprecated and has been removed starting in Collector version 0.97.0. If you’re using this extension, read on to learn how to update your configuration.memory_ballast
is no longer effective. You can now control garbage collection with a soft memory limit using the SPLUNK_MEMORY_TOTAL_MIB
env var, which is set to 90% of the total memory by default. For more information, see Environment variables.
Follow these steps to ensure your Collector instances work correctly:
-
If you haven’t customized
memory_ballast
, remove it from the configuration. -
If you have customized
memory_ballast
usingSPLUNK_BALLAST_SIZE_MIB
(orextensions::memory_ballast::size_mib config
), remove thememory_ballast
extension and use theGOMEMLIMIT
environment variable to set a custom soft memory limit:-
To increase frequency of garbage collection set
GOMEMLIMIT
to a higher value than the default 90% of total memory. -
To decrease frequency of garbage collection set
GOMEMLIMIT
to a lower value than the default 90% of total memory. -
For more information, see Go environment variables .
-
Get started
The Memory Ballast extension enables applications to configure memory ballast for processing.
Follow these steps to configure and activate the component:
-
Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform:
-
Configure the extension as described in the next section.
-
Restart the Collector.
Sample configuration
To activate the component, add memory_ballast
to the extensions
section of your configuration file:
extensions:
memory_ballast:
To complete the configuration, include the extension in the service
section of your configuration file:
service:
extensions: [memory_ballast]
You can configure the following settings for the extension:
-
size_mib
. The memory ballast size, in MiB.-
0
by default. -
Takes higher priority than
size_in_percentage
if both are specified at the same time.
-
-
size_in_percentage
. Sets the memory ballast based on the total memory in percentage.-
0
by default. -
The value can range from 1 to 100.
-
Supported in both containerized (Docker, Kubernetes) and physical host environments.
-
Configuration examples
This configuration uses 64 Mib of memory for the ballast:
extensions:
memory_ballast:
size_mib: 64
This configuration uses 20% of the total memory for the ballast:
extensions:
memory_ballast:
size_in_percentage: 20
Calculate the ballast size as a percentage
When size_in_percentage
is enabled, the value for ballast_size
is calculated as follows.
On the target host or container, check the value in memory.limit_in_bytes
to learn if there’s any memory limitation for the running Collector process. Memory files are stores in paths such as /sys/fs/cgroup/memory/memory.limit_in_bytes.
-
If
memory.limit_in_bytes
is a positive value other than9223372036854771712
(0x7FFFFFFFFFFFF000
), the value forballast_size
is calculated with the formulaballast_size
=size_in_percentage
*memory.limit_in_bytes
/ 100 -
If
memory.limit_in_bytes
is9223372036854771712
(0x7FFFFFFFFFFFF000
), no memory limit has been set for the Collector process or the running container in cgroup, and the value forballast_size
is calculated with the formulaballast_size
=size_in_percentage
*totalMemory
/ 100where
totalMemory
is calculated by github.com/shirou/gopsutil/v3/mem onmem.VirtualMemory().total
.
Settings
The following table shows the configuration options for the Memory Ballast extension:
included
https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/extension/memory_ballast.yaml
Troubleshooting
If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.
Available to Splunk Observability Cloud customers
-
Submit a case in the Splunk Support Portal.
-
Contact Splunk Support.
Available to prospective customers and free trial users
-
Ask a question and get answers through community support at Splunk Answers.
-
Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups.