You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before openinig this issue a digged a lot and I think I kind of understand why and how it happens but I am not sure how to fix it and even if it is possible to fix without some ajustments in the celery project itself.
I will put my findings here and hopefuly we may find a way to address it.
Concurrency is 8 (Number of CPU Cores on my machine) and not 4 as expected.
As fas as I could understand, celery 5 uses click and celery-pyramid uses the signal user_preload_options to configure celery using config_from_object method.
At this point it seems that celery has already loaded the click parameters into internal variables and since we didn't use --concurrency it behaves as if we have used --concurrency=0 (which will later translate to Number of CPU cores). Since command line parameters has precedency over config file parameters (config_from_object) celery will ignore the value from .ini` file and use the default value.
If you guys have a idea on how to fix (or work around it) or need any more information I might have I will be glad to provide it.
Cheers
The text was updated successfully, but these errors were encountered:
Versions used:
* Python: 3.9.4
* Celery: 5.0.5
* Pyramid: 2.0
* Pyramid-Celery: 4.0.0
Before openinig this issue a digged a lot and I think I kind of understand why and how it happens but I am not sure how to fix it and even if it is possible to fix without some ajustments in the celery project itself.
I will put my findings here and hopefuly we may find a way to address it.
How to reproduce:
Files
The files can also be found here: https://github.com/debonzi/pyramid-celery-issue-sample
setup.py
demo.py
conf.ini
Install and Run
Output:
Concurrency is 8 (Number of CPU Cores on my machine) and not 4 as expected.
As fas as I could understand, celery 5 uses click and celery-pyramid uses the signal
user_preload_options
to configure celery usingconfig_from_object
method.At this point it seems that celery has already loaded the click parameters into internal variables and since we didn't use
--concurrency
it behaves as if we have used--concurrency=0
(which will later translate to Number of CPU cores). Since command line parameters has precedency over config file parameters (config_from_object) celery will ignore the value from
.ini` file and use the default value.If you guys have a idea on how to fix (or work around it) or need any more information I might have I will be glad to provide it.
Cheers
The text was updated successfully, but these errors were encountered: