nicolargo / glances

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
http://nicolargo.github.io/glances/
Other
26.83k stars 1.53k forks source link

Glances process staying asleep instead of reporting #2186

Closed spikeygg closed 1 week ago

spikeygg commented 2 years ago

I have glances installed on six machines in my house (two orange pis, a raspberry pi, a small ITX board, a NUC, and a server). It works great on all of them except for the raspberry Pi (which is a Voron 2.4 running raspbian). I watch all the data from a dashboard on Home Assistant and it seems the glances process on the Voron 2.4 raspberry Pi machine (Pi4 /w 8GB ram) is always sleeping. What's strange is that I can hit the URL and it will eventually respond (albeit very slow to come up on the first hit, takes literally 10s to pop up) and then it will record some data in Home Assistant for a while but eventually it goes back to sleep and stops reporting to Home Assistant.

I tried making the glances process on that machine "less nice" setting the "nice" number to -1 ahead of nearly all other processes but it still sleeps most of the time. I think it might be related to the raspbian OS preferring a low-power state... I just don't know where to look for that kind of a switch. I ran raspi-config but didn't see anything that looked promising in there.

To Reproduce Steps to reproduce the behavior:

  1. I start glances on the Voron 2.4 Pi

  2. Allow it to run for some time, the process goes to sleep

  3. I see that the values in the Home Assistant chart are static for hours: image

  4. Attempt to navigate to the glances URL and see that the process isn't dead - URL takes about 10 seconds to come up.

  5. After bringing up the glances URL, the Home Assistant chart refreshes and shows a new datapoint, revealing that the history was stuck: image

Expected behavior As all the other machines in my house, I'd expect to have continuous data points recorded in Home Assistant as the process serves them up. I assume that the process is going to sleep shortly after I manually visit the glances URL.

Screenshots I have attached screenshots above in my "To Reproduce" section.

Desktop (please complete the following information):

Additional context This has been an issue for nearly a year and I periodically Google to try to find a resolution but I have never found anyone else with the same kind of problem. I'd love to get to the bottom of this so if you have any suggestions of things to try, I'm all ears.

nicolargo commented 2 years ago

Hi @spikeygg, first of all thanks for this complete issue report.

It is not easy to investigate on my side because i did not have any Raspberry Pi. So can you please make a simple test by disabling the top comsuming plugins ?

Just run Glances with the --disable-plugin processcount,connections option.

Is it better ?

spikeygg commented 2 years ago

Thanks for the response @nicolargo! I understand the difficulty you pointed out. I'm happy to help debug on my end if you have any more suggestions. I just restarted the service with the switches you recommended, I'll let it run for 24hrs and let you know tomorrow how it responds.

spikeygg commented 2 years ago

I took a look at the Home Assistant charts just now and it looks like they're stagnating just like before. :(

It's probably some indirect environment variable in raspbian and not directly related to glances. :-/

spikeygg commented 1 year ago

I tried something different, tonight. I realized recently that there's a docker container for glances. I really like running things in containers so I uninstalled the glances app from my Linux installation and installed the docker container version. When I got it up and running I verified that the web interface worked and looked correct.

I reconnected Home Assistant to it and watched it, it was working. However, I closed the web interface tab for glances and within a minute or two after closing the web interface tab the Home Assistant entities went unavailable. They stay that way until I manually reopen the web interface in my browser. This problem is super weird!

The other thing I notice, is when I navigate back to the web interface page after it has gone dormant. It takes a while to pull it up, like 10 seconds of a blank webpage, then it displays all the glances stuff. Anyway, more data points.

bignay2000 commented 1 year ago

I tried something different, tonight. I realized recently that there's a docker container for glances. I really like running things in containers so I uninstalled the glances app from my Linux installation and installed the docker container version. When I got it up and running I verified that the web interface worked and looked correct.

I reconnected Home Assistant to it and watched it, it was working. However, I closed the web interface tab for glances and within a minute or two after closing the web interface tab the Home Assistant entities went unavailable. They stay that way until I manually reopen the web interface in my browser. This problem is super weird!

The other thing I notice, is when I navigate back to the web interface page after it has gone dormant. It takes a while to pull it up, like 10 seconds of a blank webpage, then it displays all the glances stuff. Anyway, more data points.

I have a similar experience with Glances 3.4.0.3 running in Docker on a Linux VM... The page hangs and then after a few attempts the page loads. Submitted https://github.com/nicolargo/glances/issues/2453 bug report

BartGysens commented 1 year ago

I'm having the same issue here: Glances stops sending data after a while (2 minutes); when I access via the url, it restarts and sends data to HA again. Folow.

spikeygg commented 10 months ago

I ran a little test today after re-installing the OS (32-bit bookworm now) on this system. Previously, it was 64-bit bullseye. Anyway, I installed the docker setup and ran the glances container. I then held a browser tab open to the glances webpage for an hour (on a remote PC) while also watching the Home Assistant history. I could see that it was getting some data periodically but it also had dropouts. Eventually, I closed the tab and kept watching and at that point the connection dies between Home Assistant and the glances host. Here's a visual representation of that: image

This "Voron" system also hosts services for controlling a connected 3D printer via web-services and those work flawlessly; so, I'm pretty sure the problem is something inside the glances container.

Joe13183 commented 10 months ago

I'm having the same issue on ubuntu :-(

github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 3 months with no activity.

nicolargo commented 4 months ago

Anyone encounter this issue with Glances 4 ?

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 3 months with no activity.

nicolargo commented 1 week ago

I close the issue because no news about it after upgrading to Glances 4.x.