google app engine - GAE Task Queues with ETA and large number of tasks -


in app, need send emails large number of users when event happens. i'd send emails out gradually instead of @ once. clarity in explaining, let's need send out emails 10,000 users.

i task queue maximum rate of 1 task/second. enqueue 10,000 tasks in batches, , emails sent out @ rate of 1/second.

i'd change using eta tasks instead of limiting task queue maximum rate. conceptually (except task submission batched):

now = datetime.utcnow() i, email in enumerate(email_list):     eta = + datetime.timedelta(seconds=i)     deferred.defer(send_email, email, _eta=eta) 

before implementing change this, i'd have confidence gae can efficiently.

if have 10,000 tasks in task queue, each different eta, gae task queue able efficiently monitor tasks , start them @ approximately (the precise eta isn't important) appropriate times? don't know algorithm google uses this.

edit:

imagine if inserted billion tasks in single day each eta. how gae monitor tasks make sure got fired off @ right time? polling tasks @ time interval (e.g., every minute) terrible solution. perhaps gae uses kind of priority queue. nice have confidence gae has implemented algorithm scale lot of tasks eta.

with stated daily quota of 10 billion tasks 1 think should able handle 10,000 of them :)

in current project i'm sending ~10,000 emails (sendgrid) tasks & _eta (although in batches of 25) works fine far...


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -