ReinerNippes / nextcloud_on_docker

Run Nextcloud in Docker Container on various Linux Hosts
MIT License
203 stars 48 forks source link

External signaling server for Nextcloud Talk #86

Open RST-J opened 3 years ago

RST-J commented 3 years ago

The users of the Nextcloud installation I set up for them based on this playbook reported poor Talk performance in video conferences. They usually hold conferences with at least 8 participants and regularly have guests, so 10 to 12 is more realistic.

I started looking into the issue and found a reasonable explanation for this: Without an external signaling server the traffic is distributed peer to peer between the participants. This could be solved by setting up and/or configuring an external signaling server. I found the nextcloud-spreed-signaling repository which seems to provide an "easy" solution for this. Unfortunately I have not much experience with setting up and wiring together docker stuff, not to say Traefik for which I assume it would also have to play its role in this particular setup.

Do you have experience with external signaling servers for Nextcloud talk? Maybe even plans to integrate one into this playbook?

If not, do you have any hints for me on what I have to consider when setting this up? I suppose, the containers created here somehow would have to register themselves with Traefik as the server has to be able to talk to clients. Would it be a reasonable solution to use the nginx-Container for Nextcloud as the frontend webserver or would it be better to have another standalone one for this task?

My main concerns are

I hope this makes sense and even more that you can shed light on my worries.

ochealaaf commented 3 years ago

Before thinking about installing a signaling server do you have checked that the php-fpm variables are set correctly as recommend in the nextcloud documentation. The default values used when setting up the cloud using the playbook are ok for a private purposes but not ok if teams should use talk. The system becomes irresponsible after a short while.

If you don't know how to do this, drop a note here and I'll write a short tutorial.

RST-J commented 3 years ago

@ochealaaf I would really appreciate a short Howto on where to put the values. My first guess would be to add these variables to roles/docker_container/files/php.ini but well I am not sure whether that would be correct.

I also had considered the fpm-variables before and thought this could be an issue. docker exec nextcloud php -i did not report any of the pm.*-Settings so I wondered whether they are optimized according to the manual or if the defaults are lower. But then I still don't know exactly where to configure this and if the docker container is the right target or whether it should be configured for the nginx (does this run any PHP at all in that setup?) or even both ...

However, if I got that right, this will increase overall multi-user performance. This also seemed to be an issue when they tested, so this should help for sure. But if I understand the way the built in signaling works, this will remain a problem nevertheless because of the peer to peer way it handles conferences. I would still first try that out with optimized settings before I attempt something more I don't know in detail yet. But if I go for the other server and manage to get it running with this setup, I'd share what I've done here (of course).

ochealaaf commented 3 years ago

First open a shell in the running nextcloud container docker exec -it nextcloud /bin/sh If you are not member of the docker group you may need superuser rights sudo docker exec -it nextcloud /bin/sh

You are now in the running container - change the directory cd /usr/local/etc/php-fpm.d/ There you'll find the file www.conf - the only editor available in the container seems to be vi, I hope you know the basic editing commands. vi www.conf Search these 4 variables and change them accordingly pm.max_children = 120 pm.start_servers = 12 pm.min_spare_servers = 6
pm.max_spare_servers = 18 Save the file and leave the container with exit

Don't forget to restart the container docker restart nextcloud

I hope this works for you.

RST-J commented 3 years ago

Thanks @ochealaaf that worked like a charm. :smiley:

RST-J commented 3 years ago

@ochealaaf Do you also found a way to persist that change so that one does not have to redo the change after every time the container is rebuilt like after updates?