Weather Software > Cumulus

CumulusMX raspberry pi out-of-memory

(1/3) > >>

gszlag:
Unfortunately the rpi zero 2W with its 512MB memory wasn't up to task running CumulusMX and WeeWX at the same time. Mark mentioned mono is the likely culprit causing a memory leak.

Although it looked promising at the beginning, this tiny microcomputer would eventually pack it in under the load so I moved CumulusMX to my other rpi - the 3B+

The bigger pi 3B+ is definitely betterand buys me uptime  but if I forget to restart MX or reboot the computer on a regular basis, the 3B+ eventually caves in too.

Here are the symptoms:

- VNC fails to connect or slow to connect and if I do connect, the desktop takes a long time to load ( a sure sign I am running out of memory and better do something soon).
- SSH fails to connect or is slow to connect so I can't  send a shutdown -r on the terminal.

My computing skills are basic at best  and I could look up how to do a cron job and reboot on a fixed schedule but is there a linux way to restart a failing CumulusMX without rebooting?  CMX is installed as a service.

Any linux experts out there? I am running raspberrypiOS (Debian 10).

Gyvate:
you could create a script stopping the service and restarting it
e.g. a file named cmx-restart.sh in the e.g. /pi/CumulusMX directory - or whatever your path to CMX is
inside it would look something like


--- Code: ---#!/bin/sh
#
### restart CMX
#
systemctl stop cumulusmx
sleep 10
systemctl restart cumulusmx
--- End code ---

run manually with e.g. sudo sh cmx-restart.sh (from the directory the script resides in)
run periodically with an entry in /etc/crontab
something like below would run the job/script every Sunday


--- Code: ---*   *   * * 7   root    sh /pi/CumulusMX/cmx-restart.sh
--- End code ---

this is assuming that the cumulusmx script called to start the service contains the start of mono - and that the stop section also stops mono
(not knowing how you run CMX as a service and what the service script looks like)

gszlag:

--- Quote from: Gyvate on February 19, 2023, 11:53:17 AM ---you could create a script stopping the service and restarting it
e.g. a file named cmx-restart.sh in the e.g. /pi/CumulusMX directory - or whatever your path to CMX is
inside it would look something like


--- Code: ---#!/bin/sh
#
### restart CMX
#
systemctl stop cumulusmx
sleep 10
systemctl restart cumulusmx
--- End code ---

run manually with e.g. sudo sh cmx-restart.sh (from the directory the script resides in)
run periodically with an entry in /etc/crontab
something like below would run the job/script every Sunday


--- Code: ---*   *   * * 7   root    sh /pi/CumulusMX/cmx-restart.sh
--- End code ---

this is assuming that the cumulusmx script called to start the service contains the start of mono - and that the stop section also stops mono
(not knowing how you run CMX as a service and what the service script looks like)

--- End quote ---
Thanks Gyvate! Appreciate the help.
I think the CMX service was set up  the official way following the instructions :Running  MX as a Linux systemd"service
When I stop cumulusmx i appears that mono-service.exe stops as well (according to htop).
Your post is timely as I was looking up cron, crontab cron job from a beginner's perspective.
What i"ve learned so far:
Definitely an unusual way to edit a config file. You don't use a text editor like kate or geany, you launch the editor thusly: contab -e and will be asked to choose an editor.
I wimped out and chose nano.
You will also have to decide if you want to use crontab as user or as root. I gather each has their own onfig file somewhere.
If you are using crontab to restart a service then using a crontab as user will fail ( not enough permissions) .
Crontab also seems fussy about specifying a full path to commands or scripts. Sometimes you have to specify root as user on the command line but sometimes not.
Definitely will try your script. Thanks once again.

mcrossley:
@gszlag remind me, which station are you using with MX?

gszlag:

--- Quote from: mcrossley on February 19, 2023, 03:24:27 PM ---@gszlag remind me, which station are you using with MX?

--- End quote ---
I am running the ecowitt equipment on CMX with Gary's GW1000 driver.
Oops..sorry. I am running and uploading both CMX and WeeWX from the same pi3.

Navigation

[0] Message Index

[#] Next page

Go to full version