Gitlab超时/初始页面加载缓慢

我使用Repository中的软件包在Debian上运行Gitlab。 大多数情况下,Gitlab的运行速度非常快,但是在更长的空闲时间之后,Gitlab非常慢甚至超时(错误502)。 有一次,我也有一个远程git访问超时(无法重现问题 – 在内部API超时)。

在我的设置中,Debian机器位于另一个nginx代理的后面,它也提供其他一些服务。 我做了gitlab-cli检查,一切似乎都很好。

在我的反向代理的错误日志中,我只能看到连接超时:

[error] 8643#0: *4139 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 10.1.1.10, server: gitlab.mydomain.tld, request: "GET / HTTP/1.1", upstream: "http://{SERVER-IP}:80/", host: "gitlab.mydomain.tld" 

我可以在我的unicorn_stderr.log中看到一些错误

 E, [2016-03-30T19:40:20.183991 #783] ERROR -- : worker=1 PID:16798 timeout (61s > 60s), killing E, [2016-03-30T19:40:20.194969 #783] ERROR -- : reaped #<Process::Status: pid 16798 SIGKILL (signal 9)> worker=1 I, [2016-03-30T19:40:20.197554 #16871] INFO -- : worker=1 spawned pid=16871 I, [2016-03-30T19:40:20.197909 #16871] INFO -- : worker=1 ready E, [2016-03-30T20:08:42.911429 #783] ERROR -- : worker=0 PID:16866 timeout (61s > 60s), killing E, [2016-03-30T20:08:43.191151 #783] ERROR -- : reaped #<Process::Status: pid 16866 SIGKILL (signal 9)> worker=0 I, [2016-03-30T20:08:43.758363 #18728] INFO -- : worker=0 spawned pid=18728 I, [2016-03-30T20:08:44.108244 #18728] INFO -- : worker=0 ready 

我有点好奇的是,在使用gitlab交付的nginx的日志中没有错误。

更多系统信息:

 #sudo gitlab-rake gitlab:env:info System information System: Debian 8.3 Current User: git Using RVM: no Ruby Version: 2.1.8p440 Gem Version: 2.5.1 Bundler Version:1.10.6 Rake Version: 10.5.0 Sidekiq Version:4.0.1 GitLab information Version: 8.5.0 Revision: a513e09 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://gitlab.mydomain.tld HTTP Clone URL: http://gitlab.mydomain.tld/some-group/some-project.git SSH Clone URL: git@gitlab.mydomain.tld:some-group/some-project.git Using LDAP: no Using Omniauth: no GitLab Shell Version: 2.6.10 Repositories: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/ Git: /opt/gitlab/embedded/bin/git 

编辑:

“外部”反向代理上的我的nginxconfiguration如下所示:

 server { listen 443; ssl on; server_name gitlab.mydomain.tld; access_log /var/log/nginx/gitlab.mydomain.tld.access.log; error_log /var/log/nginx/gitlab.mydomain.tld.error.log; ssl_certificate /etc/nginx/ssl/gitlab.mydomain.tld_unified.crt; ssl_certificate_key /etc/nginx/ssl/mydomain.tld.key; location / { proxy_pass http://gitlab:80; proxy_redirect default; proxy_set_header Host $http_host; proxy_set_header X_FORWARDED_PROTO "https"; satisfy any; } } 

EDIT2:

我考虑了build议的答案,也考虑了这个来源: https : //github.com/gitlabhq/gitlabhq/blob/master/doc/install/requirements.md

我现在给VM分配了2GB的内存,还增加了一个额外的独angular兽工作者。

EDIT3:

这个问题似乎可以通过增加更多的记忆和使用3名独angular兽工人来解决。

一月,

我有一个类似的设置,虽然我们的盒子是专用于GITlab。 不知道你的服务器的规格(GITLAB喜欢内存)和那个盒子上的负载,我会建议以下诊断:

  1. 你的上游nginx使用与gitlab nginx配置相同的参数吗? 他们调整了一些东西,包括超时。
  2. 什么样的要求导致超时? 某些操作(如生成差异)可能需要一些时间才能呈现。
  3. 如果您通过SSH运行请求,您是否也遇到超时问题?
  4. 你在/ var / log中检查过全局日志吗?

仅供参考:我不得不放大我的小GitLab安装有4GB内存不扔OOM错误

现在我想,我最好还是带着Gogs或其他选择。