Nginx 502 Gitlab的响应时间太长

Nginx 502 Gitlab的响应时间太长,nginx,gitlab,connection-timeout,gitlab-omnibus,Nginx,Gitlab,Connection Timeout,Gitlab Omnibus,在进行gitlab备份之后,gitlab每天都会抛出502错误。 我看到了nginx日志,但没有找到那么多信息 在gitlab ctl重启后它再次开始工作 系统配置: 操作系统:Ubuntu 16.04 LTS 4 GB内存 200 GB磁盘空间 谁能给它一个永久的解决办法。经过长时间的搜索,我对它有所了解。在进行备份后,我的gitlab工作马变得非常理想,而gitlab.socket正在拒绝连接。作为临时解决方案,我安装了一个新的cron作业,用于在完成gitlab backup cronj

在进行gitlab备份之后,gitlab每天都会抛出502错误。 我看到了nginx日志,但没有找到那么多信息

gitlab ctl重启后
它再次开始工作

系统配置: 操作系统:Ubuntu 16.04 LTS 4 GB内存 200 GB磁盘空间


谁能给它一个永久的解决办法。

经过长时间的搜索,我对它有所了解。在进行备份后,我的
gitlab工作马
变得非常理想,而
gitlab.socket
正在拒绝连接。作为临时解决方案,我安装了一个新的cron作业,用于在完成gitlab backup cronjob后重新启动gitlab服务。

它很可能耗尽共享内存。每次备份后都会出现502错误

要使用
gitlab ctl tail检查它

它将显示如下内容:

2019-04-12_12:37:17.27154 FATAL:  could not map anonymous shared memory: Cannot allocate memory
2019-04-12_12:37:17.27157 HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory, swap space, or huge pages. To reduce the request size (currently 4345470976 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
2019-04-12_12:37:17.27171 LOG:  database system is shut down
然后用
free-m
检查它,这表明没有可用的共享内存

             total       used       free     shared    buffers     cached
Mem:         16081      13715       2365          0        104        753
-/+ buffers/cache:      12857       3223
然后,您需要检查是否有一些进程占用了太多的共享内存,或者有太多的zomibe进程,然后使用类似于
ps-aef | grep ffmpeg | awk'{print$2}| xargs kill 9的命令杀死它

free-h
检查一下,现在大约有
112M
共享内存

             total       used       free     shared    buffers     cached
Mem:           15G       4.4G        11G       112M        46M       416M
-/+ buffers/cache:       3.9G        11G
Swap:           0B         0B         0B
最后,用gitlab ctl restart重新启动gitlab,在gitlab启动后,502就消失了