Announcement

Collapse
No announcement yet.

HS3 full on a PI - Memory Utilization

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HS3 full on a PI - Memory Utilization

    Hi folks, I'm running HS3 on a RPI2- It was working well and with reasonable memory utilization on v177..

    I updated it to v182-After that it began to hang once in a while and I began checking available memory. It seems to be going lower than I noticed in the past....Available memory is dropping into the double digits....eventually it will hang or slow down till I restart the HS3.


    I loaded BLGarbage and it didn't seem to help (removed now)
    I updated to v187, no change
    I reinstalled at V177 and then V182 with the full builds and it still has not improved.
    I performed an apt-get upgrade and RPI-update...also but that has not made any difference.


    Notes...
    only Plugins are: Mark Sandler - Insteon, WeatherXML, HSTouch.

    My questions are...
    Is this memory consumption normal with HS3 on a PI2 B
    IS there a script I can run schedule that wil clear it up (outside of killing and restarting HS3)
    Looking for any other suggestion to resolve

    Thanks
    Any help would be appreciated.




    #2
    Here I am running Current version is: HS3 ZEE S2 Edition 3.0.0.187 on the RPi2.

    Using Z-Wave + GPIO and the OmniPro II HAI Plugin. I see the utilization now in to the double digit where it was single digits before.

    Not too noticeable here though. I do not see it hanging though.

    Have you disabled one or the other plugins?

    If you shut down HS and restart it does it get faster?

    I am not currently using HSTouch and WeatherXML .31 is on the bigger box. WeatherXLM is doing a bunch these days. Nothing noticeably on the Buntu 64 bit box running via iSeries at this time.
    Attached Files
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

    HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment


      #3
      Have you disabled one or the other plugins?

      I have tried disabling Insteon and WeatherXML. leaving Only HSTouch and the problem did not subside-memory use still went up.

      I enabled Insteon and continue to run HSTouch and completely removed any other plugin and my memory use is over 500 MB after 30 minutes up time.


      If you shut down HS and restart it does it get faster?

      Somewhat....But at least it starts to work!
      What is noticeable is that a some point "MY HomeSeer" stops working but I can still access through HSTouch on Android.

      I going to disable HStouch next.

      Comment


        #4
        Try also turning on debug for the HSTouch stuff.

        The busier your screens are the more chit chat you will see in the debug logs.

        Put a digital clock with seconds on the screen and watch.

        Here I brought my test HS3 touch screen down to a crawl adding a few mini HD CCTV cams to the display.
        - Pete

        Auto mator
        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

        HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
        HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

        X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

        Comment


          #5
          Well it isn't HSTOUCH.

          With HStouch disabled and removed!-Memory utilization is over 600 MB after an hour.

          Comment


            #6
            Drawing at straws here.

            I did have an issue with a brand new Samsung MicroSD card a couple of weeks ago. I would make the image. It would run for a short time then just quit. Not sure what the memory utilization was but thinking I was having RW issues I went to another card and all was fine then.

            When you SSH to the device and do a top it will tell you which of the processes are using the most memory up. What are you using now to tell what you utilization is? I am guessing you are already using top?
            - Pete

            Auto mator
            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

            HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
            HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

            X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

            Comment


              #7
              Here are two commands

              HSConsole.exe is using 658804

              cat /proc/meminfo | grep 'MemAvailable'
              MemAvailable: 267368 kB

              ps aux | grep 'HSConsole'
              root 14508 0.0 0.2 4592 2288 pts/2 S+ 14:34 0:00 sudo mono HSConsole.exe --log
              root 14509 8.5 69.3 713444 658804 pts/2 Sl+ 14:34 25:39 mono HSConsole.exe --log
              pi 16451 0.0 0.1 3556 1856 pts/0 S+ 19:33 0:00 grep --color=auto HSConsole
              pi@rpi1 ~ $

              Thanks for trying to help out!

              Comment


                #8
                I'm running .181 on a Pi2 with 5 plugins and lots of devices and events. Here's your same commands on my system:

                PHP Code:
                homeseer@RPi2 ~ $ cat /proc/meminfo grep -i memavailable
                MemAvailable
                :     321748 kB
                homeseer
                @RPi2 ~ $ ps aux |grep -i hsconsole
                root      2171 12.3 24.6 285480 188308 
                ?       Sl   Jun09 1572:29 mono HSConsol .exe
                homeseer 16760  0.0  0.2   2448  1544 pts
                /0    S+   09:02   0:00 grep --color=auto -i hsconsole 
                From your command output, you have 2 HSConsoles running? I cant tell if the sudo is actually the parent process of the mono process you listed. How are you starting HS3?
                HS4Pro on a Raspberry Pi4
                54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                HSTouch Clients: 1 Android

                Comment


                  #9
                  Typically I am running a script from init.d but I just rechecked using the buit in ./go script. I ran as root and as pi and got the same result.

                  I just for kicks I will let it run from the console and see what happens with the memory but I have done this before and go the same result and continue to experiment to see why it may be spawning two exe's

                  thanks for your comment!

                  Comment


                    #10
                    So...after running with ./go I get the same process list that I was getting before along with the same memory consumption.


                    So if there are two processes running when there should only be one, then that may be my issue.

                    I have tried to use the ./go script (forget about using nohup and & to background the job)
                    I have tried to launch the commands in the ./go script manually

                    I continue to get the same result.

                    I notice [rmasonjr] that you don't have a process running as root. did you remove the SUDO command from the ./go script (and change the webserver port)?

                    Comment


                      #11
                      So if there are two processes running when there should only be one, then that may be my issue.
                      Homeseer 3 will sometimes create a new web interface one port number up from the one running. IE: if you run HS3 on port 80; new instance will be on port 81.

                      Here I have been flippant with my autostart using either upstart or a cron job disabling or enabling each via Webmin.

                      Here is my upstart command. It is generic. Just looked at my Zee-2 and I am only running the upstart command and nothing else to autostart HS3.

                      Note too that I moved my HomeSeer directory to the root /HomeSeer instead of the default of /usr/local/HomeSeer

                      Been now running CumulusMX on another RPi2. It runs using MONO. Someone on the Cumulus forum wrote a combination / editable cron and upstart command script for starting CumulusMX. The editable options relate to testing stuff. I was going to give that one a try for HomeSeer3.

                      Code:
                      #!/bin/bash
                      NAME='HomeSeer'            # Server handle for the screen session
                      DIR='/HomeSeer'
                      USER='root'                # Start HomeSeer as root. You may use a non privileged user
                                                 # Note: if homeseer is running as non-root user
                                                 # remove 'sudo' command in file 'go' in HomeSeer folder
                                                 # and change setting gWebSvrPort to value > 1024 in settings.ini
                      PWD=`pwd`
                      RETVAL=0 
                      
                      service_start() {
                          if [ -f /var/run/$NAME.pid ]; then
                              if [ "$(ps -p `cat /var/run/$NAME.pid` | wc -l)" -gt 1 ]; then
                                  echo -e "$NAME is already running (pidfile exists)."
                                  return 1
                              else
                                  rm -f /var/run/$NAME.pid
                              fi
                          fi
                          [ -f $DIR/go ] && cd $DIR && su -c "/usr/bin/screen -S $NAME -d -m ./go" $USER
                          cd $PWD
                          sleep 5
                          ps -ef | egrep "[S]CREEN.+${NAME}" | awk '{ print $2 }' > /var/run/$NAME.pid
                          [ -s /var/run/$NAME.pid ] && echo "$NAME started."
                      }
                      
                      service_stop() {
                          if [ -f /var/run/$NAME.pid ]; then
                              if [ $(ps -ef | egrep -c "[S]CREEN.+$NAME") -ge 1 ]; then
                                  #invoke shutdown command to homeseer...
                                  for char in $(printf "\\r s h u t d o w n \\r") ; do 
                                      su -c "/usr/bin/screen -p 0 -S $NAME -X stuff $char" $USER
                                      sleep 0.1
                                  done
                                  sleep 15
                              fi
                              if [ "$(ps -p `cat /var/run/$NAME.pid` | wc -l)" -gt 1 ]; then
                                  echo -e "$NAME did not stop gacefully. Killing it"
                                  [ -s /var/run/$NAME.pid ] && kill `cat /var/run/$NAME.pid`
                              fi
                              rm -f /var/run/$NAME.pid
                          else
                              echo -e "$NAME is not running."
                          fi
                      }
                      
                      case "$1" in
                      'start')
                          service_start
                      ;;
                      'stop')
                          service_stop
                      ;;
                      'restart')
                          service_stop
                          sleep 5
                          service_start
                      ;;
                      *)
                          echo "Usage $0 start|stop|restart"
                      esac
                      # --------------------------------------------------------
                      Here is my cron (one liner).
                      - Pete

                      Auto mator
                      Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

                      HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                      HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                      X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                      Comment


                        #12
                        Originally posted by kamishki View Post
                        So...after running with ./go I get the same process list that I was getting before along with the same memory consumption.


                        So if there are two processes running when there should only be one, then that may be my issue.

                        I have tried to use the ./go script (forget about using nohup and & to background the job)
                        I have tried to launch the commands in the ./go script manually

                        I continue to get the same result.

                        I notice [rmasonjr] that you don't have a process running as root. did you remove the SUDO command from the ./go script (and change the webserver port)?
                        Running sudo with root is not needed. sudo gives root privileges to other users like user homeseer.
                        HS4Pro on a Raspberry Pi4
                        54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                        Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                        HSTouch Clients: 1 Android

                        Comment


                          #13
                          True....
                          But I am not logging in as root.
                          The result I displayed was running "go" as PI.

                          As a test, I changed the HTTP Port to 8080, CHMODed the files to allow PI full access to the files then executed the start-up as non-privliged (no sudo).

                          The results is....I now have only the one mono process instead of two but it is still consuming memory at the same rate.

                          Comment


                            #14
                            Just to close out this issue....I noticed that along with memory utilization, the Homeseer process was also hitting the processor with between 50 and 75% utilization.

                            I did find the issue. After starting from scratch with a Noobs HS3PI build (Instead of HS3 standard) Everything looked good till I reloaded my config....then the HS3PI build started behaving exactly like my first PI generic Raspbian build.

                            So...I went back to my original build using standard HS3 on Raspbian and just started turning everything off....till I found the culprit.

                            I had configured HS to connect to a mailbox that had a lot of message in it. Once I turned off GMAIL integration and reset the HS it looked good. I created a new mailbox that was dedicated to HomeSeer on gmail, configured HS to use that mailbox and everything is working well now.

                            So the moral of the story....don't point HS3 to big old mailbox with lots of messages in it.

                            Comment


                              #15
                              Originally posted by kamishki View Post
                              Just to close out this issue....I noticed that along with memory utilization, the Homeseer process was also hitting the processor with between 50 and 75% utilization.

                              I did find the issue. After starting from scratch with a Noobs HS3PI build (Instead of HS3 standard) Everything looked good till I reloaded my config....then the HS3PI build started behaving exactly like my first PI generic Raspbian build.

                              So...I went back to my original build using standard HS3 on Raspbian and just started turning everything off....till I found the culprit.

                              I had configured HS to connect to a mailbox that had a lot of message in it. Once I turned off GMAIL integration and reset the HS it looked good. I created a new mailbox that was dedicated to HomeSeer on gmail, configured HS to use that mailbox and everything is working well now.

                              So the moral of the story....don't point HS3 to big old mailbox with lots of messages in it.
                              Great info. Thanks for sharing here in case others run across a similar issue.
                              HS4Pro on a Raspberry Pi4
                              54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                              Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                              HSTouch Clients: 1 Android

                              Comment

                              Working...
                              X