Chats Advanced#

This section contains advanced Chats configuration and suggestions to improve performances and optimise the Module.

Chats Configuration#

In this section we present advanced configuration options for Chats.

User Search Across Domains#

In a multi-domain Carbonio infrastructure, Administrators can decide on which domains a user can be found when starting a new chat.

The search on all domains can be activated with CLI command

zextras$ carbonio prov mcf carbonioSearchAllDomainsByFeature TRUE

To allow users to search other users only on their domain, use FALSE instead of TRUE.

See also

This option is available on the Carbonio Admin Panel, please see the dedicated box in the Domain’s global settings.

Set Legacy Chats Read Only#

If you enabled Chats, to prevent user using the old Chats, you can set it in read-only mode. By doing so, users will still able to access the textual Chats, the Spaces, and the Rooms, but it will not be possible to message users or create new Spaces and Rooms. Additionally, the input bar at the bottom will be replaced by a string The application is in Read Only mode.

To set the legacy Chats read-only, use the CLI command

zextras$ carbonio config set cos default teamReadOnlyEnabled true

Disable Legacy Chats#

To completely disable the legacy Chats, both textual and video, you need to carry out tasks at different levels: global, COS, account, and application.

Hint

All commands in this section, except where explicitly stated, must be executed as the zextras user.

We start by disabling the functionality on the whole infrastructure.

zextras$ carbonio config set global teamChatEnabled  false
zextras$ carbonio config set global videoChatEnabled false

Then, disable the functionality on all CoSes in which it is enabled with the following two one-liners.

zextras$ carbonio prov gac | while read cos; do echo "config set cos \"$cos\" teamChatEnabled false"; echo "config set cos \"$cos\" videoChatEnabled false";  done  | carbonio
zextras$ carbonio prov gac | while read cos; do echo "mc \"$cos\" carbonioFeatureWscEnabled FALSE"; done  | carbonio prov

Disable the functionality on all accounts in which it is enabled with the following two one-liners.

zextras$ carbonio prov -l gaa | while read account; do echo "config set account \"$account\" teamChatEnabled false"; echo "config set account \"$account\" videoChatEnabled false";  done  | carbonio
zextras$ carbonio prov -l gaa | while read account; do echo "ma \"$account\" carbonioFeatureWscEnabled \"\""; done  | carbonio prov

On the node hosting the Mailstore & Provisioning Component, disable the Chat’s automatic start, then stop the service.

zextras$ carbonio config set global ZxChat_ModuleEnabledAtStartup false
zextras$ carbonio chats dostopservice module

At this point the Chats functionality is completely disabled. You can now log in to the Proxy Node and remove the package providing Chats as the root user:

# apt remove carbonio-chats-ui
# dnf remove carbonio-chats-ui

Chats Optimisations#

Once the Chats is operational, some tweaking can be applied to its configuration to improve performances.

The remainder of this page contains a few tables that list the Key names and the default values of some ||wsc|| configuration values that you can modify. You can take these tables into account in case you want to revert some values to their default after some unsatisfactory change.

How to Modify Values#

Values can be changed by using, from any Node, the Carbonio Mesh kv interface: you can access it using the consul command from the CLI.

  • To verify the current value of any key, use command

    # consul kv get -token-file="$CONSUL_TOKEN_PATH" "$KEY"
    
  • To modify one of the values reported in the tables below, use command

    # consul kv put -token-file="$CONSUL_TOKEN_PATH" "$KEY" "$VALUE"
    

In the commands, $CONSUL_TOKEN_PATH refers to an environment variable that tells a command or a script where to find the ACL token file needed to authenticate with Carbonio Mesh when performing operations like reading or writing KV values, while $KEY and $VALUE are the key name and the new value, respectively, as written in the tables.

Scenario:

To get the value of carbonio-ws-collaboration/hikari/leak-detection-threshold, CONSUL_TOKEN_PATH must be valued to /etc/carbonio/ws-collaboration/service-discover/token.

Example:

You can do this with:

1#export CONSUL_TOKEN_PATH=/etc/carbonio/ws-collaboration/service-discover/token
2#consul kv get -token-file="$CONSUL_TOKEN_PATH"  "carbonio-ws-collaboration/hikari/leak-detection-threshold"

In this case you will:

  • Read the token from /etc/carbonio/ws-collaboration/service-discover/token

  • Use that token to authenticate the request to Carbonio Mesh

  • Fetch the value of the KV key

If you need to change the value of the key the CONSUL_TOKEN_PATH variable should be passed in the same way.

Configuration tables#

The following tables are available to optimise Chats: Push Connector, Push Notifications Database, and the Chats databases.

Push Connector

Key name

Default value

carbonio-push-connector/hikari/min-idle-connections

10

carbonio-push-connector/hikari/max-pool-size

10

carbonio-push-connector/hikari/idle-timeout

10000

carbonio-push-connector/hikari/leak-detection-threshold

5000

Once you modify any of these changes, restart the service.

# systemctl restart carbonio-push-connector
Configure Notifications Push Database

Key name

Default value

carbonio-notification-push/hikari/min-idle-connections

10

carbonio-notification-push/hikari/max-pool-size

10

carbonio-notification-push/hikari/idle-timeout

10000

carbonio-notification-push/hikari/leak-detection-threshold

5000

Once you modify any of these changes, restart the service.

# systemctl restart carbonio-notification-push
Configure Chats Database

Key name

Default value

carbonio-ws-collaboration/hikari/min-idle-connections

10

carbonio-ws-collaboration/hikari/max-lifetime

600000

carbonio-ws-collaboration/hikari/max-pool-size

10

carbonio-ws-collaboration/hikari/idle-timeout

10000

carbonio-ws-collaboration/hikari/leak-detection-threshold

5000

Modify Connection Pool#

This optimisation does not require access to the kv interface. Instead, you need to edit file /etc/carbonio/message-dispatcher/mongooseim.toml and change the value of workers in section [outgoing_pools.rdbms.default]:

[outgoing_pools.rdbms.default]
  scope = "global"
  strategy = "best_worker"
  workers = 10 # db connection pool numbers

Then, restart the service.

# systemctl restart carbonio-message-dispatcher