mycontroller-org / mycontroller-v1-legacy

The Open Source Controller
http://www.MyController.org
Apache License 2.0
148 stars 90 forks source link

Slow response, high cpu and errors in log #359

Closed Redferne closed 7 years ago

Redferne commented 7 years ago

My MC instance on a RPI3 slowed to a crawl and hogged 99% of the CPU. There are alot of SQL errors in the log. Is this normal? Log here:

https://drive.google.com/file/d/0B9erfGyVgWBlX1BncHRzQThqcFU/view?usp=drivesdk

jkandasa commented 7 years ago

@Redferne Is this latest version of SNAPSHOT? recently I have changed database version. That might fix this issue.

Redferne commented 7 years ago

@jkandasa New log available on todays snapshot. Not sure if I feel any difference. Still sluggish and drawing graphs spanning a month takes forever on my Raspberry Pi 3. Still some errors in the log though. (https://drive.google.com/file/d/0B9erfGyVgWBlMWZjeFRTQTJsWFk/view?usp=drivesdk)

cimba007 commented 7 years ago

Got the same feeling. After I upgraded to the snapshot like 1-2 weeks ago everything feels "slow".

Selecting different time-spans for battery-level doesn't work at all.

Selected last month .. nothing changes ..

image

Upadte: Currently testing snapshot from 12.02. .. battery history seems to be still broken?! Performance is under test

jkandasa commented 7 years ago

@Redferne @cimba007 Can you post screen shot of Status >> System status

cimba007 commented 7 years ago

(History of SensorValues is working fine btw! Only VCC-History not)

image

jkandasa commented 7 years ago

@cimba007 you mean only battery graph is not working good?

cimba007 commented 7 years ago

Yeah,

upon chganging the interval I can observe that there timestampFrom is changed according to dropdown option. Check the second picture. The returned values do not reflect timestampFrom but are all the same no matter what value I pick from History-Dropdown option.

image

image

Edit: Maybe related to this change?

https://github.com/mycontroller-org/mycontroller/commit/06c0607703d8337d9c5f85df9b63419026f1be2e

(The REST api is with timestampFrom, duration etc. is working fantastic btw.!!!)

Redferne commented 7 years ago

@cimba007

Cool log. Which tool do you use to visualise the api calls?

cimba007 commented 7 years ago

Its called "Fiddler" (http://www.telerik.com/fiddler) most powerful http(s) Debugger i know

Am 19. Februar 2017 21:36:17 MEZ schrieb Redferne notifications@github.com:

@cimba007

Cool log. Which tool do you use to visualise the api calls?

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/mycontroller-org/mycontroller/issues/359#issuecomment-280946808

-- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

jkandasa commented 7 years ago

@cimba007 You are genius :) Yes, https://github.com/mycontroller-org/mycontroller/commit/06c0607703d8337d9c5f85df9b63419026f1be2e caused this issue.

You have to change on https://github.com/mycontroller-org/mycontroller/blob/development/dist/src/main/package/www/controllers/nodes.js#L393 and https://github.com/mycontroller-org/mycontroller/blob/development/dist/src/main/package/www/controllers/nodes.js#L406 as follows,

I will add this fix soon.

cimba007 commented 7 years ago

Nice, glad you found it so quickly!

cimba007 commented 7 years ago

@jkandasa: fixed, is working again, ty