0

This question is a follow up to How to implement an atomic integer in Java App Engine?. Basically I am create a push Task Queue to implement SMS verification. I am using Twilio to send the SMS. Each SMS is a five digit pin number. The following is my queue.xml file for app-engine.

<queue-entries>
  <queue>
    <name>sms-verification</name>
    <rate>200/s</rate>
    <bucket-size>100</bucket-size>
    <max-concurrent-requests>10</max-concurrent-requests>
  </queue>
</queue-entries>

I want the best rate I can get without creating a new instance. I believe instance creation is expensive on app-engine, though I am not sure if it's the same for task queues. So is this configuration file good? Is it missing anything? This is my first time creating one so thanks for any guidance.

Community
  • 1
  • 1
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199

1 Answers1

0

There is no right or wrong answer to this question. You will have to play with the configuration settings to get the optimal results for your requirements. You need to take the following into account:

  1. You load throughout the day/week: more or less even or with sharp peaks.
  2. Delay tolerance: how long it is acceptable to wait until the message is sent.

Obviously, it will be more expensive if you want to send all messages immediately, and less expensive if you can tolerate even a small delay (e.g. 1 minutes) as it would smooth out at least some sudden peaks.

Note that the higher the volume, the less important these optimizations become, as 1 new instance over 20 live is not as expensive as 1 new instance over 1.

Andrei Volgin
  • 40,755
  • 6
  • 49
  • 58
  • It would seem that the bottleneck is that a Twilio phone processes one SMS per second. And since the PO seems to be thinking of 10 phones, these numbers may be the limiting factors. I don't know enough to answer, but my guess is there might be a more definite answer. Check out: https://www.youtube.com/watch?v=22n06z0rq4c – Konsol Labapen Mar 25 '15 at 22:45
  • Good point, 200/s probably won't work with 10 phone numbers. This is a different limitation, however, not related to Task API. I don't know what happens if Twilio throughput is exceeded, but from the Task API point of view a task would succeed even if Twilio responds with the error message. This is something that the OP will have to take into account. – Andrei Volgin Mar 25 '15 at 22:55