Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS thread limit reached while compiling from source #2017

Closed
2 of 7 tasks
xoxys opened this issue Jun 20, 2017 · 9 comments
Closed
2 of 7 tasks

OS thread limit reached while compiling from source #2017

xoxys opened this issue Jun 20, 2017 · 9 comments
Labels
issue/stale topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile

Comments

@xoxys
Copy link
Contributor

xoxys commented Jun 20, 2017

  • 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?

@xoxys xoxys changed the title OS thread limit reached OS thread limit reached while compiling from source Jun 20, 2017
@lafriks
Copy link
Member

lafriks commented Jun 20, 2017

use EXTRA_GOFLAGS="-j2" make generate build

@xoxys
Copy link
Contributor Author

xoxys commented Jun 20, 2017

I will give it a try thanks :)

@xoxys
Copy link
Contributor Author

xoxys commented Jun 20, 2017

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?

@lafriks
Copy link
Member

lafriks commented Jun 20, 2017

just add -j1 in this line then https://github.com/go-gitea/gitea/blob/master/Makefile#L23

@xoxys
Copy link
Contributor Author

xoxys commented Jun 20, 2017

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

@lafriks
Copy link
Member

lafriks commented Jun 20, 2017

yes, it will be in 1.2.0 when it is released

@xoxys
Copy link
Contributor Author

xoxys commented Jun 20, 2017

Sounds good, thanks for clarification.

@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Jun 20, 2017
@xoxys
Copy link
Contributor Author

xoxys commented Nov 8, 2017

-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?

@lunny lunny mentioned this issue May 6, 2018
20 tasks
@stale
Copy link

stale bot commented Feb 11, 2019

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.

@stale stale bot added the issue/stale label Feb 11, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/stale topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

No branches or pull requests

4 participants