intro.rst 4.9 KB

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