Questions about API throttling and performance

For requests or help with our API
Post Reply
mandmdiet
Posts: 113
Joined: Tue Aug 17, 2021 9:37 am

Questions about API throttling and performance

Post by mandmdiet » Tue Dec 20, 2022 9:06 am

I'm looking for your help with some things on our mind about the future of our application and the interaction with the Open Dental API.

We have a new application that makes use of the API that is currently in beta. During our testing there have been a few times where we have gotten timeouts when using the Open Dental API that on our side seemed to correlate to a larger number of simultaneous requests to the OD API. In all cases when we investigated we found that there were some things our application was doing a bit inefficiently and so we were able to make some changes to resolve the issue. This got us thinking, however, about the future of the application and whether we might run into these same issues as we scale the application to service a larger number of clients even once we have all of our inefficiencies worked out.

To that end, we would like to better understand what was happening when we received those timeouts and how we can make sure our code is written in a way where we avoid that problem. Given that the number of requests we were making didn't seem like they would overwhelm the API, we were thinking the timeouts were due to some throttling mechanism in the Open Dental API. And so I guess my first question is, is it expected that when a request is throttled by the OD API that the behavior we observe would be a timeout? This is the one reason we thought maybe the timeout wasn't due to a throttle because I would expect that a throttle action would be a more immediate response from Open Dental with perhaps a 429 so that we could know to wait a few seconds and retry the request. To be clear, when we made the requests individually instead of simultaneously there was no timeout and the response was quite fast, this is how we ruled out the possibility of slow query performance.

Lastly, we have one final question with a follow up about the throttling in the Open Dental API:

Is the throttling done on a per-application basis or on a per-practice basis? If it is a per-application throttle, is there a way to loosen up the throttling if after adding several practices we start encountering performance issues related to the throttling?

Thanks for helping us get these questions answered.

justine
Posts: 169
Joined: Tue Dec 28, 2021 7:59 am

Re: Questions about API throttling and performance

Post by justine » Tue Dec 20, 2022 11:42 am

mandmdiet wrote:
Tue Dec 20, 2022 9:06 am
I'm looking for your help with some things on our mind about the future of our application and the interaction with the Open Dental API.

We have a new application that makes use of the API that is currently in beta. During our testing there have been a few times where we have gotten timeouts when using the Open Dental API that on our side seemed to correlate to a larger number of simultaneous requests to the OD API. In all cases when we investigated we found that there were some things our application was doing a bit inefficiently and so we were able to make some changes to resolve the issue. This got us thinking, however, about the future of the application and whether we might run into these same issues as we scale the application to service a larger number of clients even once we have all of our inefficiencies worked out.

To that end, we would like to better understand what was happening when we received those timeouts and how we can make sure our code is written in a way where we avoid that problem. Given that the number of requests we were making didn't seem like they would overwhelm the API, we were thinking the timeouts were due to some throttling mechanism in the Open Dental API. And so I guess my first question is, is it expected that when a request is throttled by the OD API that the behavior we observe would be a timeout? This is the one reason we thought maybe the timeout wasn't due to a throttle because I would expect that a throttle action would be a more immediate response from Open Dental with perhaps a 429 so that we could know to wait a few seconds and retry the request. To be clear, when we made the requests individually instead of simultaneously there was no timeout and the response was quite fast, this is how we ruled out the possibility of slow query performance.

Lastly, we have one final question with a follow up about the throttling in the Open Dental API:

Is the throttling done on a per-application basis or on a per-practice basis? If it is a per-application throttle, is there a way to loosen up the throttling if after adding several practices we start encountering performance issues related to the throttling?

Thanks for helping us get these questions answered.
Hello mandmdiet,

When throttling happens, you would not expect a timeout. Timeouts are typically caused by one or two things. The call involves too much data (unlikely), or there is a network/service issue.

Requests are throttled based on a API mode, API permission and customer key.

Local/Service Mode: Throttling does not occur in Local or Service mode.
Remote Mode: Throttling occurs at two different rates, 1 call per second or 1 call per 5 seconds. The API Read All permission is 1 call per 5 seconds. This is the free tier. Add any other permission and the rate changes to 1 call per second.

Throttling is handled on a per-practice level (customer key).

When requests come in and throttling occurs, we do not return a 429, we simply queue the requests and they are processed in the order they are received. Throttling may take place once we receive the call. Real world conditions may impact overall call time due to outside network traffic and other variables.

Open Dental's API was built to scale. We have several developers making 50k+ calls per day without issue.
Additional information can be found in this post.

Post Reply