gpt4 book ai didi

git - Gitlab CE 的高内存使用率

转载 作者:IT王子 更新时间:2023-10-29 01:03:47 29 4
gpt4 key购买 nike

看看这张显示 gitlab ce 内存消耗的图片。 gitlab ce memory consumption

我真的不需要所有这些 worker、sidekiq 或 unicorn 或所有这些守护进程。这是空闲的。我的意思是,我安装它是为了管理 1 个项目,大概有 4 个人,我不需要所有那些守护进程。有什么办法可以减少这个吗?

最佳答案

我也遇到了 gitlab 内存消耗高的问题。所以我运行了 linux 工具 htop

在我的案例中,我发现 postgresl 服务使用了大部分内存。

随着 postgres 服务运行,使用了 14.5G 的 16G enter image description here

我一个接一个地停止了 gitlab 服务,发现当我停止 postgres 时,释放了很多内存。

enter image description here

你可以试试

gitlab-ctl stop postgresql

并再次启动服务

gitlab-ctl start postgresql

最后我在 /etc/gitlab/gitlab.rb 中遇到了以下配置

##! **recommend value is 1/4 of total RAM, up to 14GB.**
# postgresql['shared_buffers'] = "256MB"

我只是通过删除注释 # 将共享缓冲区设置为 256MB,因为 256MB 对我来说足够了。

postgresql['shared_buffers'] = "256MB"

并执行gitlab-ctl reconfigure。 gitlab-ctl 重新启动受影响的服务,现在内存消耗非常适中。 enter image description here

希望这对其他人有帮助。

关于git - Gitlab CE 的高内存使用率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36122421/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com