高并发访问gogs出现500错误

请先搜索确保没有重复发帖。

Gogs 版本:0.11.86.0130
系统类型及版本:
数据库:sqlite3
问题描述:
高并发访问vm中部署的gogs,返回500,具体异常如下:

[ERROR] […tes/repo/download.go:58 SingleDownload()] ServeBlob: short write
[ERROR] […g/context/context.go:191 ServerError()] GetBranches: pipe2: too many open files
[ERROR] […g/context/context.go:191 ServerError()] GetTags ‘/usr1/gogs-repositories/root/gradle.git’: open /dev/null: too many open files
[ERROR] […/pkg/context/repo.go:341 func1()] GetBranchCommit: fork/exec /usr/bin/git: too many open files
[ERROR] […tes/repo/download.go:58 SingleDownload()] ServeBlob: short write
[ERROR] […g/context/context.go:191 ServerError()] GetTags ‘/usr1/gogs-repositories/root/gradle.git’: pipe2: too many open files
[ERROR] […g/context/context.go:191 ServerError()] GetTags ‘/usr1/gogs-repositories/root/gradle.git’: fork/exec /usr/bin/git: too many open files
[ERROR] […tes/repo/download.go:58 SingleDownload()] ServeBlob: short write
[ERROR] […tes/repo/download.go:58 SingleDownload()] ServeBlob: short write
[ERROR] […g/context/context.go:191 ServerError()] GetBranches: fork/exec /usr/bin/git: too many open files
[ERROR] […tes/repo/download.go:58 SingleDownload()] ServeBlob: short write

如果提交 Bug,请重试在 https://try.gogs.io ;若不能重现,请先升级到最新版。

请不要发一堆没用的充满歧义的描述。

你的 ulimit -n 输出是多少(用启动 Gogs 的环境执行)?