amsbr / OctoPrint-Stats

24 stars 15 forks source link

High CPU usage after update to 2.0. Octoprint unresponsive #22

Open pattonwebz opened 5 years ago

pattonwebz commented 5 years ago

Hey,

I have been using this plugin since for about a year now and it worked great with no issues till the latest update. During the update it took a long time and there is the chance that it failed part way through or timed out.

I do not think my issues is the same as #18, #20 or #21. I have no NaN error that I can see and also my stats do show (if I wait on the tab for about 3 minutes).

Ever since the update certain events cause CPU to run 100% locking up the thread and making the interface unresponsive until the plugin finishes it's task. This takes about 3-5 minutes to become responsive again. When this happens during printing it is a visible slowdown (it literally stops between moves), I've just stopped the print anytime this happens so I do not know if it recoverable if it happens during printing.

I have installed 2.0.1pre but the high cpu load persists.

I checked my system and I have pandas and tinydb installed. Numpy is also installed although I believe I installed that before for a different purpose.

Edit: I am using a pi3 and I have tested replacing the SD card with another known good one.

amsbr commented 5 years ago

Hi @pattonwebz!

Is it possible to share the stat database file octoprint_stats.json stored in Octoprint logs folder?

pattonwebz commented 5 years ago

Hey @amsbr sorry for delay in replying here. I am attaching the db file here however after cat octoprint_stats.db.bak I can see around all the weird characters that the db contains things about heating failures and some other seemingly error related messages.

octoprint_stats.db.zip

Makes me think my database has somehow become corrupted and that would explain the very long processing times and CPU load. I do have a companion .json could I perhaps rebuild my database from that file?

Any assistance you can offer here is very much appreciated. I've used this plugin since I got this printer and I would like to try keep that data as I think it's pretty cool to have a record of all of that.

Thanks so much for making this plugin - I enjoy having it very much :smile:

amsbr commented 5 years ago

Hi @pattonwebz!

db file used in version 1 of the plugin, it converted to JSON in this version. I will analyze the file in my instance to identify the problem. I will inform you soon.

Do you use a pi3 correct?

pattonwebz commented 5 years ago

Thank you for your assistance :)

Yes I use a Pi3

gretel commented 5 years ago

i've also run into this and took me quite a while to figure... https://github.com/foosel/OctoPrint/issues/3160#issuecomment-540689273

amsbr commented 5 years ago

Hi,

I go to fix this issue in some days, I'm testing the new version

amsbr commented 5 years ago

Hi,

Please try the new release, dedicated to reducing CPU usage, and to fix event registration during print.

2.0.2