Python concurrent.futures.ThreadPoolExecutor max_workers
up vote
0
down vote
favorite
I am searching for a long time on net. But no use. Please help or try to give me some ideas how to achieve this.
When I use python module concurrent.futures.ThreadPoolExecutor(max_workers=None)
, I want to know the max_workers
how much the number of suitable.
I've read the official document.
I still don't know the number of suitable when I coding.
Changed in version 3.5: If max_worker is None or not give, it will default to the number of processors on the machine, multiplied by 5, assuming that ThreadPoolExecutor is often used to overlap I/O instead of CPU work and the number of workers should be higher than the number of workers for ProcessPoolExecutor.
How to understand "max_workers" better?
For the first time to ask questions, thank you very much.
python threadpoolexecutor
add a comment |
up vote
0
down vote
favorite
I am searching for a long time on net. But no use. Please help or try to give me some ideas how to achieve this.
When I use python module concurrent.futures.ThreadPoolExecutor(max_workers=None)
, I want to know the max_workers
how much the number of suitable.
I've read the official document.
I still don't know the number of suitable when I coding.
Changed in version 3.5: If max_worker is None or not give, it will default to the number of processors on the machine, multiplied by 5, assuming that ThreadPoolExecutor is often used to overlap I/O instead of CPU work and the number of workers should be higher than the number of workers for ProcessPoolExecutor.
How to understand "max_workers" better?
For the first time to ask questions, thank you very much.
python threadpoolexecutor
The default value isos.cpu_count() * 5
which should be a good value but this may of course depend on your use case.
– Michael Butscher
Nov 20 at 2:49
The quote somehow answers your question, doesn't it?
– Klaus D.
Nov 20 at 2:54
@KlausD. Thank you for your advice.
– Jaxon
Nov 20 at 2:58
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am searching for a long time on net. But no use. Please help or try to give me some ideas how to achieve this.
When I use python module concurrent.futures.ThreadPoolExecutor(max_workers=None)
, I want to know the max_workers
how much the number of suitable.
I've read the official document.
I still don't know the number of suitable when I coding.
Changed in version 3.5: If max_worker is None or not give, it will default to the number of processors on the machine, multiplied by 5, assuming that ThreadPoolExecutor is often used to overlap I/O instead of CPU work and the number of workers should be higher than the number of workers for ProcessPoolExecutor.
How to understand "max_workers" better?
For the first time to ask questions, thank you very much.
python threadpoolexecutor
I am searching for a long time on net. But no use. Please help or try to give me some ideas how to achieve this.
When I use python module concurrent.futures.ThreadPoolExecutor(max_workers=None)
, I want to know the max_workers
how much the number of suitable.
I've read the official document.
I still don't know the number of suitable when I coding.
Changed in version 3.5: If max_worker is None or not give, it will default to the number of processors on the machine, multiplied by 5, assuming that ThreadPoolExecutor is often used to overlap I/O instead of CPU work and the number of workers should be higher than the number of workers for ProcessPoolExecutor.
How to understand "max_workers" better?
For the first time to ask questions, thank you very much.
python threadpoolexecutor
python threadpoolexecutor
edited Nov 20 at 2:59
Aqueous Carlos
301213
301213
asked Nov 20 at 2:45
Jaxon
12
12
The default value isos.cpu_count() * 5
which should be a good value but this may of course depend on your use case.
– Michael Butscher
Nov 20 at 2:49
The quote somehow answers your question, doesn't it?
– Klaus D.
Nov 20 at 2:54
@KlausD. Thank you for your advice.
– Jaxon
Nov 20 at 2:58
add a comment |
The default value isos.cpu_count() * 5
which should be a good value but this may of course depend on your use case.
– Michael Butscher
Nov 20 at 2:49
The quote somehow answers your question, doesn't it?
– Klaus D.
Nov 20 at 2:54
@KlausD. Thank you for your advice.
– Jaxon
Nov 20 at 2:58
The default value is
os.cpu_count() * 5
which should be a good value but this may of course depend on your use case.– Michael Butscher
Nov 20 at 2:49
The default value is
os.cpu_count() * 5
which should be a good value but this may of course depend on your use case.– Michael Butscher
Nov 20 at 2:49
The quote somehow answers your question, doesn't it?
– Klaus D.
Nov 20 at 2:54
The quote somehow answers your question, doesn't it?
– Klaus D.
Nov 20 at 2:54
@KlausD. Thank you for your advice.
– Jaxon
Nov 20 at 2:58
@KlausD. Thank you for your advice.
– Jaxon
Nov 20 at 2:58
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
max_worker
, you can take it as threads number.
If you want to make the best of CPUs, you should keep it running (instead of sleeping).
Ideally if you set it to None, there will be ( CPU number * 5) threads at most. On average, echo CPU has 5 thread to schedule. Then if one of them falls into sleep, another thread will be scheduled.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
max_worker
, you can take it as threads number.
If you want to make the best of CPUs, you should keep it running (instead of sleeping).
Ideally if you set it to None, there will be ( CPU number * 5) threads at most. On average, echo CPU has 5 thread to schedule. Then if one of them falls into sleep, another thread will be scheduled.
add a comment |
up vote
0
down vote
max_worker
, you can take it as threads number.
If you want to make the best of CPUs, you should keep it running (instead of sleeping).
Ideally if you set it to None, there will be ( CPU number * 5) threads at most. On average, echo CPU has 5 thread to schedule. Then if one of them falls into sleep, another thread will be scheduled.
add a comment |
up vote
0
down vote
up vote
0
down vote
max_worker
, you can take it as threads number.
If you want to make the best of CPUs, you should keep it running (instead of sleeping).
Ideally if you set it to None, there will be ( CPU number * 5) threads at most. On average, echo CPU has 5 thread to schedule. Then if one of them falls into sleep, another thread will be scheduled.
max_worker
, you can take it as threads number.
If you want to make the best of CPUs, you should keep it running (instead of sleeping).
Ideally if you set it to None, there will be ( CPU number * 5) threads at most. On average, echo CPU has 5 thread to schedule. Then if one of them falls into sleep, another thread will be scheduled.
answered Nov 20 at 2:55
oyjh
2941215
2941215
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53385479%2fpython-concurrent-futures-threadpoolexecutor-max-workers%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The default value is
os.cpu_count() * 5
which should be a good value but this may of course depend on your use case.– Michael Butscher
Nov 20 at 2:49
The quote somehow answers your question, doesn't it?
– Klaus D.
Nov 20 at 2:54
@KlausD. Thank you for your advice.
– Jaxon
Nov 20 at 2:58