6

I need to send millions of apple push notification like Urban Airship within several seconds

I used the following

I have several dedicated servers, I can send thousands of push notification within several seconds, but how can I send millions of apple push notification like Urban Airship within several seconds?

Md Mahbubur Rahman
  • 2,065
  • 1
  • 24
  • 36
  • 1
    Have multiple servers... – Lawrence Cherone Aug 29 '12 at 05:41
  • @LawrenceCherone Yes. I have multiple file server, multiple database server and multiple memcached server. – Md Mahbubur Rahman Aug 29 '12 at 05:42
  • 1
    Number of servers required = 1,000,000 / max number notifications per server per second. – Robbie Aug 29 '12 at 05:43
  • I added the time frame. I could be more precise by suggesting you check where the bottleneck is (network card, suggest adding more network interfaces, firewall processing, CPU, Memory etc). But addding more servers is the simplest option when you run into limits. – Robbie Aug 29 '12 at 05:49
  • @Robbie Isn't Servers = Amount To Send / Max Number, kind of [embarrassingly paralel](http://en.wikipedia.org/wiki/Embarrassingly_parallel)? – classicjonesynz Aug 29 '12 at 05:57
  • You could always try sending them up to 30 seconds before they're absolutely needed. The time it takes for a user to notice the notification and respond to it gives you at least an extra 15 second window to dispatch the same notification in. –  Aug 29 '12 at 06:06
  • You know whats cooler than that? BILLIONS of push notifications ;) – deleted_user Sep 06 '12 at 08:59
  • Maybe you just split them up to packages of thousands and send the packages each after another? A difference of just some seconds shouldn't be that hard? Otherwise you will need a very large amount of servers. ;) – miho Sep 06 '12 at 18:23
  • @mihohl, i think your comment is better one. would you please give us details info? With coding and server related infrastructure and others. – Md Mahbubur Rahman Sep 07 '12 at 08:41
  • This link may be helpful to you http://stackoverflow.com/questions/14563097/sending-multiple-iphone-push-notifications-apns-php-tutorial – Subodh Ghulaxe May 17 '13 at 05:10
  • 1
    @MahbuburRAaman Are you able to achieve this ? Looking for the same. Thanks +1 – Mangesh Jul 16 '13 at 08:21
  • @iMangesh, thanks to you also. Yes, I have achieved this. Not only I needed better server, also I have utilized the power of low level languages and high level languages (Shell Scripting, C++, Python, PHP). And proper utilization of Database also. – Md Mahbubur Rahman Jul 16 '13 at 13:55

3 Answers3

9

Every server has limited capacity to perform certain task. You cant assume that your dedicated server with some xyz configuration will achieve every NFR for you application. You have to do server capacity planning to achieve your application NFR. If your dedicated server is able to send 10K of push notification with in 1 seconds with optimize configuration of server and application, and you want to achieve 20K of notification in 1 second, you have to do horizontal/vertical scaling of server.

In horizontal scaling you put another parallel instance and divide the task between them, however in vertical you scale the same server to have higher configuration. Vertical scaling is somehow not recommended as it has single point of failure.

For your problem to scale you have to put another instance in parallel in divide the push notification sending task between them. For example if you want to send 20K push notification with in a second for 20K devices, you can divide first 10K to first server and next 10K to another one. This will achieve your NFR of sending 20K push notification with in a second.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
Ajay Tiwari
  • 3,388
  • 1
  • 17
  • 13
4

my 2cents worth.

max Apple push payload = 255bytes

1 million iOS devices = 1,000,000

package that into a single file = 255,000,000 bytes = 255MB.

open up a TCP connection + forward all contents to APNS gateway(s). That's the fastest way I could think of. Pre-process and pre-package your payload into a single or multiple files locally before dispatching them to targetted APNS server grid.

dklt
  • 1,703
  • 1
  • 12
  • 12
2

It depends on your bandwidth and processing speeds of your server. A single server is incapable of sending 142857 packets including payload a second, thats why your seeing a limit.

You would need several dedicated servers, and a control server that will send a single job to the APN servers via an internal API, this way the job can be distributed.

Lawrence Cherone
  • 46,049
  • 7
  • 62
  • 106