Browse Source

Flower trumps Django-Admin monitor

Ask Solem 12 years ago
parent
commit
ea1085adc6
1 changed files with 36 additions and 206 deletions
  1. 36 206
      docs/userguide/monitoring.rst

+ 36 - 206
docs/userguide/monitoring.rst

@@ -171,30 +171,40 @@ You can specify a single, or a list of workers by using the
 
 
 .. _monitoring-flower:
 .. _monitoring-flower:
 
 
-Celery Flower: Web interface
-----------------------------
+Flower: Real-time Celery web-monitor
+------------------------------------
 
 
-Celery Flower is a web based, real-time monitor and administration tool.
+Flower is a real-time web based monitor and administration tool for Celery.
+It is under active development, but is already an essential tool.
+Being the recommended monitor for Celery, it obsoletes the Django-Admin
+monitor, celerymon and the ncurses based monitor.
+
+Flower is pronounced like "flow", but you can also use the botanical version
+if you prefer.
 
 
 Features
 Features
 ~~~~~~~~
 ~~~~~~~~
 
 
-- Shutdown or restart workers
-- View workers status (completed, running tasks, etc.)
-- View worker pool options (timeouts, processes, etc.)
-- Control worker pool size
-- View message broker options
-- View active queues, add or cancel queues
-- View processed task stats by type
-- View currently running tasks
-- View scheduled tasks
-- View reserved and revoked tasks
-- Apply time and rate limits
-- View all active configuration options
-- View all tasks (by type, by worker, etc.)
-- View all task options (arguments, start time, runtime, etc.)
-- Revoke or terminate tasks
-- View real-time execution graphs
+- Real-time monitoring using Celery Events
+
+    - Task progress and history.
+    - Ability to show task details (arguments, start time, runtime, and more)
+    - Graphs and statistics
+
+- Remote Control
+
+    - View worker status and statistics.
+    - Shutdown and restart worker instances.
+    - Control worker pool size and autoscale settings.
+    - View and modify the queues a worker instance consumes from.
+    - View currently running tasks
+    - View scheduled tasks (ETA/countdown)
+    - View reserved and revoked tasks
+    - Apply time and rate limits
+    - Configuration viewer
+    - Revoke or terminate tasks
+
+- HTTP API
 
 
 **Screenshots**
 **Screenshots**
 
 
@@ -211,203 +221,22 @@ More screenshots_:
 Usage
 Usage
 ~~~~~
 ~~~~~
 
 
-Install Celery Flower:
+You can use pip to install Flower:
 
 
 .. code-block:: bash
 .. code-block:: bash
 
 
     $ pip install flower
     $ pip install flower
 
 
-Launch Celery Flower and open http://localhost:8008 in browser:
+Running the flower command will start a web-server that you can visit:
 
 
 .. code-block:: bash
 .. code-block:: bash
 
 
     $ celery flower
     $ celery flower
 
 
