Limit memory usage of Jitsi

Hi.

I have installed Jitsi on a small VPS with only 2GB of RAM. I’m not planning to host large video conferences only 2 to 4 people at a time in a single meeting. It seems to be working fine for about ~15 min then the meeting drops for everyone without warning. I suspect it is running out of memory or something.

I read somewhere that the default memory settings is 3GB. How can I decrease it to < 2GB so that Jitsi doesn’t try to allocate more than the amount of RAM that is available?

Maybe run htop first to be sure it’s actually a memory issue? You didn’t say how many cores you have on the server. Yes, 2GB is really small, but frankly, Jitsi doesn’t use that much memory for 2-4 participants.

Well, it is jvb up to 3GB and jicofo up to 3GB and prosody and nginx also need some …
Set environment variable JICOFO_MAX_MEMORY=512m

And VIDEOBRIDGE_MAX_MEMORY=512m

You can actually put them in /etc/jitsi/jicofo/config and /etc/jitsi/videobridge/config

And see how it goes …

Hello @damencho
I have added VIDEOBRIDGE_MAX_MEMORY variable in the config file(Please find below). Is it the correct way to set it? Also Is there any way to verify it apart from running load?

config

# Jitsi Videobridge settings

# sets the XMPP domain (default: none)
JVB_HOSTNAME=meet.example.com

# sets the hostname of the XMPP server (default: domain if set, localhost otherwise)
# Not needed when not using components (now using MUCs)
JVB_HOST=

# sets the port of the XMPP server (default: 5275)
JVB_PORT=5347

# sets the shared secret used to authenticate to the XMPP server
JVB_SECRET=xxxxx

# extra options to pass to the JVB daemon
JVB_OPTS="--apis=,"

# Increasing jvb memory
VIDEOBRIDGE_MAX_MEMORY=6144m

# adds java system props that are passed to jvb (default are for home and logging config file)
JAVA_SYS_PROPS="-Dconfig.file=/etc/jitsi/videobridge/jvb.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=videobridge -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi -Djava.util.logging.config.file=/etc/jitsi/videobridge/logging.properties"

UPDATE
I got it. we can check it using service jitsi-videobridge2 status command. check Xmx6144m in below snippet.

snippet

jitsi-videobridge2.service - Jitsi Videobridge
   Loaded: loaded (/lib/systemd/system/jitsi-videobridge2.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-07-16 17:45:20 UTC; 11min ago
  Process: 22415 ExecStartPost=/bin/bash -c echo $MAINPID > /var/run/jitsi-videobridge/jitsi-videobridge.pid (code=exited, status=0/SUCCESS)
 Main PID: 22414 (java)
    Tasks: 45 (limit: 65000)
   Memory: 267.4M
   CGroup: /system.slice/jitsi-videobridge2.service
           └─22414 java -Xmx6144m -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError
1 Like