learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
457 stars 304 forks source link

KA-Lite High CPU Usage on Mac OSX Sierra #5426

Closed andydupont closed 7 years ago

andydupont commented 7 years ago

Summary

KA-Lite is contantly using large CPU % when started but idle

System information

How to reproduce

  1. Start KA-Lite App
  2. Open Activity Monitor and sort on % CPU

Screenshots

screen shot 2017-03-23 at 10 50 40 am

Real-life consequences

I assumed there was some kind of indexing going on so I let it run overnight, but it is still at high CPU usage after 12 hours. We are using this in a remote area where power is limited. The CPU is consuming lots of power doing something. Will this stop after a while?

radinamatic commented 7 years ago

@andydupont Thanks for reporting!

@mrpau-dev I will not have access to Mac machine until next week, to try and repro this issue, will you maybe be able to try it out before then?

andydupont commented 7 years ago

@radinamatic @mrpau-dev Here is another screenshot that shows that KA-Lite's parent process is Launchd, and Launchd's parent process is kernel_task.

the kernal_task is consuming a lot of memory and has a lot of disk activity.

Screenshot

screen shot 2017-03-23 at 11 28 43 am
benjaoming commented 7 years ago

I've encountered this, too, on a friend's Mac. Wasn't able to investigate back then, but it's about time, we investigate it. Thanks for the report @andydupont!

@andydupont Would you be able to install ka-lite from pip? It's to see if the problem is related to the installer and task tray application or the source distribution itself (this repository concerns the source distribution). You can uninstall KA Lite, then run sudo pip install ka-lite from command line, following which you can run kalite start.

mrpau-richard commented 7 years ago

I also reproduced this issue, I think it's the KA Lite application itself has a problem with CPU usage, we will investigate on it.

andydupont commented 7 years ago

From @benjaoming

@andydupont Would you be able to install ka-lite from pip? It's to see if the problem is related to the installer and task tray application or the source distribution itself (this repository concerns the source distribution). You can uninstall KA Lite, then run sudo pip install ka-lite from command line, following which you can run kalite start.

Ben... I will do this, but may not get to it until next week.

Thanks to all for looking into this.

andydupont commented 7 years ago

From @benjaoming

@andydupont Would you be able to install ka-lite from pip? It's to see if the problem is related to the installer and task tray application or the source distribution itself (this repository concerns the source distribution). You can uninstall KA Lite, then run sudo pip install ka-lite from command line, following which you can run kalite start.

Ben.... I uninstalled ka-lite and reinstalled from pip. The problem went away. So I think that means that the problem is with the source distribution.... correct?

benjaoming commented 7 years ago

This issue was moved to learningequality/ka-lite-installers#445