Skip to content

BC-269 Configure celery pool type and concurrency number. - #201

Open
olegtropinin wants to merge 1 commit into
masterfrom
BC-269-increase-celery-tasks
Open

BC-269 Configure celery pool type and concurrency number.#201
olegtropinin wants to merge 1 commit into
masterfrom
BC-269-increase-celery-tasks

Conversation

@olegtropinin

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread Makefile Outdated
.PHONY: run-celery
run-celery:
poetry run celery -A node.config.celery worker --loglevel=INFO
poetry run celery -A node.config.celery worker --loglevel=INFO --pool=eventlet --concurrency=30

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olegtropinin why eventlet?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olegtropinin let's go with prefork or process and autoscale for now, we will optimize with async approach later if needed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, these comments apply to docker-compose.yml only. here we need just keep it as it was, because it is OK for development

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found information that "eventlet" pool type have greater concurrency than prefork. Also it's good for API calls. It was a case why I selected prefork.
I removed "eventlet" as you said. It has "prefork" default pool now.

You are right no need to have too many threads for development. I removed concurrency argument from Makefile (make run-celery).

Comment thread docker-compose.yml Outdated
TNB_CELERY_BROKER_URL: 'amqp://guest:guest@celery-broker:5672//'
env_file: .env
command: poetry run celery -A node.config.celery worker --loglevel=INFO
command: poetry run celery -A node.config.celery worker --loglevel=INFO --pool=eventlet --concurrency=30

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's have concurrency depend on max PV schedule length (read from env var that corresponds to django setting)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concurrency value is now same as TNB_NODE_SCHEDULE_CAPACITY environment value.

@olegtropinin
olegtropinin force-pushed the BC-269-increase-celery-tasks branch from dbb6bb7 to 9660f45 Compare March 24, 2022 10:27
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

Successfully merging this pull request may close these issues.

2 participants