当前位置:   article > 正文

【Gitlab】服务器性能调优_gitlab 优化

gitlab 优化

安装之后操作Gitlab网页端时候会有些卡顿,可以修改配置来改善性能:

提前说明:我的机器配置如下
两个40线程的处理器 160G内存

# //处理器
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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

调整配置

修改配置文件sudo vim /etc/gitlab/gitlab.rb

# 设置数据库缓存
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'
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29

最后重新加载配置:

sudo gitlab-ctl reconfigure  
  • 1

重新访问Gitlab,加载很丝滑~

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/928901
推荐阅读
  

闽ICP备14008679号