Heroku API Rate Limit
Heroku enforces an API rate limit at the account level. Heroku's API rate limit is applied across an entire account rather than being specific to individual applications. This means that all API calls made within an account, regardless of the application, contribute to the same rate limit.
When the rate limit is exceeded, further API calls are prevented until the rate limit resets. The Heroku API rate limit resets on an hourly basis. This means that any blocking of API calls due to exceeding the limit is temporary and will be lifted at the start of the next hour, allowing API interactions to resume.
HireFire makes use of several strategies to minimize the number of API calls and thereby mitigate the risk of hitting the rate limit:
- Caching Dyno Formation: HireFire caches the dyno formation information locally for 15 minutes. This reduces the frequency of API calls required to fetch this information, as the cached data is used for decision-making within this timeframe.
- Batch Scaling Operations: HireFire performs scaling operations in batches, further reducing the number of API calls.
While HireFire implements mechanisms to optimize API call usage, users can take additional steps to prevent hitting the rate limit:
- Caution with "Restart Crashed Dynos" Feature: We recommend users exercise caution when enabling the "Restart Crashed Dynos" feature. This feature requires fresh dyno information for every checkup, bypassing the cache mechanism which leads to an increased number of API calls. Only enable this feature if it's essential for your application's operation and you understand the implications for API usage. Almost no application requires this feature, so we advise against enabling it.