nextcloud / spreed

🗨️ Nextcloud Talk – chat, video & audio calls for Nextcloud
https://nextcloud.com/talk
GNU Affero General Public License v3.0
1.64k stars 437 forks source link

Multiple polling of new messages API calls slows down the whole nextcloud instance #6738

Closed jjqoie closed 2 years ago

jjqoie commented 2 years ago

How to use GitHub


Steps to reproduce

Client used https://github.com/jjqoie/nctalkclient Same user makes more than one poll/wait API request in parallel to different chatrooms(tokens) /ocs/v2.php/apps/spreed/api/v1/chat/${this.roominfo.token}?lookIntoFuture=1&setReadMarker=1&format=json&lastKnownMessageId=${this.lastmsgid}

Expected behaviour

Should work with out slowing down nextcloud and making it less responsive.

Actual behaviour

With one request to one chatroom everything is fine. 2 or more parallel requests of the same user to differnt chatrooms(tokens) makes the nextcloud instance slow and less responsive. Slow means that for example when a new talk message is entered it takes sometimes up to 30 seconds until it was sent, but also switching between the other nextcloud tabs is less responsive… It looks like the delay is releated to the timeout parameter send with these requests. I have tested this also on a new nextcloud instance running in a VM, same behaviour.

Talk app

Talk app version: (see apps admin page: /index.php/settings/apps) 12.2.2

Custom Signaling server configured: yes/no and version (see additional admin settings: /index.php/index.php/settings/admin/talk#signaling_server) NO

Custom TURN server configured: yes/no (see additional admin settings: /index.php/settings/admin/talk#turn_server) NO

Custom STUN server configured: yes/no (see additional admin settings: /index.php/settings/admin/talk#stun_server) NO

Browser

Browser is not open

Microphone available: yes/no

Camera available: yes/no

Operating system: Windows/Ubuntu/...

Browser name: Firefox/Chrome/...

Browser version: 85/96/...

Browser log

``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```

Server configuration

Operating system: Ubuntu/RedHat/... Docker Alpine

Web server: Apache/Nginx Nginx

Database: MySQL/Maria/SQLite/PostgreSQL MariaDB

PHP version: 7.4/8.0/8.1 8.0

Nextcloud Version: (see admin page) 22.2.3.0

List of activated apps:

``` If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your server installation folder ```

Nextcloud configuration:

``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder ```

Server log (data/nextcloud.log)

``` Insert your server log here ```
nickvergessen commented 2 years ago

Slow means that for example when a new talk message is entered it takes sometimes up to 30 seconds until it was sent, but also switching between the other nextcloud tabs is less responsive.

The request you outline is a long polling request. Please check your server configuration that there are enough workers available when you use HTTP2 e.g. See https://nextcloud-talk.readthedocs.io/en/latest/system-requirements/#webserver for more details