1

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?

4

1 回答 1

1

没有这样的上下文管理器,尽管欢迎您贡献一个。

您已经对所有内容进行了猴子修补,但您不想socket在 memcache 客户端中进行猴子修补。您的选择:

  • 猴子修补所有东西socket,然后patcher.import_patched是特定模块。这对于 Django/Tastypie 来说将非常困难。
  • 修改你的内存缓存客户端以使用eventlet.patcher.original('socket')
于 2014-08-21T11:53:42.707 回答