mattermost/server
Agniva De Sarker da7192246e
MM-62960: Improve webConn remove performance from hubConnectionIndex (#30178)
When we added iteration by channelID, this was a known tradeoff during that.
However, it has been observed that the regular connection removal function
creates considerable blocking of the processing loop, leading to high
CPU usage and API latencies.

To fix this, we add a reverse mapping of channelIDs to connections
and their positions in the slice. This helps us to remove the connection
from the slice without iteration.

Unfortunately, this still needs to iterate through all channelIDs
during invalidation of the channel member cache. However, the user
cache invalidation is not a regular activity. So it should be an acceptable
tradeoff to make.

https://mattermost.atlassian.net/browse/MM-62960

```release-note
A new config knob ServiceSettings.EnableWebHubChannelIteration which allows a user to control the performance of websocket broadcasting. By default, this setting is turned off. If it is turned on, it improves the websocket broadcasting performance at the expense of poor performance when users join/leave a channel. It is not recommended to turn it on unless you have atleast 200,000 concurrent users actively using MM.
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-02-14 09:19:36 +05:30
..
bin Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
build Remove docker hack around prometheus service (#28985) 2025-02-12 14:18:53 -04:00
channels MM-62960: Improve webConn remove performance from hubConnectionIndex (#30178) 2025-02-14 09:19:36 +05:30
cmd MM-61215: Clarify to use --bypass-upload flag (#29761) 2025-02-07 22:12:33 +05:30
config Replacing interface{} with any everywhere (except generated mocks) (#29446) 2024-12-15 21:11:36 +01:00
einterfaces [aider assisted] MM-61888: Add ClientSideUserIds field to MetricsSettings (#30127) 2025-02-13 21:10:34 +05:30
enterprise [aider assisted] MM-61888: Add ClientSideUserIds field to MetricsSettings (#30127) 2025-02-13 21:10:34 +05:30
fonts Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
i18n [aider assisted] MM-61888: Add ClientSideUserIds field to MetricsSettings (#30127) 2025-02-13 21:10:34 +05:30
platform MM-60211: Bump dependencies (#30005) 2025-02-06 21:48:08 +05:30
public MM-62960: Improve webConn remove performance from hubConnectionIndex (#30178) 2025-02-14 09:19:36 +05:30
scripts Mirror postgres-13 image (#30047) 2025-01-30 15:18:09 +01:00
templates MM-59966 - Compliance Export overhaul - feature branch (#29789) 2025-01-10 16:56:02 -05:00
tests [MM-62775] Fix: Bulk export not completing (#30044) 2025-02-04 17:56:11 -05:00
.codecov.yml Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
.gitignore Update .server/gitignore to ignore all JSON files under the directory (#27593) 2024-07-11 09:12:57 +02:00
.go-version MM-60387: Bump Go version to 1.22 (#28118) 2024-09-05 19:29:29 +05:30
.golangci.yml [MM-61775] Fix errcheck issues in server/channels/app/platform/web_broadcast_hook.go (#29514) 2025-01-27 11:26:28 +00:00
.sass-lint.yml Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
config.mk MM-59934: Add Redis to CI and other improvements (#28164) 2024-09-18 19:13:44 +05:30
copyright.txt Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
docker-compose.makefile.m1.yml Remove obsolete docker version (#30040) 2025-01-30 12:53:25 -07:00
docker-compose.makefile.yml Remove obsolete docker version (#30040) 2025-01-30 12:53:25 -07:00
docker-compose.yaml Remove obsolete docker version (#30040) 2025-01-30 12:53:25 -07:00
go.mod MM-60211: Bump dependencies (#30005) 2025-02-06 21:48:08 +05:30
go.sum MM-60211: Bump dependencies (#30005) 2025-02-06 21:48:08 +05:30
Makefile Remove docker hack around prometheus service (#28985) 2025-02-12 14:18:53 -04:00
path.go Centralize the GetPackagePath (#27004) 2024-05-15 12:05:13 -03:00