Are there really 5000 clients connecting every second? This is about 18 million messages per hour.
Yes... I'm calculating and projecting the system resources and database to support at least 100K users and one single message has at least five control and status messages in background ... see:
- Standard Custom message:
- When an user sends a message to a target (not group):
- 1. The source app calls the send message method in server...
- The server stores the payload (data) and sends a FCN to target (with no Payload), title NewMessage
- 2. The target app wakes Up, verifies the FCN message title and, if required(*), requests the message queue from server
(*Depending on the title of FCN, could be only a signal message - system control or operational)
- The server stores a Received Type message on the source queue and sends a fcn message to the source to alert that the target received and downloaded the message
- 3. The target opens the app (if not open yet). A POST "opened" method is sent to the server ... the server checks the contacts list of target and sends a FCM message with the "on line" status to the members that are also on line... the on line status and start time is updated on server -
- Depending on the number of members of the target contacts list, maybe generate two of more FCN messages (typically 5-6)
4. The user opens the chat and reads the message
- The server stores the READ status in the source messages queue and send a FCN message to alert
This is almost the cycle of only one user message in our systems... there are also system control messages, alerts, broadcasts... a highly active user in our system uses about 35 FCN messages per minute. Today we have about 1.000 today (about 5% are highly active and each server of app cluster is sized to reach 100K total - 10k highly active).
It's easy to reach 100K FCN messages a day with only 200 or 300 active users. Then, when I can use a direct "link" from source to target it's recommended because will save a lot of system capacity (specially when involving status update or broadcast messages).