I am developing a system to send VoIP notifications to terminals with APNs.
I understand that the maximum JSON Payload for VoIP is 5kb.
If I want to send VoIP notifications to 3000 terminals, I am considering sending 3000 requests in parallel from the system to the APNs, will the APNs guarantee that the notifications will be sent to each terminal without a significant time lag when receiving 3000 requests simultaneously?
3000 notifications in parallel will not be an issue for APNs. But if will want to be sure that you have enough bandwidth for the requests and the responses, and you have enough HTTP/2 connections sufficiently spread across multiple APNs hosts, so you don't DoS yourself by not having enough parallel connections causing queueing of requests, and do not DoS APNs by pinning to one or only a few APNs hosts.
You would want to use as many hosts as you can afford, open as many connections per host that it has resources for, and make sure you use non-cached DNS requests to make sure you get a fresh IP address every time.
To make sure you are fairly balanced across multiple APNs hosts, we suggest the following:
- do not bring up all the the connections simultaneously
- spread out the time between opening each connection for a few seconds
- use uncached DNS requests to make sure you are getting a fresh reply every time
- if you are able to, avoid reusing already used IP addresses for each connection (of course this depends on how many total connections you will have - repeats are unavoidable)
- do not create a static list of IP addresses for reconnections, always use a fresh DNS query
- once you create the connections maintain them as long as possible
How many push requests you can send per second per connection will depend on your available bandwidth.
Argun Tekant / DTS Engineer / Core Technologies