0

I have set up an RPi3 running a Node.js server (with pm2) in a remote location. Even though the internet is quite fast, the pi sometimes times out or is very very slow.

Recently I have set up a watchdog to reboot the pi if overloaded, but does not seem to be sensible enough...

If I ask someone to stop and reconnect the electricity of that location, the pi reconnects successfully.

Relevant logs:

$ ssh -v user@example.com -p xxx22
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to ... [...] port xxx22.
debug1: Connection established.
debug1: identity file /home/.../.ssh/id_rsa type 0
...
debug1: identity file /home/.../.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
# Getting stuck here

I am also running a firefox instance that does make it very slow. It could be related to this, but in that case I would expect the watchdog to reboot the pi.

How can I solve this?

6
  • What do you mean by "the watch dog is not sensible enough?
    – tlfong01
    May 14 '21 at 10:43
  • 1
    I've seen this happen with cheap/poor SD cards May 14 '21 at 11:14
  • 1
    @tlfong01 I understand that watchdog has a config and it can detect when the pi is overloaded (e.g. CPU etc), but I am not sure if my config is correct. I tried the fork bomb and that indeed triggered the restart. May 14 '21 at 11:36
  • 1
    @JaromandaX Well, the microSD card is from Kingston... I don't think it is bad quality. May 14 '21 at 11:37
  • 1
    I had a similar issue and it happened to be a VsCode buggy extension, which was using all available RAM memory. In summary, @IonicăBizău can you connect directly to the RPI (not ssh since it got stuck when connecting) and have a look in the memory usage of your processes htop It may show you if firefox is the issue or if there is another process using huge memory and freezing the device. May 14 '21 at 17:57
0

It turned out that in that remote location the electricity is rather unstable and it would go down, but not completely (sometimes it would be around 50V on the wire), hence creating weird behaviors on these digital devices.

Adding a UPS, like I detailed here solved the problem: https://raspberrypi.stackexchange.com/a/133140/33613

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.