Skip to content
代码片段 群组 项目
提交 0d489a4c 编辑于 作者: Matthias Kaeppler's avatar Matthias Kaeppler
浏览文件

Set GOGC for gitlab-metrics-exporter

This can reduce memory at the expense of higher
latencies.

Changelog: changed
上级 dfebf388
No related branches found
No related tags found
无相关合并请求
......@@ -43,6 +43,7 @@ def spawn(target, metrics_dir:, **options)
path = options[:path]&.then { |p| Pathname.new(p) } || Pathname.new('')
cmd = path.join('gitlab-metrics-exporter').to_path
env = {
'GOGC' => '10', # Set Go GC heap goal to 10% to curb memory growth.
'GME_MMAP_METRICS_DIR' => metrics_dir.to_s,
'GME_PROBES' => 'self,mmap',
'GME_SERVER_HOST' => settings['address'],
......
......@@ -4,7 +4,7 @@
require_relative '../../metrics_server/metrics_server'
RSpec.describe MetricsServer do # rubocop:disable RSpec/FilePath
RSpec.describe MetricsServer, feature_category: :application_performance do # rubocop:disable RSpec/FilePath
let(:prometheus_config) { ::Prometheus::Client.configuration }
let(:metrics_dir) { Dir.mktmpdir }
......@@ -118,6 +118,7 @@
let(:expected_port) { target == 'puma' ? '8083' : '8082' }
let(:expected_env) do
{
'GOGC' => '10',
'GME_MMAP_METRICS_DIR' => metrics_dir,
'GME_PROBES' => 'self,mmap',
'GME_SERVER_HOST' => 'localhost',
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册