Open abadger1 opened 2 years ago
https://giters.com/Koed00/django-q/issues/359
This seems to say this is okay ? But seems so strange that redis is spinning hard with these 0.2 second polls - for no reason.
Are you sure it's not just the monitoring functionality doing its thing? I'll assume you have Redis set up for your app's cache. If you look at the keys in the log above with both get and set and cluster in the key name, I'd wager that's what it is. You could look through the source code and find where that cache key is generated at. Or, disable your app's cache and see if it stops.
Yes redis is in place for the app's cache - used on one DRF query to speed this up.
Why is this related to Django-q - which is using ORM 'default' - ie Django and back-end PostgreSQL in my setup.
Why is it monitoring redis - when redis is not being used by Django-q ? I think I'm missing something in my understanding of 'orm default' setting.
Two concepts going on: 1) The cluster is the worker process, that picks up tasks and processes the tasks. 2) The broker communicates those jobs between your app and the cluster.
With that said: A) The ORM/postgres table is being used in the ORM 'default' to broker or transfer those messages between your app and the cluster. So, your app writes a task to the postgres table, the cluster picks it up from the same table and processes it. This is done every 0.2 seconds, or whatever your setting is configured to. B) The cluster monitoring independent of what is used for a broker and makes sure the tasks are being processed, processes running successfully, etc. The monitoring for the cluster uses your app's cache to do so. If you were using the database backend for caching, that monitoring process would also be hitting postgres. However, you're using Redis for caching, so the cluster monitoring is using Redis. The cluster is monitoring itself using Redis to track statistics. It's not monitoring Redis itself.
The monitoring process is covered in the docs. Basically, everything in here will be hitting your app's cache, which in your case is Redis: https://django-q.readthedocs.io/en/latest/monitor.html
On a side note, if Redis is spinning hard by getting hit every 0.2 second, something is seriously wrong your your Redis setup.