mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-56355: Use same number of hubs as CPUs (#25798)
We randomly used double the number of hubs. A proper test indicates that using the same number of hubs as CPUs gives better performance. https://mattermost.atlassian.net/browse/MM-56355 ```release-note NONE ```
This commit is contained in:
@@ -92,8 +92,10 @@ func newWebHub(ps *PlatformService) *Hub {
|
||||
|
||||
// hubStart starts all the hubs.
|
||||
func (ps *PlatformService) hubStart(broadcastHooks map[string]BroadcastHook) {
|
||||
// Total number of hubs is twice the number of CPUs.
|
||||
numberOfHubs := runtime.NumCPU() * 2
|
||||
// After running some tests, we found using the same number of hubs
|
||||
// as CPUs to be the ideal in terms of performance.
|
||||
// https://github.com/mattermost/mattermost/pull/25798#issuecomment-1889386454
|
||||
numberOfHubs := runtime.NumCPU()
|
||||
ps.logger.Info("Starting websocket hubs", mlog.Int("number_of_hubs", numberOfHubs))
|
||||
|
||||
hubs := make([]*Hub, numberOfHubs)
|
||||
|
||||
Reference in New Issue
Block a user