背景

团队代码托管平台由native Git迁移到Gitlab CE平台,支持Group和Project分级管理,支持HTTP和GIT连接,可视化Event View,一切看起来很美

但是,git clone测试,却暴露了问题。

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree clone http://192.168.30.11/WiCourt/uwb-data-receiver.git /Users/qipolin/uwb-data-receiver

Cloning into '/Users/qipolin/uwb-data-receiver'..

error: RPC failed; result=18, HTTP code = 20

fatal: The remote end hung up unexpectedl

Completed with errors, see abov

`

## 分析

错误代码不难解读,由于RPC通讯错误,导致的远程通讯中断。联想到该项目文件体积较大,推断问题根源应该是系统响应超时。

## 解决

查找Gitlab配置文件中,超时(timeout)相关的参数值

`# commit read timeou

# gitlab_rails['git_timeout'] = 1

gitlab_rails['git_timeout'] = 600

# nginx timeou

# nginx['keepalive_timeout'] = 6

nginx['keepalive_timeout'] = 300

# unicorn timeou

# unicorn['worker_timeout'] = 6

unicorn['worker_timeout'] = 300

根据实际网络传输时间,来调整以上参数。调整指标timeout > clone time。