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#

Within a multi-domain Carbonio infrastructure, there are two attributes that control how a user can search for users in other domains: carbonioSearchAllDomainsByFeature and carbonioSearchSpecifiedDomainsByFeature. Both available to the Global Administrator only, the first one enables a user to search for users in all the domains configured by using CLI command

zextras$ carbonio prov mcf carbonioSearchAllDomainsByFeature TRUE

See also

This option is available on the Carbonio Admin Panel (Admin Panel ‣ Domains ‣ Global ‣ Settings), please see the dedicated box in the Domain’s global settings.

The second attribute works only if carbonioSearchAllDomainsByFeature is set to FALSE and allows only certain domains to be searched by a user, and can be configured as follows

zextras$ carbonio prov md example.com carbonioSearchSpecifiedDomainsByFeature test.edu

This command allows a user of example.com to search for users in the test.edu domain and start a chat with them.

See also

This option is available on the Carbonio Admin Panel (Admin Panel ‣ Domains ‣ Details ‣ General Settings).

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 Chats 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 Database.

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