Eventlet或gevent或Stackless + Twisted,塔架,Django和SQL炼金术 [英] Eventlet or gevent or Stackless + Twisted, Pylons, Django and SQL Alchemy

查看:186
本文介绍了Eventlet或gevent或Stackless + Twisted,塔架,Django和SQL炼金术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在将Twisted广泛用于需要大量异步io的应用程序.在某些情况下,工作是绑定到CPU的,为此,我们产生了一个进程池来完成工作,并且拥有一个跨多个服务器管理这些进程的系统-所有这些都是在Twisted中完成的.效果很好.问题在于,很难使新团队成员跟上步伐.用Twisted编写异步代码需要接近垂直的学习曲线.好像人类只是不自然地那样想.

We're using Twisted extensively for apps requiring a great deal of asynchronous io. There are some cases where stuff is cpu bound instead and for that we spawn a pool of processes to do the work and have a system for managing these across multiple servers as well - all done in Twisted. Works great. The problem is that it's hard to bring new team members up to speed. Writing asynchronous code in Twisted requires a near vertical learning curve. It's as if humans just don't think that way naturally.

我们可能正在考虑一种混合方法.也许将xmlrpc服务器部分和流程管理保留在Twisted中,并在代码中实现看起来至少在某种程度上是同步的而不是这样的其他东西.再说一次,我喜欢显式的而不是隐式的,所以我必须多考虑一下.无论如何,进入greenlets-这些东西工作得如何?因此,这里有Stackless,您可以从我的Gallentean头像中看到,我非常了解CCP旗舰级EVE Online游戏第一手使用它所取得的巨大成功.那Eventlet或gevent呢?好吧,目前只有Eventlet可以与Twisted一起使用.但是gevent声称它更快,因为它不是纯python实现,而是依赖libevent.它还声称具有较少的特质和缺陷. gevent 据我所知,它由1个人维护.这让我有些不安,但是所有出色的项目都是以这种方式开始的...然后是 PyPy -我什至还没有读完它-在这个线程中看到了它:

We're considering a mixed approach perhaps. Maybe keep the xmlrpc server part and process management in Twisted and implement the other stuff in code that at least looks synchronous to some extent while not being as such. Then again I like explicit over implicit so I have to think about this a bit more. Anyway onto greenlets - how well does that stuff work? So there's Stackless and as you can see from my Gallentean avatar I'm well aware of the tremendous success in it's use for CCP's flagship EVE Online game first hand. What about Eventlet or gevent? Well for now only Eventlet works with Twisted. However gevent claims to be faster as it's not a pure python implementation but rather relies upon libevent instead. It also claims to have fewer idiosyncrasies and defects. gevent It's maintained by 1 guy as far as I can tell. This makes me somewhat leery but all great projects start this way so... Then there's PyPy - I haven't even finished reading about that one yet - just saw it in this thread: Drawbacks of Stackless.

如此令人困惑-我想知道该怎么做-听起来像Eventlet可能是最好的选择,但它真的足够稳定吗?有人对它有经验吗?我们是否应该使用Stackless而不是因为它已经存在并且它是经过验证的技术-就像Twisted一样-它们可以很好地协同工作.但是我仍然讨厌不得不使用单独的Python版本来执行此操作.该怎么办......

So confusing - I'm wondering what the heck to do - sounds like Eventlet is probably the best bet but is it really stable enough? Anyone out there have any experience with it? Should we go with Stackless instead as it's been around and is proven technology - just like Twisted is as well - and they do work together nicely. But still I hate having to have a separate version of Python to do this. what to do....

这个有点令人讨厌的博客条目对我来说真是令人震惊:我不明白Twisted就像Java一样,对我来说Java通常是您在线程思维方式中所处的位置,但无论如何.不过,如果那个猴子补丁真的像那样工作,那就哇.哇!

This somewhat obnoxious blog entry hit the nail on the head for me though: Asynchronous IO for Grownups I don't get the Twisted is being like Java remark as to me Java is typically where you are in the threading mindset but whatever. Nevertheless if that monkey patch thing really works just like that then wow. Just wow!

推荐答案

您可能要签出:

  • Comparing gevent to eventlet
  • Reports from users who moved from twisted or eventlet to gevent

Eventlet和gevent不能真正与Stackless相提并论,因为Stackless附带了一个不知道tasklet的标准库.有 socketless套接字的实现,但是没有 gevent.monkey . CCP不使用裸露的Stackless,它具有一种称为Stackless I/O的功能,其AFAIK仅适用于Windows,并且从未开源(?).

Eventlet and gevent are not really comparable to Stackless, because Stackless ships with a standard library that is not aware of tasklets. There are implementations of socket for Stackless but there isn't anything as comprehensive as gevent.monkey. CCP does not use bare bones Stackless, it has something called Stackless I/O which AFAIK is windows-only and was never open sourced (?).

eventlet和gevent都可以在Stackless上运行,而不是在greenlet上运行.在某些时候,我们甚至尝试通过 GSoC项目但没有找到学生.

Both eventlet and gevent could be made to run on Stackless rather than on greenlet. At some point we even tried to do this as a GSoC project but did not find a student.

这篇关于Eventlet或gevent或Stackless + Twisted,塔架,Django和SQL炼金术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