distr1 / distri

a Linux distribution to research fast package management
https://distr1.org
Other
536 stars 26 forks source link

buildc.go: `make -j8` might not be a sane default #38

Closed maikf closed 4 years ago

maikf commented 5 years ago

https://github.com/distr1/distri/blob/c7d304084c0b55b92f96b99d01080e1bbe53890b/cmd/distri/buildc.go#L58

I'm less concerned about optimal cpu usage here, but, since most(?) compilers use an unbounded amount of memory, about eating up all available memory on resource constrained machines like VPSes. This might not be a problem with plain C, but C++ might be a different story.

Yes, that's largely speculation, but I think the only sane-by-default option would be -j1 and let the user decide on the amount of jobs, via a command line flag, environment variable, or config file.

I don't know whether it would be overkill to have, besides the proposed generic flag (let's call it distri_default_jobs for the sake of discussion), more specific distri_build{c, …}_jobs flags which inherit their settings from the default, if not set explicitly.

stapelberg commented 5 years ago

Yeah, overriding the parallelism level would indeed be good.

I think the default should remain at -j8, though. No need to be overly conservative. distri primarily needs to work well on hardware I use, and -j8 works well on all those machines.

maikf commented 5 years ago

Convenience is a fair point. What kind of system requirements do you shoot for? I think RAM is the only relevant bit here, correct? Maybe that should be mentioned in the build instructions so others don't trip over that because have misconceptions about on what kind of machine they are expected to have or what you are willing to "support".

stapelberg commented 5 years ago

I haven’t measured build requirements yet. Anecdotally, a build (or batch build, i.e. many packages at the same time) never failed because of too little RAM, but I have 64G in this machine.

stapelberg commented 4 years ago

fixed with commit 850bd3ef2a90ccd3dcded118e95b85816a8a9f3c