NorthernMan54 / homebridge-alexa

Expose your homebridge controlled devices to Amazon Alexa.
https://www.homebridge.ca
442 stars 77 forks source link

Rising CPU pi4 #515

Closed schweppy closed 2 years ago

schweppy commented 2 years ago

Hello

I have been trying to track down an increasing CPU issue on my Pi4 2GB RAM and have narrowed it down to this plug-in by enabling and disabling every plug-in on my homebridge server. I have to reset my Pi every few days as CPU slowly increases to about 70%, slowing the whole system down.

This I believe started since my previous issue with Alexa homebridge devices unresponsive. That issue was fixed by setting keep alive to 1 and refresh to 60.

Could these new settings be the cause of the CPU problem?

cheers

NorthernMan54 commented 2 years ago

Try backing off the refresh to the default of 900 aka 15 minutes.

On Apr 22, 2022, at 2:40 PM, schweppy @.***> wrote:

 Hello

I have been trying to track down an increasing CPU issue on my Pi4 2GB RAM and have narrowed it down to this plug-in by enabling and disabling every plug-in on my homebridge server. I have to reset my Pi every few days as CPU slowly increases to about 70%, slowing the whole system down.

This I believe started since my previous issue with Alexa homebridge devices unresponsive. That issue was fixed by setting keep alive to 1 and refresh to 60.

Could these new settings be the cause of the CPU problem?

cheers

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

schweppy commented 2 years ago

Fingers crossed this seems to have sorted it after the last 12 hours, my Pi is stable at 10% CPU! Thanks very much!

On 22 Apr 2022, at 23:47, Northern Man @.***> wrote:

 Try backing off the refresh to the default of 900 aka 15 minutes.

On Apr 22, 2022, at 2:40 PM, schweppy @.***> wrote:

 Hello

I have been trying to track down an increasing CPU issue on my Pi4 2GB RAM and have narrowed it down to this plug-in by enabling and disabling every plug-in on my homebridge server. I have to reset my Pi every few days as CPU slowly increases to about 70%, slowing the whole system down.

This I believe started since my previous issue with Alexa homebridge devices unresponsive. That issue was fixed by setting keep alive to 1 and refresh to 60.

Could these new settings be the cause of the CPU problem?

cheers

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

schweppy commented 2 years ago

Hmmm seems to have crept back up to high CPU again. Definitely slower than before but still 60% CPU compared to about 9% with this plug-in disabled?

On 23 Apr 2022, at 19:25, Andy Wareing @.***> wrote:

 Fingers crossed this seems to have sorted it after the last 12 hours, my Pi is stable at 10% CPU! Thanks very much!

On 22 Apr 2022, at 23:47, Northern Man @.***> wrote:

 Try backing off the refresh to the default of 900 aka 15 minutes.

On Apr 22, 2022, at 2:40 PM, schweppy @.***> wrote:

 Hello

I have been trying to track down an increasing CPU issue on my Pi4 2GB RAM and have narrowed it down to this plug-in by enabling and disabling every plug-in on my homebridge server. I have to reset my Pi every few days as CPU slowly increases to about 70%, slowing the whole system down.

This I believe started since my previous issue with Alexa homebridge devices unresponsive. That issue was fixed by setting keep alive to 1 and refresh to 60.

Could these new settings be the cause of the CPU problem?

cheers

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

NorthernMan54 commented 2 years ago

Do you have routines enabled ?

schweppy commented 2 years ago

No I don’t 😔

On 26 Apr 2022, at 00:29, Northern Man @.***> wrote:

 Do you have routines enabled ?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

NorthernMan54 commented 2 years ago

Could you DM me your homebridge.ca username via the homebridge discord server?

I want to see what level of traffic is being generated by your account.

The plugin should not be cpu intensive, unless it is busy with requests or cache refreshes. Outside of routines it should be idle.

On Apr 26, 2022, at 6:51 AM, schweppy @.***> wrote:

 No I don’t 😔

