Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU with event I/O #11

Closed
cbr1k opened this issue Sep 1, 2012 · 6 comments
Closed

High CPU with event I/O #11

cbr1k opened this issue Sep 1, 2012 · 6 comments

Comments

@cbr1k
Copy link

cbr1k commented Sep 1, 2012

When activated event I/O (DigitalTrigger), it cause CPU usage to jump to >90%.

@alexanderhiam
Copy link
Member

Thanks for letting me know; I added a bit of delay into the event loop, and it should be down to around 50% CPU usage now. That's about as good as I can get it without really slowing it down. I plan to eventually interface a real event-driven framework like Twisted, but for now EventIO does an OK job.

@cbr1k
Copy link
Author

cbr1k commented Sep 1, 2012

Thank you very much for your great works.

@bduhan
Copy link

bduhan commented Sep 1, 2012

I have been using PyBBIO in Tornado's IOLoop and things are working well so far.

@cbr1k
Copy link
Author

cbr1k commented Sep 1, 2012

Bduhan, the I/O event is working but it cause the CPU usage very high. You have to check CPU usages with top command.

@bduhan
Copy link

bduhan commented Sep 4, 2012

Thank you cbr1k, I was mainly suggesting that alexanderhiam look into using Tornado or 'select.epoll' as an alternative to the polling loop in EventIO here. Both of these methods support adding/removing monitored FDs while the loop is running and Tornado has some nicer (low overhead) mechanisms for scheduling work in the future or after another action has completed.

As an anecdote, I have four devices that clock data into to my BeagleBone using edge triggered interrupt inputs (configured through sysfs) which are added and removed from Tornado's IOLoop on demand/schedule. When all four are enabled and a browser client is watching the data (highcharts, websockets) the CPU load for this process stays around 10-20%.

@alexanderhiam
Copy link
Member

Thanks bduhan, Tornado definitely sounds like a good option, I'll take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants