gitlab 常见问题总结

1. webhook 请求次数过大造成服务崩溃

解决思路是gitlab自己持有prometheus metrics 指标,其中sidekiq 服务负责backend job 执行。可以监控web_hook 运行队列的长度来决定是否存在故障。

官网issue 

 

  1. 查看队列信息并手动清理到 web_hook 队列
  2. 找到问题触发项目的web_hook 停止对应事件推送 

 

2. webhook 历史过大无法删除

解决思路 先清理日志在删除 使用

gitlab-rails console

 

WebHookLog.where(web_hook_id: 877).each_slice(25) do |slice|
  slice.each(&:destroy)
end


WebHook.find(877).destroy

 

 

3. postgresql 链接池溢出

gitlab-rake remaining connection slots are reserved for non-replication superuser connections

#登陆数据库,默认是没有密码的
gitlab-psql -d gitlabhq_production
#当前总共正在使用的连接数
postgres=# select count(1) from pg_stat_activity;
#显示系统允许的最大连接数
postgres=# show max_connections;
#显示系统保留的用户数
postgres=# show superuser_reserved_connections ;

搬运自华为云文档🙏

 

posted @ 2021-09-02 17:21  萱乐庆foreverlove  阅读(260)  评论(0编辑  收藏  举报