Ah, thanks. I'll have a look through those links. On 21 May 2015 at 07:54, Justin Israel <[email protected]> wrote:
> > > On Thu, May 21, 2015 at 6:48 PM Marcus Ottosson <[email protected]> > wrote: > >> then I believe each http connection is fully torn down each time. >> >> What does that mean? Is it of performance concern, or something else? >> > > http://en.wikipedia.org/wiki/HTTP_persistent_connection > > And an example, in practice, via the python requests library: > http://docs.python-requests.org/en/latest/user/advanced/#keep-alive > > The idea being that if you can keep your http connection alive, then it > can wait for the next request and avoid the whole set up and tear down of a > full http connection. But when I glanced at the source for the > SimpleXMLRPCServer, it seemed to completely shutdown the connection after > each request. This just means its not a fancy server, as indicated by the > "simple" prefix. > > >> >> >> On 21 May 2015 at 07:38, Justin Israel <[email protected]> wrote: >> >>> Interesting info. It talks about one of its implementations eliminating >>> the use of http. Although the standard python lib one, I believe uses an >>> http protocol. Also, if you aren't using that multicmd thing, then I >>> believe each http connection is fully torn down each time. >>> >>> On Thu, May 21, 2015 at 6:30 PM Marcus Ottosson <[email protected]> >>> wrote: >>> >>>> I just discovered this, gives some perspective to the performance of >>>> the built-in Python version. >>>> >>>> - http://xmlrpc-c.sourceforge.net/performance.php >>>> >>>> Using C, a client program starts (exec()), does 100 RPCs, and exits >>>> in 380 milliseconds. With just one RPC, it’s 26 ms. By calculation, this >>>> means the time for just an RPC is about 4 ms, about 280 RPCs per second. >>>> >>>> A tad sceptical that Python outperforms C though. :S >>>> >>>> >>>> On 21 May 2015 at 07:21, Justin Israel <[email protected]> wrote: >>>> >>>>> Ya like I said, I didn't have any concrete experience to offer. It >>>>> seems like it will work great for your use case. And if you needed >>>>> multiple clients to be able to connect, and they all handle reasonably >>>>> well, then why not. >>>>> >>>>> >>>>> >>>>> On Thu, May 21, 2015 at 6:08 PM Marcus Ottosson < >>>>> [email protected]> wrote: >>>>> >>>>>> 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 >>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODjOVSDP32Jk%3D2%3Dp5JB7ZGeaWuPj7r2sgu5YYN6nwnrPQ%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/CAPGFgA3MoTvAP4W1fig-eQFBWKB_ZNPHv0Oxpr9VtPYU068CrA%40mail.gmail.com >>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3MoTvAP4W1fig-eQFBWKB_ZNPHv0Oxpr9VtPYU068CrA%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/CAFRtmOALwOMc_Tf-DNp%3D_reZofEk%3D%2BcD0SBoN8Ek35oQVxAzoQ%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOALwOMc_Tf-DNp%3D_reZofEk%3D%2BcD0SBoN8Ek35oQVxAzoQ%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/CAPGFgA29eHoTyJVZSgb8%2BmJKGNhUQ4sKZXvOLMqU2wVGk5OOcQ%40mail.gmail.com >>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA29eHoTyJVZSgb8%2BmJKGNhUQ4sKZXvOLMqU2wVGk5OOcQ%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/CAFRtmOBShBrJMBdCiD_TPvkhHGvRyZd9VLJ8aAXyHq6mwKnwNQ%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBShBrJMBdCiD_TPvkhHGvRyZd9VLJ8aAXyHq6mwKnwNQ%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/CAPGFgA39fPS3B_qYKzfKAriWy%3DjPa6A%3DgvBj7sB0DPyKUXbL-A%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA39fPS3B_qYKzfKAriWy%3DjPa6A%3DgvBj7sB0DPyKUXbL-A%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/CAFRtmOAUr07W7OUORF%3DteF8hXQy2ZxtZP%3DmocgbT3AUMdvx9Lg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
