【Gitlab】服务器性能调优

安装之后操作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,加载很丝滑~

相关推荐
Sinclair1 天前
简单几步,安卓手机秒变服务器,安装 CMS 程序
android·服务器
Rockbean2 天前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek
蝎子莱莱爱打怪2 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
茶杯梦轩2 天前
CompletableFuture 在 项目实战 中 创建异步任务 的核心优势及使用场景
服务器·后端·面试
海天鹰3 天前
【免费】PHP主机=域名+解析+主机
服务器
DianSan_ERP3 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
呉師傅3 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
不是二师兄的八戒3 天前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
芝士雪豹只抽瑞克五3 天前
Nginx 高性能Web服务器笔记
服务器·nginx
失重外太空啦3 天前
Tomcat
java·服务器·tomcat