0

Hi anyone has some experience on scaling GCM XMPP ? https://developer.android.com/google/gcm/ccs.html Im reading docs there but Im not sure about this 100 pending msgs on 1 connection. I read somewhere that there is limit to 10 connections on server, is it right ? What f I will run 5 servers, each will open 10 connections, should it work well ?

FrancMo
  • 2,459
  • 2
  • 19
  • 39

1 Answers1

0

Regarding 100 pending messages:

So apps can use "messages with payload" " to deliver messages of up to 4 Kb. This would be useful in a chat application, for example. To use this feature, simply omit the collapse_key parameter and messages will not be collapsed. GCM will store up to 100 messages. If you exceed that number, all messages will be discarded but you will receive a special message. If an application receives this message, it needs to sync with the server.

Regarding Server connection limit:

You can allow your server to send up to 4000 messages per second on the persistent connection. Knowing you are allowed up to 10 connections, you can possibly send many notifications fast (up to 40k notifications per second).

So you can speed up the message delivery on a device without eventually increasing the number of connections or number of servers but rather splitting your array of devices.

For faster delivery try these methods: 1. delay_while_idle - set to false 2. time_to_live - set to zero (but we have set to 30 for just in case) 3. Canonical IDs - Make sure Canonical IDs returned by GCM replace the old PushID in database 4. collapse_key - The most important factor - set it to random or TOD to avoid Google to throttle notifications.

In extreme case you can always airpush.

AniV
  • 3,997
  • 1
  • 12
  • 17
  • Your question meant as if you want to speed up the messages through GCM. Please correct me if I am wrong!!! – AniV Mar 31 '15 at 16:11
  • No , question is about connection limit, what if I run 5 server and on each I will open 10 connections. – FrancMo Mar 31 '15 at 19:07
  • @AniV Can you bring any reference for those numbers you mentioned please ? :) I'm also dealing with the some problems maintaining consistent connections, but am creating a lot more than only 10 connections. You can see my question here and if you have any answer I would be really grateful! Thanks https://stackoverflow.com/questions/47702580/gcm-xmpp-socket-consistently-getting-epipe-and-disconnected-when-sending-notific – SpiXel Dec 07 '17 at 19:42