RocketChat service fails every other day - how to restart service on failure?

My YunoHost server

Hardware: VPS bought online
YunoHost version: 11.0.10.1
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my

Hi,

since some weeks, my RocketChat service fails every other day and sais something about "

JavaScript heap out of memory

It’s very easy to “solve” manually, by restarting the service.

Okt 19 18:05:54 rocketchat[4056]: <--- Last few GCs --->
Okt 19 18:05:54 rocketchat[4056]: [4056:0x5d09e30] 265096644 ms: Mark-sweep (reduce) 4047.9 (4101.9) -> 4047.2 (4103.4) MB, 3939.1 / 15.9 ms  (average mu = 0.101, current mu = 0.013) allocation failure scavenge might not succeed
Okt 19 18:05:54 rocketchat[4056]: [4056:0x5d09e30] 265100849 ms: Mark-sweep (reduce) 4048.3 (4102.4) -> 4047.6 (4103.7) MB, 4170.5 / 33.0 ms  (average mu = 0.055, current mu = 0.008) allocation failure scavenge might not succeed
Okt 19 18:05:54 rocketchat[4056]: <--- JS stacktrace --->
Okt 19 18:05:54 rocketchat[4056]: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Okt 19 18:05:54 rocketchat[4056]:  1: 0xa3ac10 node::Abort() [/opt/node_n/n/versions/node/14/bin/node]

full log here: hastebin

My questions

  1. do you think that has something to do with the logs before of the mail inbox (they occur often, without the service crashing?)
  2. do you have another idea, that causes it?
  3. As a quick workaround: is there a way to say the service automatically to restart, when it fails? Where would be the service configfile and what is it, I would have to change there?

Thanks a lot for your help!

Best
Valentin

Rocket.chat service file is here: /etc/systemd/system/rocketchat.service

You can add Restart=on-failure in the [Service] section.

edit:
(What are the ram specs of your server?)

Also see this thread about app ram usage

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.