V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
fordoo
V2EX  ›  Python

唉,我也造了一个 Python 的 RPC 轮子

  •  
  •   fordoo · 2015-11-07 14:15:52 +08:00 · 2928 次点击
    这是一个创建于 3095 天前的主题,其中的信息可能已经有所发展或是发生改变。

    ToRPC(Tornado + RPC) 基于 Tornado 的实现的。

    • 异步 RPC
    • 双向 RPC 通信

    虽然造得不咋样,但是因为 PyPy 和 Tornado 的高效, ToRPC 的 QPS 最多可以达到 4W 多。
    另外感觉 PyPy4.0.0 确实比 2.6 热身速度快了。

    github :https://github.com/yoki123/torpc

    4 条回复    2015-11-10 19:08:31 +08:00
    onlyxuyang
        1
    onlyxuyang  
       2015-11-07 14:29:31 +08:00 via Android
    有没有方案可以让类定义和类实例一起 rpc 过来?
    fordoo
        2
    fordoo  
    OP
       2015-11-07 14:38:15 +08:00
    @onlyxuyang 不知道,要不直接传代码过来,这边 eval 一下
    onlyxuyang
        3
    onlyxuyang  
       2015-11-07 14:48:09 +08:00 via Android
    @fordoo ……听起来不太靠谱…… 没有类似的比较完善的框架么…… (>﹏<)
    fordoo
        4
    fordoo  
    OP
       2015-11-10 19:08:31 +08:00
    marshal 换到 msgpack ,关闭默认的 60 秒请求超时等一系列修改之后,刚刚 QPS 跑到了 59151 。
    CPU 使用率在 60-70%左右。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5338 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 07:03 · PVG 15:03 · LAX 00:03 · JFK 03:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.