README.rst 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. =========================
  2. Celery Stresstest Suite
  3. =========================
  4. .. contents::
  5. :local:
  6. Introduction
  7. ============
  8. These tests will attempt to break the worker in different ways.
  9. The worker must currently be started separately, and it's encouraged
  10. to run the stresstest with different configuration values.
  11. Ideas include:
  12. 1) Frequent maxtasksperchild, single process
  13. ::
  14. $ celery -A stress worker -c 1 --maxtasksperchild=1
  15. 2) Frequent scale down & maxtasksperchild, single process
  16. ::
  17. $ AUTOSCALE_KEEPALIVE=0.01 celery -A stress worker --autoscale=1,0 \
  18. --maxtasksperchild=1
  19. 3) Frequent maxtasksperchild, multiple processes
  20. ::
  21. $ celery -A stress worker -c 8 --maxtasksperchild=1``
  22. 4) Default, single process
  23. ::
  24. $ celery -A stress worker -c 1
  25. 5) Default, multiple processes
  26. ::
  27. $ celery -A stress worker -c 8
  28. 6) Processes termianted by time limits
  29. ::
  30. $ celery -A stress worker --time-limit=1
  31. 7) Frequent maxtasksperchild, single process with late ack.
  32. ::
  33. $ celery -A stress worker -c1 --maxtasksperchild=1 -- celery.acks_late=1
  34. It's a good idea to include the ``--purge`` argument to clear out tasks from
  35. previous runs.
  36. Note that the stress client will probably hang if the test fails, so this
  37. test suite is currently not suited for automatic runs.
  38. Running the client
  39. ------------------
  40. After the worker is running you can start the client to run the complete test
  41. suite::
  42. $ python -m stress
  43. You can also specify which tests to run:
  44. $ python -m stress revoketermfast revoketermslow
  45. Or you can start from an offset, e.g. to skip the two first tests use
  46. ``--offset=2``::
  47. $ python -m stress --offset=2
  48. See ``python -m stress --help`` for a list of all available options.
  49. Options
  50. =======
  51. Using a different result backend
  52. --------------------------------
  53. You can set the environment variable ``CSTRESS_BACKEND`` to change
  54. the result backend used::
  55. $ CSTRESS_BACKEND='amqp://' celery -A stress worker #...
  56. $ CSTRESS_BACKEND='amqp://' python -m stress
  57. Using a custom queue
  58. --------------------
  59. A queue named ``c.stress`` is created and used by default,
  60. but you can change the name of this queue using the ``CSTRESS_QUEUE``
  61. environment variable.