Jump to: navigation, search

DMS Scalability

DMS provides a scalable solution by running multiple DMS instances when a channel generates an increased traffic and exceeds the limit of concurrent DMS sessions.

Implementation

DMS scalability is implemented based on the Redis server version 6.2. DMS uses Redisson, a third-party software, as the Redis Java client to interact with the Redis server. The following two DMS proxies are used to process interactions:

  • DMS-d (dispatcher instance)
  • DMS-w (worker instance)

DMS-d fetches messages from Hub like the base DMS. Each DMS-d instance handles only one channel. It also saves information about chat sessions into the Redis DB instance. One Redis DB instance is used for all DMS instances. Each DMS-w instance also handles only one channel.


DMS Scalability

Functions of DMS-d

  • DMS-d gets the authorization token like the base DMS.
  • DMS-d fetches a batch of messages from Hub/Hub++ periodically and processes them.
  • DMS-d puts the newly fetched messages into Redis DB.
  • DMS-d confirms to Hub/Hub++ about the previously fetched messages after it saved them in Redis.
  • DMS-d analyzes the number of sessions assigned to each of the DMS-w instance in Redis and assesses their current loads.
  • DMS-d decides which DMS-w instance receives new messages and the number of new messages that do not belong to the current chat sessions.
  • DMS-d analyzes the active chat sessions in Redis and decides where to pass the messages which belong to the existing active chat sessions.
  • DMS-d detects which DMS-w stopped updating its state in the Redis DB to rebalance the load between active DMS-w's.
  • DMS-d, having found DMS-w's that stopped updating its state, decides which chat sessions from the Redis DB must be restored to other DMS-w instances and which messages must be re-sent to the newly created chat sessions.

Functions of DMS-w

  • DMS-w gets the authorization token from Hub / Hub++ directly.
  • DMS-w updates its state in the Redis DB regularly to let DMS-d know that it is running and processing the messages received with the previous batch. DMS-w reads messages (in batches) from Redis directly.
  • DMS-w reads the assigned messages from Redis directly and creates chat sessions.
  • DMS-w updates the messages in Redis with the global chat session IDs and its own name.
  • DMS-w also reads new messages for the already existing chat sessions from Redis and then marks them as processed in Redis so that if the session needs to be restored in another DMS-w, DMS-d decides about which messages would require re-sending.
  • DMS-w sends outbound messages to Hub/Hub++ directly.
Important
The current implementation of DMS High Availability works without any additional changes and each DMS-w relies on its backup to restore those established chat sessions in redundant Chat Servers.

Configuration

The following options can be used to configure DMS scalability:

  • The server-mode option indicates the mode of operation for DMS.
  • The redis-client-config option specifies the file name of the Redis client configuration (.yaml file).

DMS N+1 configuration

You can specify multiple DMS servers to be used for DMS scalability. If the DMS app name is not specified in the following option, DMS app name from user data of a parent interaction is used.


Configure the following options in the WDE application for the corresponding media channels:

Section Channel Value Changes take effect Type
facebooksession.appname Channel name for Facebook DMS app name. Multiple servers can be specified by using comma. Immediately String
applebcsession.appname Channel name for Apple Business Chat DMS app name. Multiple servers can be specified by using comma. Immediately String
whatsappsession.appname Channel name for WhatsApp DMS app name. Multiple servers can be specified by using comma. Immediately String

Redisson client configuration

Genesys recommends that you use a secured connection with the Redis server. To ensure the secured connection, the Redisson client configuration must specify the address of the Redis server in the form of rediss: . Refer to the example for a sample address.

Additionally, you must describe the JKS key store (parameter sslTruststore) with the CA certificate which is used to verify the Redis server's certificate. Example:

singleServerConfig:
 idleConnectionTimeout: 10000
 connectTimeout: 10000
 timeout: 3000
 retryAttempts: 3
 retryInterval: 1500
 password: "password"
 subscriptionsPerConnection: 5
 clientName: "DMS"
 sslEnableEndpointIdentification: true
 sslProvider: "JDK"
 # sslTruststore: "file:///C:/Redis_TLS/RedisCA_Test.keystore"
 pingConnectionInterval: 30000
 keepAlive: false
 tcpNoDelay: false
 address: "redis://127.0.0.1:6379"
 # address: "rediss://wsl-win10desktop:6379"
 subscriptionConnectionMinimumIdleSize: 1
 subscriptionConnectionPoolSize: 5
 connectionMinimumIdleSize: 5
 connectionPoolSize: 10
 database: 0
 dnsMonitoringInterval: 5000
threads: 16
nettyThreads: 32
#codec: !<org.redisson.client.codec.JsonJacksonCodec> {}
referenceEnabled: true
transportMode: "NIO"
lockWatchdogTimeout: 30000
reliableTopicWatchdogTimeout: 600000
keepPubSubOrder: true
useScriptCache: false
minCleanUpDelay: 5
maxCleanUpDelay: 1800
cleanUpKeysAmount: 100
nettyHook: !<org.redisson.client.DefaultNettyHook> {}
useThreadClassLoader: true
addressResolverGroupFactory: !<org.redisson.connection.DnsAddressResolverGroupFactory> {}

JVM parameters for DMS-d

-Dgenesys.mcr.stdserverex.apptype=CFGSocialMS
-Dgenesys.mcr.stdserverex.espserver=false
-Dgenesys.mcr.stdserverex.itxrequired=false
-Dgenesys.mcr.stdserverex.scsrequired=true
-Dgenesys.mcr.stdserverex.chatrequired=false
-Dgenesys.mcr.stdserverex.ucsrequired=false
-Dgenesys.mcr.stdserverex.ucsclusterrequired=false
-Dgenesys.mcr.stdserverex.espserver.multipleespports=false
-Dgenesys.mcr.stdserverex.lmsfile=dmserver.lms
-Dgenesys.mcr.stdserverex.infoproviderservice=com.genesyslab.mcr.smserver.OwnInfoProvider
-Dgenesys.mcr.stdserverex.flexchatprotocol=true

JVM parameters for DMS-w

-Dgenesys.mcr.stdserverex.apptype=CFGSocialMS
-Dgenesys.mcr.stdserverex.espserver=true
-Dgenesys.mcr.stdserverex.itxrequired=true
-Dgenesys.mcr.stdserverex.scsrequired=true
-Dgenesys.mcr.stdserverex.chatrequired=true
-Dgenesys.mcr.stdserverex.ucsrequired=true
-Dgenesys.mcr.stdserverex.ucsclusterrequired=false
-Dgenesys.mcr.stdserverex.espserver.multipleespports=false
-Dgenesys.mcr.stdserverex.lmsfile=dmserver.lms
-Dgenesys.mcr.stdserverex.infoproviderservice=com.genesyslab.mcr.smserver.OwnInfoProvider
-Dgenesys.mcr.stdserverex.flexchatprotocol=true

Configuration layer connections

You must ensure the following connections in CME configuration:

DMS instance Connects to
DMS-d Solution Control Server

Message Server, if required

DMS-w Chat Servers

Contact Server or cluster
Interaction Server
Solution Control Server
Message Server, if required

Comments or questions about this documentation? Contact us for support!