As mentioned in the celery docs, the eventlet pool should be faster than the prefork pool for evented I/O such as asynchronous HTTP requests.
They even mention that
"In an informal test with a feed hub system the Eventlet pool could fetch and process hundreds of feeds every second, while the prefork pool spent 14 seconds processing 100 feeds."
However, we are unable to produce any kind of results similar to this. Running the example tasks, urlopen and crawl exactly as described and opening thousands of urls, it appears that the prefork pool almost always performs better.
We tested with all sorts of concurrencies (prefork with concurrency 200, eventlet with concurrencies 200, 2000, 5000). In all of these cases the tasks complete in fewer seconds using the prefork pool.The machine being run on is a 2014 Macbook Pro with a RabbitMQ server running.
We are looking to make thousands of asynchronous HTTP requests at once and are wondering if the eventlet pool is even worth implementing? If it is, what are we missing?
Result of python -V && pip freeze is:
Python 2.7.6
amqp==1.4.6
anyjson==0.3.3
billiard==3.3.0.20
bitarray==0.8.1
celery==3.1.18
dnspython==1.12.0
eventlet==0.17.3
greenlet==0.4.5
kombu==3.0.26
pybloom==1.1
pytz==2015.2
requests==2.6.2
wsgiref==0.1.2
Test code used (pretty much exactly from the docs):
>>> from tasks import urlopen
>>> from celery import group
>>> LIST_OF_URLS = ['http://127.0.0.1'] * 10000 # 127.0.0.1 was just a local web server, also used 'http://google.com' and others
>>> result = group(urlopen.s(url)
... for url in LIST_OF_URLS).apply_async()