Configure app engine push task queue for twilio SMS verification

寵の児 提交于 2019-12-25 03:44:19

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/29267343/configure-app-engine-push-task-queue-for-twilio-sms-verification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!