推荐学习书目
› 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 · Nov 7, 2015 · 3798 views
    This topic created in 3986 days ago, the information mentioned may be changed or developed.

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

    • 异步 RPC
    • 双向 RPC 通信

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

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

    4 replies  •  2015-11-10 19:08:31 +08:00
    onlyxuyang
        1
    onlyxuyang  
       Nov 7, 2015 via Android
    有没有方案可以让类定义和类实例一起 rpc 过来?
    fordoo
        2
    fordoo  
    OP
       Nov 7, 2015
    @onlyxuyang 不知道,要不直接传代码过来,这边 eval 一下
    onlyxuyang
        3
    onlyxuyang  
       Nov 7, 2015 via Android
    @fordoo ……听起来不太靠谱…… 没有类似的比较完善的框架么…… (>﹏<)
    fordoo
        4
    fordoo  
    OP
       Nov 10, 2015
    marshal 换到 msgpack ,关闭默认的 60 秒请求超时等一系列修改之后,刚刚 QPS 跑到了 59151 。
    CPU 使用率在 60-70%左右。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3502 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 00:14 · PVG 08:14 · LAX 17:14 · JFK 20:14
    ♥ Do have faith in what you're doing.