Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio queue overflow error: how large is the queue?

Twilio's Message resource has a "status" property that indicates whether a SMS message is "queued", "sending", "failed", etc. If a Message instance failed to deliver, one possible error message is "Queue overflow". In the Twilio documentation, the description for this error case is: "You tried to send too many messages too quickly and your message queue overflowed. Try sending your message again after waiting some time."

Is the queue referenced in error code 30001 an instance of this resource? https://www.twilio.com/docs/api/rest/queue

Or is the queue (in the case of a 30001 error code) something that Twilio maintains on their end? If Twilio does throttling behind the scenes (queueing SMS messages per sending phone number), what is the size of that queue? How much would we have to exceed the rate limit (per phone number) before the queue overflow referenced in error code 30001 occurs?

like image 265
Emily Chen Avatar asked Jun 17 '16 21:06

Emily Chen


1 Answers

Emily, message queue is not related to the queue resource you linked to above and it is something maintained on our end.

Twilio can queue up to 4 hours of SMS. This means, we can send out 1 sms per second, if there are more than 14,400 messages in the queue, all the messages queued up after will fail with 30001 error queue overflow and will not be sent. This info is for Long Code numbers. The link above explains processing for other scenarios.

A few suggestions to avoid the error:

  • Keep messages to at most 160 characters if possible. But if not possible, calculate how many SMS messages each message will be (if you are not sure you can always send 1 test message and see how much you are charged for that message).
  • Based on the assumption that your messages is 160 characters, throttle the sending rate to 3600 messages per hour (1 messaage/sec * 60 sec/min * 60 min/hr).

Please let me know if you've got any other questions.

like image 105
Megan Speir Avatar answered Sep 28 '22 10:09

Megan Speir