Comments (3)
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.
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.
@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)
- pigz decompress performance drops when overwriting file HOT 2
- del
- 2.7 tests: undefined reference to `COMB' with NOTHREAD HOT 1
- Indeterministic results HOT 2
- Errors in test suite when running with UBSAN HOT 5
- Zipping a directory issue. HOT 5
- `make tests` errors out with version 2.7 HOT 2
- pigz errors out with zlib-1.3 ("zlib version less than 1.2.3") HOT 7
- does pigz have public API for C? HOT 1
- Allow CFLAGS and LDFLAGS from environnement HOT 9
- pigz: can't destroy locked resource (pigz.c:2015:mutex_destroy) pigz: abort: internal threads error HOT 7
- pigz hanging waiting on lock HOT 4
- Segmentation fault in unpigz HOT 2
- Pipe input on Windows? HOT 3
- corrupted -- crc32 mismatch HOT 7
- unpigz -l failed with "can't destroy locked resource" HOT 3
- Undefined reference to COMB with NOTHREADS HOT 1
- Thread limiter doesnt seem to work on RHEL 7.9 HOT 3
- Feature request: --files-from HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pigz.