Jitsi meeting disconnects and tries to reconnect if anyone tries to join the meeting

Issue - Whenever someone joins the meeting, other person disconnects. Jitsi works perfectly fine after a reboot but after few days it suddenly starts to throw the same issue. I couldn’t find out what exactly causing the issue.
My server details -
UBUNTU 18.04
4GB RAM

Nginx Logs.
2020/10/29 15:54:47 [error] 392#392: *528 recv() failed (104: Connection reset by peer) while proxying and reading from upstream, client: 112.134.x.x, server: 0.0.0.0:443, upstream: “127.0.0.1:5349”, bytes from/to client:2664/4153, bytes from/to upstream:4153/3181
2020/10/29 17:01:55 [error] 392#392: *733 recv() failed (104: Connection reset by peer) while proxying and reading from upstream, client: 89.40.x.x, server: 0.0.0.0:443, upstream: “127.0.0.1:5349”, bytes from/to client:386/3242, bytes from/to upstream:3242/619

/var/log/jitsi/jvb.log
health check in PT0S. Sticky failure: false
2020-10-29 20:15:08.974 INFO: [26] HealthChecker.run#170: Performed a successful health check in PT0S. Sticky failure: false
2020-10-29 20:15:18.974 INFO: [26] HealthChecker.run#170: Performed a successful health check in PT0S. Sticky failure: false
2020-10-29 20:15:28.974 INFO: [26] HealthChecker.run#170: Performed a successful health check in PT0S. Sticky failure: false
2020-10-29 20:15:29.283 INFO: [25] VideobridgeExpireThread.expire#140: Running expire()
2020-10-29 20:15:38.974 INFO: [26] HealthChecker.run#170: Performed a successful health check in PT0S. Sticky failure: false
2020-10-29 20:15:48.974 INFO: [26] HealthChecker.run#170: Performed a successful health check in PT0S. Sticky failure: false

TCP/5349 is used by the turn server (coturn). The error message means that nginx redirects a request to the turn server but the turn server drops the connection without processing it.

nginx redirects only the videobridge related packages (audio/video) to coturn and normally this kind of package should be directly sent to the videobridge. So this means that the client has a connection issue to the videobridge and tries to send the packages through the turn server.

When client tries to send a packages through the turn server, it comes to nginx first and nginx redirects it to the turn server and the turn server redirects it to the videobridge in an alternative route. But according to the error message, the turn server also failed to connect to the videobrdige. This means that the videobridge probably down.

You said that the system is working after a reboot but down after a few days. This probably indicates a resource problem.

It is recommended at least 8 GB for a typical Jitsi installation. If you don’t have enough RAM you should decrease the reserved RAM for jicofo and jvb (jitsi video bridge)

Add the following line to /etc/jitsi/jicofo/config

JICOFO_MAX_MEMORY=1024m

and the following to /etc/jitsi/videobridge/config

VIDEOBRIDGE_MAX_MEMORY=1024m

then restart the system.