go-gitea/gitea

OS thread limit reached while compiling from source

xoxys opened this issue · 9 comments

xoxys commented
  • Gitea version (or commit ref): 1.1.2
  • Git version: Not relevant
  • Operating system: CentOS 6
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

I use gitea on a shared hoster environment and compiling gitea from source. threads-per-user are limited to 300. Sometimes i got following error while make build for multiple modules:

runtime: failed to create new OS thread (have 7 already; errno=11)
runtime: may need to increase max user processes (ulimit -u)
fatal error: newosproc

I try to limit the threads by make with

make generate build -j2 

but the result is the same. Is it possible to limit threads/processes while compiling?

use EXTRA_GOFLAGS="-j2" make generate build

xoxys commented

I will give it a try thanks :)

xoxys commented

Seems not to work. I try TAGS="bindata" EXTRA_GOFLAGS="-j1" make generate build but sometimes i get the same error:

runtime: failed to create new OS thread (have 14 already; errno=11)
runtime: may need to increase max user processes (ulimit -u)
fatal error: newosproc

Otherwise i can see the line

go build -i -v -tags 'bindata' -ldflags '-s -w -X "main.Version=1.1.2" -X "main.Tags=bindata"' -o gitea

TAGS are applied to the go build but -j1 is missing. Is it normal?

xoxys commented

Ok Makefile included in 1.1.2 not use GOFLAGS and EXTRA_GOFLAGS. WIll this changes merged to next releases?

yes, it will be in 1.2.0 when it is released

xoxys commented

Sounds good, thanks for clarification.

xoxys commented

-j is no legal option for go build :( Luckily you can use GOMAXPROCS=2 to limit the os threads :) Maybe you want add this to the build documentation?

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.