0

Hi all,

I am doing web services for an Android application which sends push notification. Below is the scenario:

  1. I have 100s of customers registered on the website
  2. Each user has his own subscribers list
  3. Each user can schedule the push notification to be sent at a specific time
  4. I will be running a cron file which will check for the messages to be sent

Now I want to know that let's say there are 5 users A, B, C, D, E

1) User A has scheduled 10000 messages to be sent at 1 PM
2) User B has scheduled 50000 messages to be sent at 1 PM
3) User C has scheduled 15000 messages to be sent at 1 PM
4) User D has scheduled 25000 messages to be sent at 1 PM
5) User E has scheduled 30000 messages to be sent at 1 PM

What will happen in this case?

The cron will run every 1 minute and based on the descending IDs from the message table it will pick records

So the loop will start at 1PM and will pick the record which was inserted in the end that is for User E
Then next minute it will pick User D message which will start at 1:01 PM

Like this the User A message will start at 1:05 PM but he has scheduled for 1 PM

This is a scenario of just 5 users what will happen when 100s of users will schedule at same time?

I need you guys to guide me and let me know a proper way to do it.

how Bulk SMS/Email solutions works when they have 100s of users scheduling at same time?

Any help in this regard will be highly appreciable...

regards

2
Contributors
7
Replies
32
Views
3 Years
Discussion Span
Last Post by Muslim_1
0

Hi Muslim_1

I would look into phpDaemon, it should help solve your problem, rather stay away from Cron to do this type of thing.

http://daemon.io/faq.html

I have had much success using daemons written with PHP. My thoughts are you could simply send all those messages simultaneously using something like phpDaemon.

0

@andrevanzuydam

Thanks for your reply.

Can you please share an example or some sample code which you have done to acheive this

0

I will see what I can do, the scenarios I have done this for are more complicated, I should be able to create a scenario for your situation. Will you be able to implement the phpDaemon service ? Running services in general requires some type of admin on the server.

0

@andrevanzuydam

No idea about this in any way. Could you please help me in this matter?

0

The first thing to determine is will your hosting provider allow you to run services and do you plan to setup the server yourself? The best operating system for running services for PHP is Linux, which you already seem to be running. It does not help I give you a solution and you are unable to implement it.

0

I have a VPS account on web hosting and I have root access too.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.