On 26 Apr 2022, at 00:29, Northern Man @.***> wrote:

 Do you have routines enabled ?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

schweppy commented 2 years ago

No probs. Can you DM on GitHub? Lol

schweppy commented 2 years ago

Anyway it’s the same as on here. Schweppy

NorthernMan54 commented 2 years ago

I looked at the dashboards, and was expecting more requests or ?? But your plugin is not that busy.

There are some users with a couple of requests a minute going thru their plugin, but you are quiet in comparison.

image

This is from my RPI 3 - it has been running since April 16th. CPU is 0.1%

ps -e -o pid,pcpu,pmem,args --sort=pcpu | grep homebridge
21221  0.0  0.0 grep homebridge
30317  0.0  8.3 homebridge: homebridge-tcc
30338  0.0  7.1 homebridge: homebridge-dht
30344  0.0  5.7 homebridge: homebridge-http-irblaster
30303  0.1  8.1 homebridge-config-ui-x
30309  0.1  5.8 homebridge: homebridge-webos-tv
30324  0.1  7.8 homebridge: homebridge-alexa
30331  0.1  7.5 homebridge: homebridge-alexa
30277  0.2 14.3 homebridge
30316  0.2  8.5 homebridge: homebridge-warmup4ie

Can you share what yours shows for this command? Also the version of NodeJS you are running

There was this https://github.com/homebridge/homebridge/issues/2679 reported before against homebridge itself, and I wonder if it is related.

PS And I do have two copies of the plugin running, one for the household account and one my kids ( they have their own Alexa's and Alexa accounts )

schweppy commented 2 years ago

Do you get a breakdown of CPU any plug-in as you are using child bridges in homebridge?

Running that command I only get -

3684 0.0 0.0 grep --color=auto homebridge 25260 91.4 18.6 homebridge

Ah so it might be homebridge itself and not a plug-in. I’ll try disabling Alexa for 24 hours again and seeing if it makes a difference.

Many thanks for your help

On 26 Apr 2022, at 16:25, Northern Man @.***> wrote:

 I looked at the dashboards, and was expecting more requests or ?? But your plugin is not that busy.

There are some users with a couple of requests a minute going thru their plugin, but you are quiet in comparison.

This is from my RPI 3 - it has been running since April 16th. CPU is 0.1%

ps -e -o pid,pcpu,pmem,args --sort=pcpu | grep homebridge 21221 0.0 0.0 grep homebridge 30317 0.0 8.3 homebridge: homebridge-tcc 30338 0.0 7.1 homebridge: homebridge-dht 30344 0.0 5.7 homebridge: homebridge-http-irblaster 30303 0.1 8.1 homebridge-config-ui-x 30309 0.1 5.8 homebridge: homebridge-webos-tv 30324 0.1 7.8 homebridge: homebridge-alexa 30331 0.1 7.5 homebridge: homebridge-alexa 30277 0.2 14.3 homebridge 30316 0.2 8.5 homebridge: homebridge-warmup4ie Can you share what yours shows for this command? Also the version of NodeJS you are running

There was this homebridge/homebridge#2679 reported before against homebridge itself, and I wonder if it is related.

PS And I do have two copies of the plugin running, one for the household account and one my kids ( they have their own Alexa's and Alexa accounts )

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

NorthernMan54 commented 2 years ago

I'm using child bridges, and what your seeing from the PS command is each child bridge, which is conveniently named with the plugin it supports.

schweppy commented 2 years ago

So it seems Alexa is not the problem. I think it may be a homebridge related issue as have now disabled all plugins one at a time.

On 26 Apr 2022, at 23:57, Northern Man @.***> wrote:

 I'm using child bridges, and what your seeing from the PS command is each child bridge, which is conveniently named with the plugin it supports.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

NorthernMan54 commented 2 years ago

Maybe a switch to child bridge's so you can isolate them further ?

Closing this as it it not an issue with the Alexa plugin