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

Run with min 1 cpu core left to the user #111

Closed
davsclaus opened this issue Oct 20, 2020 · 4 comments
Closed

Run with min 1 cpu core left to the user #111

davsclaus opened this issue Oct 20, 2020 · 4 comments
Milestone

Comments

@davsclaus
Copy link

If you have 8 cores on a computer, then mvnd will utilize them. However if you work on other things then your computer can be a bit sluggish if mvnd is heavy building.

It would be good to tell mvnd to only use max cpu - 1 so I have 1 for my self.

@ppalaga
Copy link
Contributor

ppalaga commented Oct 20, 2020

Yes, mvnd runs the daemon with -T1C by default, but you can pass any any other -T if you like, see https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3

If you want to make it permanent, you could alias mvnd in your .bashrc, something like the following:

# Mac
alias mvnd="mvnd -T$(($(sysctl -n hw.ncpu) - 1))"

# Linux 
alias mvnd="mvnd -T$(($(nproc --all) - 1))"

I am fine with the current default. What do others think?

@davsclaus
Copy link
Author

Okay whatever mvnd does by default does not feel like it leave any cpu resources left for me. I cant hardly browse my mail on in a web browser because cpu is 98-100% when you for example does a full rebuild of Apache Camel - runs for 20 min+.
And the parallel builds goes up to 8, and I have 8 cores.

So maybe make it run with -2 core.

And maybe make that -T option configureable in your general configuration file. Then I can hardcode it to 6.

@gnodet
Copy link
Contributor

gnodet commented Oct 20, 2020 via email

@famod
Copy link
Contributor

famod commented Oct 20, 2020

And maybe make that -T option configureable in your general configuration file.

👍

ppalaga added a commit that referenced this issue Oct 21, 2020
Leave 1 processor unused on the daemon by default, fixes #111
ppalaga added a commit to ppalaga/mvnd that referenced this issue Oct 21, 2020
ppalaga added a commit to ppalaga/mvnd that referenced this issue Oct 21, 2020
@ppalaga ppalaga added this to the 0.0.9 milestone Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants