GithubHelp home page GithubHelp logo

Comments (3)

madler avatar madler commented on September 15, 2024

You can specify the number of threads using -p, so perhaps you can use the output of numactl to deduce the number of available cores and feed that to the command line option.

However I wonder what difference it makes. There is likely not much penalty in specifying more cores than you have, other than using more memory for the buffers in all the threads. You should test to see the difference between -p 7 and -p 32, or -p 100 for that matter. In fact, pigz invokes two more threads than requested (expect when using -p 1), one being the main thread and one being a thread to write the output. The n cores in -p n is only the number of cores for compression.

Of course, if you want the best performance, you don't want to specify fewer cores than you have, so the number of actual cores should always be safe.

from pigz.

MichaelReitsma avatar MichaelReitsma commented on September 15, 2024

Not being a unix expert in anyway i was wondering why it would be necessary, apart from this example, to specify the number of processors/cores it uses ? Doesn't unix have a multi-core load balancer or something ?
Or is it best to have one core free for other tasks ?
So if i have a 8 core system and pigz uses 2 cores for other purposes then i should specify a maximum of 5 with -p5?

Edit:
After some more testing i found the processing time to be different between -p8 and -p6 (or even -p7) on a 8 core system. This suggests that specifying 6 or 8 cores is not the same in terms of load. 6 cores should be the same snce pigz claimes an additional 2 for administration overhead.

from pigz.

madler avatar madler commented on September 15, 2024

@MichaelReitsma You don't need to specify the number of cores. By default pigz will set up twice as many compression threads as there are cores. This is done to have a high probability of keeping all of the cores busy. Other processes on the system will continue to get their fair share of time on the cores. Though their fair share will be less while pigz is trying to keep all the cores busy.

If you have a need to assure that there are some number of cores that pigz will not monopolize (not sure what that need would be), then I would use the number given to -p — not that number plus two. The other two threads are to take advantage of parallel input/output operations, not computation, so those two threads will not monopolize cores.

from pigz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.