安装之后操作Gitlab网页端时候会有些卡顿,可以修改配置来改善性能:
提前说明:我的机器配置如下
两个40线程的处理器 160G内存
bash
# //处理器
CPU(s): 40
On-line CPU(s) list: 0-39
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz
CPU family: 6
Model: 79
Thread(s) per core: 2
Core(s) per socket: 10
Socket(s): 2
# //内存条
Memory block size: 2G
Total online memory: 160G
调整配置
修改配置文件sudo vim /etc/gitlab/gitlab.rb
bash
# 设置数据库缓存
postgresql['shared_buffers'] = "4GB"
# 设置数据库并发数
postgresql['max_worker_processes'] = 1
# 设置puma 、nginx进程数
puma['worker_processes'] = 8
nginx['worker_processes'] = 2
# 设置sidekiq并发数
sidekiq['concurrency'] = 1
sidekiq['max_concurrency'] = 1
# 禁用监控
prometheus_monitoring['enable'] = false
# 关闭一些监控和性能基准相关的功能
prometheus['enable'] = false
#prometheus_monitoring['enable'] = false
alertmanager['enable'] = false
node_exporter['enable'] = false
redis_exporter['enable'] = false
postgres_exporter['enable'] = false
pgbouncer_exporter['enable'] = false
gitlab_exporter['enable'] = false
grafana['enable'] = false
sidekiq['metrics_enabled'] = false
# 设置gitlab_rails组件的内存消耗
gitlab_rails['env'] = {
'MALLOC_CONF' => 'dirty_decay_ms:250,muzzy_decay_ms:250'
}
最后重新加载配置:
bash
sudo gitlab-ctl reconfigure
重新访问Gitlab,加载很丝滑~