Skip to main content

A fast MessagePack RPC library

Project description

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,
See the License for the specific language governing permissions and
limitations under the License.

Description: mprpc

.. image::

.. image::

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:

.. code-block:: bash

$ pip install mprpc


.. code-block:: bash

$ easy_install mprpc


RPC server

.. code-block:: python

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

.. code-block:: python

from mprpc import RPCClient

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

RPC client with connection pooling

.. code-block:: python

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 <>`_.


.. image::
:width: 550px
:height: 150px
:alt: Performance Comparison


.. code-block:: bash

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

Official MesssagePack RPC

.. code-block:: bash

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


.. code-block:: bash

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


Documentation is available at

Keywords: rpc,msgpack,messagepack,msgpackrpc,messagepackrpc,messagepack rpc,gevent
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mprpc-0.1.17.tar.gz (116.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page