I keep getting error responses (“too many requests”) with HTTP status code 429. How do I fix this?

To ensure a positive (and fair) experience for all Cloud API customers, we limit the number of concurrent connections to the service for a given application (identified by the API key) to one. A 429 HTTP status code will be returned when an application attempts to make more than one call to Rosette API at one time. This includes the same application running simultaneously in multiple instances, on multiple or a single machine.

A "Connection" is defined as an unclosed TCP socket from your application to Rosette API Cloud services. Depending on the underlying HTTP client library, a socket may not be closed promptly when the call to Rosette API completes so the next call may take place with a new connection while the previous one is still active, resulting in a "429" error. If your application is multi-threaded, this is very likely to occur as each thread may attempt to connect on its own. To address this, you can write your own code to ensure proper closure of sockets and request queuing for multithreads, or better yet, use one of the Rosette API Client Bindings.

To use a Rosette API Client Binding, you should create a single instance of the client and keep using it for all your calls. A single client instance maintains a pool of TCP socket connections (defaults to 1, unless your plan allows for more) to the service therefore will not trigger the "429" error. Using the same client instance also helps to reduce processing time since socket creation, a pretty expensive operation, will be done only once.

If your application requires multiple concurrent streams of calls and you are on a paid plan, please contact support. You can also request to try Rosette API On-Premise which gives you total control of the software.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.




Powered by Zendesk