MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    All of a sudden SSH is really lagging/slow.

    Scheduled Pinned Locked Moved Troubleshooting
    16 Posts 4 Posters 11.4k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      Mar
      last edited by

      After coming back to my mirror after a month or so of not touching it as I’ve been quite happy with the set up I’ve noticed whenever im in SSH that its extremely slow. To the point of it becoming very difficult to even type on the command line let alone use nano.

      I’m wondering if anyone has any ways I could troubleshoot why this is happening. I’ve not moved the physical Pi or changed anything. It used to run absolutely perfectly.

      Any help would be greatly appreciated.

      1 Reply Last reply Reply Quote 0
      • yawnsY Offline
        yawns Moderator
        last edited by

        I know this is the typical IT support question, but did you reboot the raspberry and check if this lag still is the case after rebooting?

        M 1 Reply Last reply Reply Quote 0
        • M Offline
          Mar @yawns
          last edited by

          @yawns thanks for the reply. Yes I’ve restarted it many-many times in the last few days. Valid question.

          SnilleS 1 Reply Last reply Reply Quote 0
          • yawnsY Offline
            yawns Moderator
            last edited by yawns

            Ok. Is your pi connected with wifi or lan?

            You could try this:

            sudo nano /etc/ssh/sshd_config, then add UseDNS no to the file and save your changes. Afterwards reboot your pi or run sudo service ssh restart

            M 1 Reply Last reply Reply Quote 0
            • SnilleS Offline
              Snille Module Developer @Mar
              last edited by Snille

              @Mar If you get in to SSH, check if you have a HUGE file called “core” in your MagicMirror directory. If you do, delete it. I have had the same issue, EVERYTHING get’s slow and eventually you cant do anything. I noticed the file on my second install (again) and deleted it before it died. Now I’m trying to find how this file get’s created. It should not be there.

              If you cant find it, make it and share it!
              Modules: MMM-homeassistant-sensors, MMM-Modulebar, MMM-Profilepicture, MMM-Videoplayer

              strawberry 3.141S 1 Reply Last reply Reply Quote 0
              • strawberry 3.141S Offline
                strawberry 3.141 Project Sponsor Module Developer @Snille
                last edited by

                @Snille does a module create this file? I don’t have a file called core in my mm directory

                Please create a github issue if you need help, so I can keep track

                SnilleS 1 Reply Last reply Reply Quote 0
                • M Offline
                  Mar @yawns
                  last edited by

                  Thanks for the tips everyone.
                  @yawns I’m connected via wifi and in the same room as the router, nothing has changed here. I’ve attempted to add the UseDNS=no but it didnt seem to change the major lag im experiencing. i.e i type and it takes a few seconds for it to show up on the command line. But when I tried ‘UseDNS no’ (as this seemed to be the syntax in the file) it seemed to be a little speedier upon the next reboot! Not near as fast as it was a few weeks back but now i can get in and navigate around etc. Thanks!

                  I wonder if there is anything else that could be slowing it down, how does the UsDNS command speed things up like it did?

                  @Snille i’ve done an ls -alh in a few of the directories and have no large file name core. Would there be any other temp/log type of files that could be causing a slowdown?

                  yawnsY 1 Reply Last reply Reply Quote 0
                  • SnilleS Offline
                    Snille Module Developer @strawberry 3.141
                    last edited by

                    @strawberry-3.141 I don’t know yet. I just rebooted my mirror now and got it back again. I’m trying to figuring it out.
                    Here is my MagicMirror dir after this reboot…
                    The file is there again… :/

                    drwxr-xr-x  16 pi pi      4096 Mar 22 11:06 .
                    drwxr-xr-x  21 pi pi      4096 Mar 22 11:08 ..
                    -rw-r--r--   1 pi pi     11172 Mar 21 13:37 CHANGELOG.md
                    drwxr-xr-x   2 pi pi      4096 Mar 21 13:52 config
                    -rw-------   1 pi pi 574697472 Mar 22 11:07 core
                    drwxr-xr-x   2 pi pi      4096 Mar 21 13:37 css
                    -rw-r--r--   1 pi pi       266 Mar 21 13:37 docker-entrypoint.sh
                    -rw-r--r--   1 pi pi       378 Mar 21 13:37 Dockerfile
                    -rw-r--r--   1 pi pi       964 Mar 21 13:37 .dockerignore
                    -rw-r--r--   1 pi pi       132 Mar 21 13:37 .eslintignore
                    -rw-r--r--   1 pi pi       319 Mar 21 13:37 .eslintrc.json
                    drwxr-xr-x  20 pi pi      4096 Mar 21 13:37 fonts
                    drwxr-xr-x   8 pi pi      4096 Mar 22 11:09 .git
                    drwxr-xr-x   2 pi pi      4096 Mar 21 13:37 .github
                    -rw-r--r--   1 pi pi       915 Mar 21 13:37 .gitignore
                    -rw-r--r--   1 pi pi      2173 Mar 21 13:37 Gruntfile.js
                    -rw-r--r--   1 pi pi      2337 Mar 21 13:37 index.html
                    drwxr-xr-x   3 pi pi      4096 Mar 21 13:37 installers
                    drwxr-xr-x   2 pi pi      4096 Mar 21 13:37 js
                    -rw-r--r--   1 pi pi       271 Mar 21 13:37 jsconfig.json
                    -rw-r--r--   1 pi pi      1118 Mar 21 13:37 LICENSE.md
                    drwxr-xr-x  27 pi pi      4096 Mar 22 08:40 modules
                    drwxr-xr-x 561 pi pi     20480 Mar 22 10:55 node_modules
                    -rw-r--r--   1 pi pi      1789 Mar 21 13:37 package.json
                    -rw-r--r--   1 pi pi     11431 Mar 21 13:37 README.md
                    -rw-r--r--   1 pi pi       141 Mar 21 13:37 run-start.sh
                    drwxr-xr-x   2 pi pi      4096 Mar 21 13:37 serveronly
                    -rw-r--r--   1 pi pi       478 Mar 21 13:37 .snyk
                    drwxr-xr-x   2 pi pi      4096 Mar 21 13:37 splashscreen
                    -rw-r--r--   1 pi pi       126 Mar 21 13:37 .stylelintrc
                    drwxr-xr-x   6 pi pi      4096 Mar 21 13:37 tests
                    drwxr-xr-x   2 pi pi      4096 Mar 21 13:37 translations
                    -rw-r--r--   1 pi pi       229 Mar 21 13:37 .travis.yml
                    drwxr-xr-x   3 pi pi      4096 Mar 21 23:24 vendor
                    

                    If you cant find it, make it and share it!
                    Modules: MMM-homeassistant-sensors, MMM-Modulebar, MMM-Profilepicture, MMM-Videoplayer

                    strawberry 3.141S 1 Reply Last reply Reply Quote 0
                    • strawberry 3.141S Offline
                      strawberry 3.141 Project Sponsor Module Developer @Snille
                      last edited by strawberry 3.141

                      @Snille disable all modules delete this file and put only one module step by step to check what is creating this file. Can you open that file in an editor to get more details?

                      @Mar which modules you’re using? how about the cpu usage?

                      Please create a github issue if you need help, so I can keep track

                      SnilleS M 2 Replies Last reply Reply Quote 0
                      • SnilleS Offline
                        Snille Module Developer @strawberry 3.141
                        last edited by

                        @strawberry-3.141 That’s what I’m doing right now… :)

                        If you cant find it, make it and share it!
                        Modules: MMM-homeassistant-sensors, MMM-Modulebar, MMM-Profilepicture, MMM-Videoplayer

                        1 Reply Last reply Reply Quote 0
                        • yawnsY Offline
                          yawns Moderator @Mar
                          last edited by

                          @Mar
                          Thanks for the feedback. I will change my post and remove the =, so others won’t run into the same mistake.

                          1 Reply Last reply Reply Quote 0
                          • M Offline
                            Mar @strawberry 3.141
                            last edited by

                            @strawberry-3.141 My cpu usage (using top) after the pi has booted up stays around 3-5% (using the top command raises this a bit). And memory usage doesnt seem out of control either.

                            top - 10:36:12 up 43 min,  3 users,  load average: 0.14, 0.12, 0.11
                            Tasks: 107 total,   1 running, 100 sleeping,   6 stopped,   0 zombie
                            %Cpu(s):  4.7 us,  1.0 sy,  0.0 ni, 93.9 id,  0.0 wa,  0.0 hi,  0.3 si,  0.0 st
                            KiB Mem:    445084 total,   340880 used,   104204 free,    26108 buffers
                            KiB Swap:   102396 total,        0 used,   102396 free.   159376 cached Mem
                            
                              PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                      
                              611 pi        20   0  205560  77592  42308 S  3.3 17.4   1:35.69 midori                                       
                             3581 pi        20   0    5232   2596   2160 R  1.6  0.6   0:00.38 top                                          
                               60 root      20   0       0      0      0 S  0.3  0.0   0:02.04 kworker/0:2                                  
                              594 root      19  -1  154840  47040  21040 S  0.3 10.6   0:16.78 Xorg                                         
                             3241 pi        20   0   11940   3440   2768 S  0.3  0.8   0:00.89 sshd                                         
                                1 root      20   0    5308   3776   2736 S  0.0  0.8   0:07.32 systemd                                      
                                2 root      20   0       0      0      0 S  0.0  0.0   0:00.01 kthreadd                                     
                                3 root      20   0       0      0      0 S  0.0  0.0   0:01.17 ksoftirqd/0  
                            

                            Im using the following modules.

                            • profileswitcher, buttons, clock, calendar, compliments, current weather, weather forecast, wunderlist, newsfeed, calendar monthly, tube status, and system stats.
                            strawberry 3.141S 1 Reply Last reply Reply Quote 0
                            • SnilleS Offline
                              Snille Module Developer
                              last edited by Snille

                              @strawberry-3-141 Hmm… It does not seam to be any module doing it… I’m thinking it’s a “core-dump”, I noticed when restarting that it took a long time before it actually restarted. I’m guessing something did not close down properly, then the memory (or something) is dumped down to a file… Now it’s not happening any longer… Reboots normally. Only thing is that I lost my pm2 autostart of the mirror for some reason (had to do a pm2 startup and run the “setup” command sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi again… And now it starts normally again… No core file after reboots, all modules back again… Darn! :)

                              If you cant find it, make it and share it!
                              Modules: MMM-homeassistant-sensors, MMM-Modulebar, MMM-Profilepicture, MMM-Videoplayer

                              1 Reply Last reply Reply Quote 0
                              • strawberry 3.141S Offline
                                strawberry 3.141 Project Sponsor Module Developer @Mar
                                last edited by

                                @Mar does the ssh speedup when you shut down the mirror?

                                Please create a github issue if you need help, so I can keep track

                                M 1 Reply Last reply Reply Quote 0
                                • M Offline
                                  Mar @strawberry 3.141
                                  last edited by

                                  @strawberry-3.141 Oh wow! Ran a pm2 stop mm and the ssh went back to exactly how it used to be. No lag at all and can use nano on the config file with zero lag (could even mouse wheel scroll perfectly).

                                  Then starting MM back up (pm2 start mm) it seems to maintain the quick ssh speed. Upon a full reboot though it seems to get back to being slightly slower.

                                  1 Reply Last reply Reply Quote 0
                                  • SnilleS Offline
                                    Snille Module Developer
                                    last edited by

                                    Just got myself a “core”-file again in the MM root. :) I’m now sure it’s because Electron is crashing. So, it’s probably a memory dump. Still don’t really know why Electron is crashing. It’s not crashing all the time. Just sometimes. But then, I do have lot’s of modules going… :)

                                    If you cant find it, make it and share it!
                                    Modules: MMM-homeassistant-sensors, MMM-Modulebar, MMM-Profilepicture, MMM-Videoplayer

                                    1 Reply Last reply Reply Quote 0

                                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                    With your input, this post could be even better 💗

                                    Register Login
                                    • 1 / 1
                                    • First post
                                      Last post
                                    Enjoying MagicMirror? Please consider a donation!
                                    MagicMirror created by Michael Teeuw.
                                    Forum managed by Sam, technical setup by Karsten.
                                    This forum is using NodeBB as its core | Contributors
                                    Contact | Privacy Policy