Overview

Welcome to the wonderful world of Flowroute Messaging! We have recently released v2.1 of our Messaging API with MMS capability and other added features. As you use the service, eventually you will come to the question: "How many messages can I send?"

As a Flowroute customer, you are limited on the number of messages that you can send as measured in transmissions per second (TPS). See Sending and Receiving Limitations in Flowroute's Messaging Best Practices to learn more.

Transactions Per Second (Message Sending Attempts)

Let’s say that you have an overall sending rate of 5 TPS. Let's look at the scenario of each second within a 10-second period relative to the number of messages you have sent, or transaction attempts per second.

Second Number of Transactions
1 4
2 4
3 4
4 4
5 6
6 4
7 4
8 6
9 4
10 6
Total 46

Given the sending rate of 5 TPS, you might say that over a 10-second period, all 46 SMS messages should have been delivered, right? Let’s have a closer look and understand why that might not be the case:

At seconds 5, 8, and 10, the customer would have seen at least one rate limit response — an HTTP 429 from Flowroute — because within that second, or 1000 milliseconds, there was actually an attempt to send more than 5 messages.

Given the failed messages with no retries, the customer could send 46 transactions or SMS messages in 10 seconds but Flowroute will only accept 43. This will look like an average of ~4.3 transactions per second, since Flowroute counts the true TPS, or actual number of messages you have attempted to send within a single second, not the number of successful messages sent. This makes it look like you are only getting a throughput of ~4.3 TPS when you should be getting 5 TPS.

To compound the problem, if you retry sending those failed messages in the following second, then that additional 1 SMS would be delivered. However, if there was a slight delay in your retry and the attempt was sent at second 8, then you would see a total of 7 SMS send attempts during that period (6 + 1 retry). This means that 2 of those messages would receive an HTTP 429 response.

Flowroute's Rate Limiting Technique

Flowroute’s rate limiting technique is a bit more granular than this, although not hard to understand. If you are granted a sending rate of 5 TPS as a customer, then you can send 1 message or transaction every 200 milliseconds:

1000ms / 5 messages = 200ms

In this scenario, if you effectively time your message sending attempt every 200 milliseconds, then you will fully utilize your maximum capacity. If retries are necessary, those will need to fall within the 200-millisecond interval as well so as not to affect the other messages that are waiting to be sent. Note that the sending rate is applied to your user account tech prefix or access key and each endpoint that you hit. For example, user 290XXXXX can concurrently send up to 5 requests per second to /v2/messages and /v2.1/messages/{callback_type}.


Related Articles