# XmlRpc python deamon really slow

**URL:** <https://forum.universal-robots.com/t/xmlrpc-python-deamon-really-slow/714>\
**Category:** URCaps SDK\
**Created:** [April 21, 2017, 1:57pm UTC](https://forum.universal-robots.com/t/xmlrpc-python-deamon-really-slow/714 "2017-04-21T13:57:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon58840761](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@anon58840761](https://forum.universal-robots.com/u/anon58840761)\
**Post date:** [April 21, 2017, 1:57pm UTC](https://forum.universal-robots.com/t/xmlrpc-python-deamon-really-slow/714/1 "2017-04-21T13:57:47Z")

</div>

Hi, I get really slow responds time using my URCap on a UR5, the delay is lasting about 8 sec, but when I’m using it on the ursimulator it runs smoothly with no delay at all. Any ideas of why ?  
here is my function getNumber() which I defined in my InstallationNodeContribution using the ScriptWriter:

```
public void generateScript(ScriptWriter writer) {
    writer.globalVariable(XMLRPC_VARIABLE, "rpc_factory(\"xmlrpc\", \"http://127.0.0.1:40404\")");

    writer.appendLine("def getNumber():");
    writer.appendLine("return " + XMLRPC_VARIABLE + ".get_number()");
    writer.appendLine("end");
} 

```

**My Daemon:**

```
#! /usr/bin/env python
import xmlrpclib
from SimpleXMLRPCServer import SimpleXMLRPCServer

def get_number():
    return 42

server = SimpleXMLRPCServer(("127.0.0.1", 40404))
server.register_function(get_number, "get_number")
server.serve_forever()

```

**Running a simple program:**

 ![](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/3b5e4aff70e16e24de2ac0829e7d2c82e7536166.png)

As mentioned the program runs fine on the ursimulator, but I can’t believe that a daemon runs this slowly on a real robot, I must have done something wrong. Help would be very appreciated, thanks.

---

<div class="post-metadata">

**Author:** ![anon58840761](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@anon58840761](https://forum.universal-robots.com/u/anon58840761)\
**Post date:** [April 24, 2017, 10:51am UTC](https://forum.universal-robots.com/t/xmlrpc-python-deamon-really-slow/714/2 "2017-04-24T10:51:36Z")

</div>

Okay I found out that the python daemon isn’t running fast at all, compared to the c++ daemon.  
So I suggest using a C++ daemon, especially when running multiple Capps on the machine.

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [April 28, 2017, 12:49pm UTC](https://forum.universal-robots.com/t/xmlrpc-python-deamon-really-slow/714/3 "2017-04-28T12:49:24Z")

</div>

@anon58840761

We are not able to re-produce this behaviour.  
8 seconds is a long time.

The average latency for daemons on CB3.1 controllers is 8 ms, and 8-16 ms on CB3.0 controllers.  
Since the CB3.0 controller has a inferior CPU to the CB3.1, it will take a bit longer to initialize the daemon as well.  
But we have not been able to delay 8 sec.
