Done
Details
Assignee
Nurlan MoldomurovNurlan MoldomurovReporter
Roma NovikovRoma Novikov(Deactivated)Priority
MediumComponents
Story Points
4
Details
Details
Assignee
Nurlan Moldomurov
Nurlan MoldomurovReporter
Roma Novikov
Roma Novikov(Deactivated)Priority
Components
Story Points
4
Smart Checklist
Smart Checklist
Smart Checklist
Created May 21, 2021 at 10:34 AM
Updated March 6, 2024 at 2:42 AM
Resolved January 4, 2022 at 11:48 AM
The problem: vmagent uses quite a bit of memory.
200MB of memory used (VM is much higher) for something which just scrapes the data and pushed it over is kind of a lot.
Expectations: it would be natural for it to use similar memory as node_exporter/mysqld_exporter use as functionality is similar - they get data in one format and expose in another basically..
Note: The expectations can be changed if VMgent start collecting data locally
Details:
The following options can be used for reducing the memory usage for vmagent:
Passing `-streamParse` command-line flag to it. In this case it will read metrics from targets in a streaming manner. This allows saving RAM when a target exposes a big number of metrics. See https://docs.victoriametrics.com/vmagent.html#stream-parsing-mode Already done
Passing `-memory.allowedBytes=100MB` command-line flag to it. This will limit in-memory buffers vmagent can use. By default vmagent can use up to 60% of available memory on the host server (unless it is limited with cgroups).
Passing `GOMAXPROCS=1` environment variable to vmagent. This may reduce memory usage, since vmagent pre-allocates some in-memory buffers per available CPU core. By default it can use all the available CPU cores on the host server (unless it is limited with cgroups). GOMAXPROCS=1 limits available CPU cores to 1.
If these options won't help, then it would be great collecting memory profile from vmagent and investigating the source of high memory usage. See https://docs.victoriametrics.com/vmagent.html#profiling .
Also analyze new features of VM and open subtasks or new feature to implement them.