Has somebody experimented some limitations with a Python client that connects to a lot of devices?
At SOLEIL, we have some scripts that connect to lots of devices.
With the following example and around 15 000 devices, it systematically returns the same errors at the end of the script (around 800/1000 errors per execution). The error returned is:
dbds=Database()
res=dbds.get_device_exported('*')
i=0
j=0
for dev in res:
i=i+1
try:
DeviceProxy(dev).state()
except Exception, ex:
j=j+1
print ex
print "errors", j
print i
Is there an known limitation?
Is there a way to workaround theses errors?
Or is it a bug?
Are you sure the devices for which you are getting some errors are really up and running?
A device can be flagged as exported in the Database but could actually be stopped.
It could still be flagged as exported in the Database because it was not stopped correctly (crash, kill -9)?
The remark from Tiago related to resources limits is interesting too.
I’ve seen you could get IMP_LIMIT CORBA system exceptions too with your example when executed on a big Tango database.
[quote]This exception indicates that an implementation limit was exceeded in the ORB run time. For example, an ORB may
reach the maximum number of references it can hold simultaneously in an address space, the size of a parameter may
have exceeded the allowed maximum, or an ORB may impose a maximum on the number of clients or servers that can
run simultaneously.[/quote]
As suggested by Tiago, we have done a test increasing the number of file descriptors (that was 1024) and tracking the number of open connections while the script is running: it goes up to 4500. So increasing this parameter fixes our problem.
But, why is there so many connections opened at the same time while this script is only sequential? Is there a way to force connection closing?
FYI, we have done also a test of adding a “while true loop” at the end of the script, and it takes around 2 minutes for all connections to be closed.