intro.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. =============================
  2. Introduction to Task Queues
  3. =============================
  4. .. contents::
  5. :local:
  6. :depth: 1
  7. What are Task Queues?
  8. =====================
  9. .. compound::
  10. "The quick brown fox jumps over the lazy dog"
  11. said the Farmer.
  12. but little did *he* know...
  13. What do I need?
  14. ===============
  15. *Celery* requires a message broker to send and receive messages,
  16. but this term has been stretched to include everything from
  17. financial-grade messaging systems to your fridge.
  18. You can run *Celery* on a single or multiple machines, or even
  19. across datacenters.
  20. Celery runs on Python 2.6/2.7/3.2, PyPy and Jython.
  21. Celery is…
  22. ==========
  23. .. topic:: ”
  24. - **Simple**
  25. Bla bla bla., yaddi blabla, bla bli bla do re mi, bla bi do,
  26. re mi bla do blah blah yadda blah blah blah blah.
  27. - **Fast**
  28. Bla bla bla. librabbitmq, yaddi blabla lightweight, bla bli bla do re mi, bla bi do,
  29. re mi bla do blah blah yadda blah blah blah blah.
  30. - **Highly Available**
  31. Workers and clients will automatically retry in the event
  32. of connection loss or failure, and some brokers support
  33. HA in way of *Master/Master* or -- *Master/Slave* replication.
  34. - **Flexible**
  35. Almost every part of *Celery* can be extended or used on its own,
  36. Custom pool implementations, serializers, compression schemes, logging,
  37. schedulers, consumers, producers, autoscalers, broker transorts and much more.
  38. .. topic:: It supports
  39. .. hlist::
  40. :columns: 2
  41. - **Brokers**
  42. :ref:`RabbitMQ <broker-rabbitmq>`, :ref:`Redis <broker-redis>`,
  43. :ref:`MongoDB <broker-mongodb>`, :ref:`Beanstalk <broker-beanstalk>`,
  44. :ref:`CouchDB <broker-couchdb>`, or
  45. :ref:`SQLAlchemy <broker-sqlalchemy>`/:ref:`Django ORM <broker-django>`.
  46. - **Concurrency**
  47. multiprocessing, Eventlet_, gevent_ and threads.
  48. - **Serialization & Compression**
  49. Messages can be serialized using *pickle*, *json*, *yaml*, *msgpack*,
  50. and optionally compressed using *zlib* or *bzip2*
  51. - **Result Stores**
  52. AMQP, Redis, memcached, MongoDB, SQLAlchemy/Django ORM, Apache Cassandra.
  53. .. topic:: Features
  54. .. hlist::
  55. :columns: 2
  56. - **Monitoring**
  57. The stream of monitoring events emit by the worker are used
  58. by built-in and external tools to tell you what your cluster
  59. is doing in real-time.
  60. :ref:`Read more… <guide-monitoring>`.
  61. - **Time Limits & Rate Limits**
  62. You can control how many tasks can be executed per second/minute/hour,
  63. or how long a task can be allowed to run, and this can be set as
  64. a default, for a specific worker or individually for each task type.
  65. :ref:`Read more… <worker-time-limits>`.
  66. - **Autoreloading**
  67. While in development workers can be configured to automatically reload source
  68. code as it changes.
  69. :ref:`Read more… <worker-autoreloading>`.
  70. - **Autoscaling**
  71. Dynamically resizing the worker pool depending on load,
  72. or custom metrics specified by the user, used to limit
  73. memory usage in shared hosting/cloud environment or to
  74. enforce a given quality of service.
  75. :ref:`Read more… <worker-autoscaling>`.
  76. - **Resource Leak Protection**
  77. The :option:`--maxtasksperchild` option is used for user tasks
  78. leaking resources, like memory or file descriptors, that
  79. are out simply out of your control.
  80. :ref:`Read more… <worker-maxtasksperchild>`.
  81. - **User Components**
  82. Each worker component can be customized, and additional components
  83. can be defined by the user. The worker is built up using "boot steps" — a
  84. dependency graph enabling fine grained control of the workers
  85. internals.
  86. .. _`RabbitMQ`: http://www.rabbitmq.com/
  87. .. _`Redis`: http://code.google.com/p/redis/
  88. .. _`SQLAlchemy`: http://www.sqlalchemy.org/
  89. .. _`Django ORM`: http://djangoproject.com/
  90. .. _`Eventlet`: http://eventlet.net/
  91. .. _`gevent`: http://gevent.org/
  92. .. _`Beanstalk`: http://kr.github.com/beanstalkd/
  93. .. _`MongoDB`: http://mongodb.org/
  94. .. _`CouchDB`: http://couchdb.apache.org/
  95. .. _`Amazon SQS`: http://aws.amazon.com/sqs/
  96. .. _`Apache ZooKeeper`: http://zookeeper.apache.org/