Reputation: 4360
I have a Django/Tastypie app where I've monkey patched everything with eventlet.
I analysed performance during load tests while using both sync and eventlet worker clasees for gunicorn. I tested against sync workers to eliminate the effects of waiting for other greenthreads to switch back, and I found that the memcached calls in my throttling code only take about 1ms on their own. Rather than switch to another greenthread while waiting for this 1ms response, I'd rather just block at this one point. Is there some way to tell eventlet to not switch to another greenthread? Maybe a context manager or something?
Upvotes: 1
Views: 437
Reputation: 5577
There is no such context manager, though you are welcome to contribute one.
You have monkey patched everything, but you do not want to monkey patch socket
in memcache client. Your options:
socket
, then patcher.import_patched
particular modules. This is going to be very hard with Django/Tastypie.eventlet.patcher.original('socket')
Upvotes: 1