skip to navigation
skip to content

mprpc 0.1.2

A fast MessagePack RPC library

Latest Version: 0.1.16

mprpc is a lightweight MessagePack RPC library. It enables you to easily build a distributed server-side system by writing a small amount of code. It is built on top of gevent and MessagePack.


To install mprpc, simply:

$ pip install Cython
$ pip install mprpc


$ easy_install Cython
$ easy_install mprpc


RPC server

from gevent.server import StreamServer
from mprpc import RPCServer

class SumServer(RPCServer):
    def sum(self, x, y):
        return x + y

server = StreamServer(('', 6000), SumServer)

RPC client

from mprpc import RPCClient

client = RPCClient('', 6000)
print'sum', 1, 2)

RPC client with connection pooling

import gsocketpool.pool
from mprpc import RPCPoolClient

client_pool = gsocketpool.pool.Pool(RPCPoolClient, dict(host='', port=6000))

with client_pool.connection() as client:
    print'sum', 1, 2)


mprpc significantly outperforms the official MessagePack RPC (1.8x faster), which is built using Facebook’s Tornado and MessagePack, and ZeroRPC (14x faster), which is built using ZeroMQ and MessagePack.



% python benchmarks/
call: 9508 qps
call_using_connection_pool: 10172 qps

Official MesssagePack RPC

% pip install msgpack-rpc-python
% python benchmarks/
call: 4976 qps


% pip install zerorpc
% python benchmarks/
call: 655 qps


Documentation is available at

File Type Py Version Uploaded on Size
mprpc-0.1.2.tar.gz (md5) Source 2014-03-07 68KB
  • Author: Studio Ousia
  • Home Page:
  • Keywords: rpc,msgpack,messagepack,msgpackrpc,messagepackrpc,messagepack rpc,gevent
  • License:
    Copyright 2013 Studio Ousia
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
  • Package Index Owner: ousia, ikuyamada
  • DOAP record: mprpc-0.1.2.xml