-.. _monitoring-django-admin:
-
-Django Admin Monitor
---------------------
-
-.. versionadded:: 2.1
-
-When you add `django-celery`_ to your Django project you will
-automatically get a monitor section as part of the Django admin interface.
-
-This can also be used if you're not using Celery with a Django project.
-
-*Screenshot*
-
-.. figure:: ../images/djangoceleryadmin2.jpg
-   :width: 700px
-
-.. _`django-celery`: http://pypi.python.org/pypi/django-celery
-
-
-.. _monitoring-django-starting:
-
-Starting the monitor
-~~~~~~~~~~~~~~~~~~~~
-
-The Celery section will already be present in your admin interface,
-but you won't see any data appearing until you start the snapshot camera.
-
-The camera takes snapshots of the events your workers sends at regular
-intervals, storing them in your database (See :ref:`monitoring-snapshots`).
-
-To start the camera run:
-
-.. code-block:: bash
-
-    $ python manage.py celerycam
-
-If you haven't already enabled the sending of events you need to do so:
-
-.. code-block:: bash
-
-    $ python manage.py celery control enable_events
-
-:Tip: You can enable events when the worker starts using the `-E` argument.
-
-Now that the camera has been started, and events have been enabled
-you should be able to see your workers and the tasks in the admin interface
-(it may take some time for workers to show up).
-
-The admin interface shows tasks, worker nodes, and even
-lets you perform some actions, like revoking and rate limiting tasks,
-or shutting down worker nodes.
-
-.. _monitoring-django-frequency:
-
-Shutter frequency
-~~~~~~~~~~~~~~~~~
-
-By default the camera takes a snapshot every second, if this is too frequent
-or you want to have higher precision, then you can change this using the
-``--frequency`` argument.  This is a float describing how often, in seconds,
-it should wake up to check if there are any new events:
-
-.. code-block:: bash
-
-    $ python manage.py celerycam --frequency=3.0
-
-The camera also supports rate limiting using the ``--maxrate`` argument.
-While the frequency controls how often the camera thread wakes up,
-the rate limit controls how often it will actually take a snapshot.
-
-The rate limits can be specified in seconds, minutes or hours
-by appending `/s`, `/m` or `/h` to the value.
-Example: ``--maxrate=100/m``, means "hundred writes a minute".
-
-The rate limit is off by default, which means it will take a snapshot
-for every ``--frequency`` seconds.
-
-The events also expire after some time, so the database doesn't fill up.
-Successful tasks are deleted after 1 day, failed tasks after 3 days,
-and tasks in other states after 5 days.
-
-.. _monitoring-django-reset:
-
-Resetting monitor data
-~~~~~~~~~~~~~~~~~~~~~~
-
-To reset the monitor data you need to clear out two models::
-
-    >>> from djcelery.models import WorkerState, TaskState
-
-    # delete worker history
-    >>> WorkerState.objects.all().delete()
-
-    # delete task history
-    >>> TaskState.objects.all().update(hidden=True)
-    >>> TaskState.objects.purge()
-
-.. _monitoring-django-expiration:
-
-Expiration
-~~~~~~~~~~
-
-By default monitor data for successful tasks will expire in 1 day,
-failed tasks in 3 days and pending tasks in 5 days.
-
-You can change the expiry times for each of these using
-adding the following settings to your :file:`settings.py`:
-
-.. code-block:: python
-
-    from datetime import timedelta
-
-    CELERYCAM_EXPIRE_SUCCESS = timedelta(hours=1)
-    CELERYCAM_EXPIRE_ERROR = timedelta(hours=2)
-    CELERYCAM_EXPIRE_PENDING = timedelta(hours=2)
-
-.. _monitoring-nodjango:
-
-Using outside of Django
-~~~~~~~~~~~~~~~~~~~~~~~
-
-`django-celery` also installs the :program:`djcelerymon` program. This
-can be used by non-Django users, and runs both a web server and a snapshot
-camera in the same process.
-
-**Installing**
-
-Using :program:`pip`:
-
-.. code-block:: bash
-
-    $ pip install -U django-celery
-
-or using :program:`easy_install`:
-
-.. code-block:: bash
-
-    $ easy_install -U django-celery
-
-**Running**
-
-:program:`djcelerymon` reads configuration from your Celery configuration
-module, and sets up the Django environment using the same settings:
-
-.. code-block:: bash
-
-    $ djcelerymon
-
-Database tables will be created the first time the monitor is run.
-By default an `sqlite3` database file named
-:file:`djcelerymon.db` is used, so make sure this file is writeable by the
-user running the monitor.
-
-If you want to store the events in a different database, e.g. MySQL,
-then you can configure the `DATABASE*` settings directly in your Celery
-config module.  See http://docs.djangoproject.com/en/dev/ref/settings/#databases
-for more information about the database options available.
-
-You will also be asked to create a superuser (and you need to create one
-to be able to log into the admin later)::
-
-    Creating table auth_permission
-    Creating table auth_group_permissions
-    [...]
-
-    You just installed Django's auth system, which means you don't
-    have any superusers defined.  Would you like to create
-    one now? (yes/no): yes
-    Username (Leave blank to use 'username'): username
-    Email address: me@example.com
-    Password: ******
-    Password (again): ******
-    Superuser created successfully.
-
-    [...]
-    Django version 1.2.1, using settings 'celeryconfig'
-    Development server is running at http://127.0.0.1:8000/
-    Quit the server with CONTROL-C.
-
-Now that the service is started you can visit the monitor
-at http://127.0.0.1:8000, and log in using the user you created.
+The default port is http://localhost:5555, but you can change this using the
+:option:`--port` argument::
 
 
-For a list of the command line options supported by :program:`djcelerymon`,
-please see ``djcelerymon --help``.
+    $ open http://localhost:5555
 
 
 .. _monitoring-celeryev:
 .. _monitoring-celeryev:
 
 
@@ -419,7 +248,8 @@ celery events: Curses Monitor
 `celery events` is a simple curses monitor displaying
 `celery events` is a simple curses monitor displaying
 task and worker history.  You can inspect the result and traceback of tasks,
 task and worker history.  You can inspect the result and traceback of tasks,
 and it also supports some management commands like rate limiting and shutting
 and it also supports some management commands like rate limiting and shutting
-down workers.
+down workers.  This monitor was started as a proof of concept, and you
+probably want to use Flower instead.
 
 
 Starting:
 Starting: