Twilio queues messages based on the sending rate of a sender or an account. For example a US long code number can send one message segment per second, and a short code may send over 100 message segments per second.
Messages can only be queued for 10 hours and then they automatically fail. This queue length limit can be reduced by setting a lower Validity Period within your Messaging Service settings or in your API requests to send messages.
You can monitor the length on your queue via the Queue Insights dashboard.
For more information please view this FAQ.