I am using celery in django project. I have tried using rabbitmq and redis backend but neither does work. Used celery version is 3.1.26.post2. I have to call 2, 3 sometimes 5 times task.delay() to see the task running. And sometimes usually after frequently calling the same task its "execution rate" increases and executes the task 70-80% of the time. For example, it drops 1 or 2 of 5 task.delay() calls, but executes 3-4 of them. Did you experience something like this? What can be the reason?
Celery executes a task after calling task.delay() for 3-5 times
2.5k Views Asked by Alihaydar Gubatov At
1
There are 1 best solutions below
Related Questions in DJANGO
- Django Admin Panel and Sub URLs Returning 404 Error on Deployment
- How to return HTTP Get request response from models class in Django project
- Issue with Quantity Increment in Django E-commerce Cart
- Can't install Pipenv on Windows
- use dict from python in django html template and also in js
- 'pyodbc.Cursor' object has no attribute 'callproc', mssql with django
- Django socketio process
- Root path analogue in uWSGI as in Uvicorn
- Django - ModuleNotFoundError: No module named 'backend'
- Does Python being a loosely typed programming language make it less secure?
- sorl-thumbnail adds a background color when padding is used
- Can't connect to local postgresql server from my docker container
- Why ProductHunt api dont work with Python?
- why i have to put extra space in before write option selected because it show error if i don't ' option:selected'
- Django Arrayfield migration to cloud sql (Postgresql) not creating the column
Related Questions in RABBITMQ
- When sending message getting Exception: org.springframework.amqp.AmqpIOException: java.io.IOException
- How to publish messages to RabbitMQ by using Multi threading?
- How should it be handled if the number of messages is less than the number of threads?
- Apply a dynamic group value in Spring Cloud Stream
- Two rabbitmq queues with exactly same configuration one of them is not created automatically (Spring Boot 3 RabbitMQ)
- Does Spring AMQP 3.13 support quorum queues?
- IServiceCollectionConfigurator' does not contain a definition for 'UsingRabbitMq'
- Troubleshooting topic exchanges in php-amqplib
- How to Use AWS Systems Manager (SSM) for Accessing a RabbitMQ Broker in an AWS VPC Private Subnet
- Rabbitmq on azure container app error 405 on trying to create queue on web management
- Cannot connect to RabbitMQ from Flower/Celery
- How to Extract Queue Name, Priority, and Message ID from RabbitMQ Inbound Endpoint Messages in WSO2 MI 4.2?
- Spring Boot RabbitMQ consumer application can not fetch an object sent by producer application in Java 17
- Is it possible to implement an event-driven architecture using Redis Streams?
- Scaling Nuclio With KEDA Based on Queue Length: Error ScaledObject Name is Not Specified
Related Questions in CELERY
- Django Not Sending Tasks to Celery in Production
- How to Resolve Workers Not Scaling with 100s of Queued Tasks in Google Cloud Composer?
- How do you update Celery Task State/Status to see it in Flower?
- airflow dags not running as expected
- Celery Beat runs the task every minute
- How to Prioritize Celery Tasks When Processing Large Numbers of Files to Prevent Long User Wait Times?
- How to handle memory intensive task causing WorkerLostError with Celery and HuggingFaceEmbedding?
- Untyped decorator makes function "add" untyped [misc] (celery & mypy)
- Celery worker shut down
- Celery Task Tracing ValueError: Unpacking Issue in a Flask Web App Migration, python backend
- Catching a signature of celery task in pytest
- Cannot connect to RabbitMQ from Flower/Celery
- How can Celery configure submodules' loggers?
- Get application worker concurrency during Task init
- How can I capture a celery.signal for when a task is "queued", must include a way to access kwargs?
Related Questions in DJCELERY
- Celery & Django - does the main process wait for tasks to finish?
- celery beat ExpressionDescriptor.py get_full_description
- How to use 'throws' parameter in celery using signature?
- Celery's task_reject_on_worker_lost doesn't work with Redis as message broker
- Dynamically change celery beat schedule params
- Register celery periodic tasks to see it within django admin
- celery beat fail when using djcelery schedule
- How to fix "Celery is receiving tasks but while executing it stuck"
- celery tasks converts python list into strings. how to avoid this?
- how to activate virtual environment and run celery commands to activate djcelery in server startup?
- Celery executes a task after calling task.delay() for 3-5 times
- django 2.1 celery not execute asyncron task
- Error handling while using chain of groups in celery
- Run Celery Tasks at the end of all others celery tasks
- Any way to make @periodic_task run on call only,it runs automatically on project starts?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
OK, based on your description there are a few bits I don't know (and they would help):
celery worker -A your_package_name)rabbitmqctlBased on your feedback I guess your tasks either take very long to complete or in some weird way hang and never finish. They definitely land within default queue created by celery worker upon start (called
celery).Posting code of sample task you try to insert into the queue and also code sample of how you try to insert it into the queue would help too.
I would normally define my task like this (in my package that defines what tasks are supposed to do, this code will be executed by celery worker):
I would insert my task into the queue like this (i.e. from python shell or from my other package that is supposed to insert tasks into the queue):
Somewhere in
your_package_namethere is a bit of code where you define your broker (in my case I keep it inceleryconfig.pybut it's up to you)Do not confuse vhost with your host name.
If like me you use rabbitmq then you need to create vhost, user and password before attempting to use the broker (run below in bash as root)
I would start my worker like this:
And then I would look at celery logs within
/tmp/celery.logand also list my queues like this (in bash as root):Hope this will help you get on the right tracks.