I wasn’t really having any problems with it, I was more wondering whether
any of you had had any experience with it.

Considering it’s from 2001-2002, has a rather ugly import (with non-PEP08
names) spread across two top-level modules (for client and server) and
contains the word “XML”, I can understand how a first impression might have
gotten spoiled.

But it looks and works great.

It also supports batched calls; as in gathering up any number of RPC and
sending them through a single request. I wish I came across this ages ago.
:O

Some tests, with a single provider and consumer. Not fair, probably, it
should probably use multiple consumers to show a difference here, but
singles is all I’m looking for personally.

*Synchronous 1600/sec*

from SimpleXMLRPCServer import SimpleXMLRPCServerimport SocketServer
def null():
    return True

server = SimpleXMLRPCServer(("0.0.0.0", 80), logRequests=False)
server.register_function(null)
server.serve_forever()

*Threaded 1222/sec*

from SimpleXMLRPCServer import SimpleXMLRPCServerimport SocketServer
def null():
    return True
class ThreadedServer(SocketServer.ThreadingMixIn, SimpleXMLRPCServer):
    pass

server = ThreadedServer(("0.0.0.0", 80), logRequests=False)
server.register_function(null)
server.serve_forever()

*Forked 380/sec*

from SimpleXMLRPCServer import SimpleXMLRPCServerimport SocketServer
def null():
    return True
class ForkingServer(SocketServer.ForkingMixIn, SimpleXMLRPCServer):
    pass

server = ForkingServer(("0.0.0.0", 80), logRequests=False)
server.register_function(null)
server.serve_forever()

*Test*

$ python -m timeit "import xmlrpclib;p =
xmlrpclib.ServerProxy('http://192.168.131.153:8000');print p;[p.null()
for x in xrange(100)]"

​

On 20 May 2015 at 21:50, Justin Israel <[email protected]> wrote:

> Awesome. I only glanced at the standard library implementation, and it
> seemed pretty basic. So if it gets you the performance you are after, then
> that solves a problem.
>
> On Thu, May 21, 2015 at 8:33 AM Marcus Ottosson <[email protected]>
> wrote:
>
>> Thanks Justin.
>>
>> It does actually support concurrent responses, both threaded and forked,
>> so I wouldn't be surprised if it could scale quite a bit as-is.
>>
>> On my machine, it handles around 1600 (synchronous) requests/second.
>>
>> Out of curiosity, I'll have a quick look to see what threading or forking
>> can do about it. Alternatively, I also found this
>> <http://sourceforge.net/projects/py-xmlrpc/>, but the main attraction to
>> me is standard library inclusion.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCOgXDFPLNuK_Pn%2BDsTEtY2FsDfnnYujYkMnTxeiE5cXA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCOgXDFPLNuK_Pn%2BDsTEtY2FsDfnnYujYkMnTxeiE5cXA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2iRDvXk2rXJdx4Cm1LTP9qviiDFUWAjf_1FdTqX_WAEA%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2iRDvXk2rXJdx4Cm1LTP9qviiDFUWAjf_1FdTqX_WAEA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODjOVSDP32Jk%3D2%3Dp5JB7ZGeaWuPj7r2sgu5YYN6nwnrPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to