Announcement

Collapse
No announcement yet.

Snap connect python library 100% CPU usage.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Snap connect python library 100% CPU usage.

    We are trying to setup a snap mesh system where we have a network of 100+ snap nodes and we are trying to write a python controller script for these nodes using snapconnect python library.

    The basic functionality is working correctly. The only problem right now, is that when the script is running the CPU usage spikes upto 100%. I am running this on an ubuntu dual core machine, so that would essentially mean that one of the core is completely utilized by the script.

    Looking at the synapse reference manual I see that there are two ways to serve queued requests. Either by a) calling loop() or b) calling poll(). Our script is currently using the loop() method. I think I should do a periodic poll() instead but I am not sure. Is there any limit on the queue length for snapconnect? If I do a poll() every 5 seconds, is it possible that the incoming requests are more then the queue can handle?

    In addition to the answer, any good suggestions to make the system better are more than welcomed

    Thanks
    Akif
X