Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 593914 - Too many open files when using --jobs with emerge -avu --deep world
Summary: Too many open files when using --jobs with emerge -avu --deep world
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 184128
  Show dependency tree
 
Reported: 2016-09-16 00:47 UTC by Simon-Pierre Dubé
Modified: 2022-10-20 02:43 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Portage error message (portage error,5.66 KB, text/plain)
2016-09-16 00:47 UTC, Simon-Pierre Dubé
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon-Pierre Dubé 2016-09-16 00:47:10 UTC
Created attachment 445876 [details]
Portage error message

I tried using --jobs to make the emerge -avu --deep world" faster by paralleling the jobs. But portage seem to open too many files to be opened in same time while calculating dependencies, probably because of the large number of dependencies. 

As good measure, i tried it without --jobs, and it were able to calculate the dependencies without any issues. Then when i tried again with --jobs, same issue occurred.

As a workaround i just launched emerge -avu --deep world, then began the compilation, terminated it with Ctrl+C, and launched emerge --resume --jobs.

Is it because --jobs makes portage also calculate dependencies in parallel? There would be some way to limit it to have a safer amount of asynchronous file opening tasks? 

It's not the first time it's happening to me, but first time i am reporting it.

Thank you!
Comment 1 Mike Gilbert gentoo-dev 2016-09-16 01:50:53 UTC
What do you have configured for the maximum number of open files?

See ulimit -n and /etc/security/limits.conf.
Comment 2 Zac Medico gentoo-dev 2016-09-16 02:11:37 UTC
This behavior is expected if you use --jobs without a limit, and without --load-average (and you don't have an extremely large limit for open files).
Comment 3 Zac Medico gentoo-dev 2016-09-16 02:15:31 UTC
(In reply to Simon-Pierre Dubé from comment #0)
> Is it because --jobs makes portage also calculate dependencies in parallel?

Well, it's --dynamic-deps (enabled by default) which it triggering something similar to the emerge --regen behavior observed in bug 462910.

> There would be some way to limit it to have a safer amount of asynchronous
> file opening tasks? 

Usually, people use --jobs with an integer limit, and --load-average is another way to limit it.
Comment 4 Simon-Pierre Dubé 2016-09-16 04:57:26 UTC
(In reply to Mike Gilbert from comment #1)
> What do you have configured for the maximum number of open files?
> 
> See ulimit -n and /etc/security/limits.conf.

My ulimit -n is 1024. Didn't know of that feature. I will get it higher.


(In reply to Zac Medico from comment #2)
> This behavior is expected if you use --jobs without a limit, and without
> --load-average (and you don't have an extremely large limit for open files).

As i am using DistCC, that's mainly why i didn't want to use --jobs with a limit, as the 42 cores can take a lot of them and i like to see a lot of very small packages checked in same time, then compiled. I went for a MAKEOPTS="-j85 -l4" and i limited the numbers of DistCC job on localhost to be only 3 cores (on 4), making sure some resources will be left to distribute DistCC jobs and other stuff running.  

So if the ulimit still cause problem at 2048, i will try to reduce to -l3 or -l2.

Thanks for explaining, it's appreciated.