descrease PyTango.DeviceProxy() creation time
|
|
---|---|
Hi all, We are trying to create device proxies of multiple device servers using PyTango API.
But this takes approx 3 seconds to create one device proxy. It takes almost 1 minutes to create all device proxies. Can this time be reduced? or is there any other way to avoid this problem? Regards, tgmrt
Regards,
TCS_GMRT |
|
|
---|---|
Hi, very strange. When I create a DeviceProxy on my laptop it takes 100ms. I used this code to measure it: The output is If your DeviceProxy takes 3 seconds there is a problem with your setup. How long does it take to ping the host where the device is on? 3 seconds is the default timeout with Tango. Maybe your DeviceProxy is timing out and not really connecting to the device. Have you tried to ping the device with the Test device application in jive? How long does it take?Andy |
|
|
---|---|
|
Hi Andy, Just one comment concerning the benchmark: I think your test is a little bit unfair to Tango You include in benchmark the time to import PyTango. Changing it a bit gives more interesting numbers:
…which on my computer gives around 0.8 ms. |
|
|
---|---|
Hi all, Thank you Andy and TCoutinho for reply, As Andy said there is a problem with your setup,Particularly with network setup problems, remote host is not available on the local network. Because of which following errors can be also be seen, PyTango.ConnectionFailed: DevFailed[Clearly it can also be noted that time is taken equivalent to default timeout period. So we need to check if particular host is available or not in multiple-host environment before trying for device proxy. Any suggestions about how to check it in tango way? Regards, tgmrt
Regards,
TCS_GMRT |
|
|
---|---|
TCoutinhoYou are right. On my computer it took .43 ms/call. Not bad when you think it does a call to the database and device server … Andy |
|
|
---|---|
TCS_GMRT, you can check the host is available with a ping or telnet. I don't know if we can reduce the timeout at the import time from 3s to a few ms. I have to ask the experts. Then you could do a dev_ping(). This way you know if the device server and database are available. Cheers Andy |
|
|
---|---|
Hi Andy, Thanks for your suggestion, You can check the host is available with a ping or telnetWe are using python's system calls to ping to the host before trying for device proxies. And the time is reduced to some extent. About I don't know if we can reduce the timeout at the import time from 3s to a few ms. I have to ask the experts.Did you get any chance to talk with experts and what are their suggestion on this? Thanks and Regards, TCS_GMRT
Regards,
TCS_GMRT |