Flow control in chat rooms

Update time: 2023/10/25 02:27:44

Due to the flow control logic in chat rooms, some messages may be dropped when participants send a large number of text messages and custom messages, such as gift messages in a chat room. This document describes how to handle traffic spikes in chat rooms.

What is Flow control in chat rooms?

  • Flow control methods

    Two Flow control methods are provided for messaging in chat rooms. For regular messages, users in chat rooms can receive up to 20 messages per second, and additional messages will be randomly dropped due to flow control logic. For high-priority messages, at most 10 messages are received per second. and additional high-priority nessages are not guaranteed to be delivered.

  • Why flow control is implemented?

    CommsEase introduce flow control for the following reasons:

    • A traffic spike in chat rooms may lead to high overhead for client UI rendering. A large number of messages may stop apps from responding. The visual user experience from message refreshing may degrade. Flooding messages are difficult for users to handle and the user experience is compromised.
    • Though servers can scale up and load balancers can handle traffic spikes, a surge in chat room traffic may overload a single server, resulting in slower login to the chat room and increased time-consuming for messaging in the chat room. This also affects the user experience.

If you have custom requirements, you canrequest additional quota for Flow controlby contacting our sales manager on CommsEasehomepage.

  • Handle regular messages and custom messages that cannot be lost, such as gift messages, as follows:

    • Ordinary messages are sent from clients. For details, see the documents for messaging in chat rooms.
    • Custom messages are sent by calling the Server API (chatroom/sendMsg.action) with the highPriority parameter set to true. In this case, custom messages are sent as high-priority messages. For more information, see Messaging in chat rooms.
  • For gift messages, the following solutions can be used to handle scenarios when the number of gift messages exceeds the upper limit of high-priority messages per second.

    Solution 1 Apply different strategies according to the level of gifts. For example, 5 gifts per second for regular gifts and 5 gifts per second for advanced gifts. The quota of unused advanced gifts can be allocated to regular gifts.
    Solution 2 If the number of regular gifts is high, combine multiple regular gifts into one message for delivery. If the number is still high and the number of combined regular gift messages exceeds the upper limit, some ordinary gift messages will be dropped. If a large number of gifts are flooding chat rooms, users will not notice whether a small amount of regular gift display is lost.
Was this page helpful?
  • What is Flow control in chat rooms?
  • Recommended solutions