Skip to content

Added some notes about Celery settings vars #561 #562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 28, 2025
Merged
3 changes: 3 additions & 0 deletions scripts/wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ boolean
Boolean
changesets
CLI
CPU
CPUs
CRS
crosshairs
CSRF
Expand Down Expand Up @@ -120,6 +122,7 @@ Peatlands
Pixelated
PostGIS
PostgreSQL
prefetch
Prepopulate
Prepopulated
PyPI
Expand Down
11 changes: 10 additions & 1 deletion src/server/troubleshoot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,13 @@ Logs should contain information about sending emails with task `mergin.celery.se

```shell
[2024-12-09 10:37:16,265: INFO/ForkPoolWorker-2] Task mergin.celery.send_email_async[3e50df69-90c1-49be-b31c-78f1fb417500] succeeded in 0.11469305199989321s: None
```
```

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we have these in troubleshooting section? Should not we at least mention few most common issues?
Also there is flask cmd to test if celery is working, worth mentioning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@varmar05 Do you prefer a specific section for this or under 'Install' section?

Copy link
Collaborator

Choose a reason for hiding this comment

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

basic settings we can have in 'install' section or with other env variables - ideally our default should be reasonable so users do not need to change anything (unless they know what they are doing)

but because of common issues with celery we should have some trouble shooting section as well - at least to verify that celery is running and accepting tasks

Copy link
Contributor

Choose a reason for hiding this comment

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

Add some troubleshooring context to this

## Celery settings

The following section provides some background to Celery setting via available environment variables. All these variables start with `CELERY_`

* `CELERY_RESULT_BACKEND` - Where Celery sends the tasks results (to Redis backend by default on Mergin Maps)
* `CELERY_ACKS_LATE` - If `True`, means tasks will be transmitted as execute, AFTER they are finished, not 'right before'. Default: `False`
* `CELERYD_CONCURRENCY` - Number of child processes. As rule of thumb do not use all available CPUs. If not set, defaults to all available CPUs, which may lead to system instability if many users trigger Celery tasks in parallel.
* `CELERYD_PREFETCH_MULTIPLIER` - The number of messages to prefetch at a time multiplied by the number of concurrent processes. Default is `4`. If you want to disable this feature set it to `1`.
Loading