How to Avoid Kintone REST API limits

Contents

Introduction

This article covers how to monitor Kintone’s API concurrency limits and what actions may cause them to be exceeded. The concurrent connection limit can significantly impact how customizations should be structured on Kintone Apps.

About Concurrent API Connections

This section explores the concept of concurrent API connections and what it entails.

First, here’s an image showing the flow of an API request.

Kintone processes each API request according to the flow shown above.

The following shows two API requests that are processed simultaneously on the Kintone server.

Kintone imposes a limit of 100 concurrent API connections per domain.

In other words, a maximum of 100 simultaneous REST API connections can be made to a single Kintone environment.

What Happens When the Concurrent Connection Exceeds 100

When the number of concurrent connections exceeds 100, an HTTP status code 429 is returned from the REST API requests.

At this point, no REST API requests can be processed until the number of concurrent connections falls below 100.

Below is an example of what it looks like when API requests are blocked:

Impact on Kintone Usage When Concurrent Connection Exceeds 100

If the number of concurrent connections exceeds 100 for an extended period, it can impact overall system performance. Not only will REST API requests be affected, but Apps not using the API may also slow down. Users might experience delayed responses, and a 429 Error message may appear.

Reasons for Setting the Concurrent Connection Limit to 100

The concurrent connection limit of 100 is established to reduce the load on the Kintone server.

Without this limit, API requests could accumulate on the server, resulting in significant strain on the Kintone servers.

In extreme cases, the usage of Kintone REST APIs could become unavailable, and cause the Kintone platform itself to become inaccessible.

What Kind of Situation Is Likely to Increase the Concurrent Connection Count?

Concurrent connections typically increase when the load on the Kintone server escalates.

For instance, during periods of increased communication between the application server and the database server as shown in the previous image.

Specific scenarios that may lead to an increase in concurrent connections include:

  • Sending multiple requests within a brief time, especially using resource-intensive APIs like the Bulk Request API
  • Performing heavy operations such as bulk reads, deletions, or App updates that put greater load on the server
  • Running customizations or scripts that issue numerous REST API requests simultaneously or in rapid succession
  • Additional factors, such as user activities and network conditions

Methods to Check the Concurrent Connection Count and Countermeasures

Given that the increase in concurrent connections is caused by multiple factors, unfortunately, there is no guaranteed way to prevent it entirely. However, several countermeasures can be implemented:

  • During development, design your scripts to minimize unnecessary REST API requests.
  • Implement logic within the program to monitor the concurrent connection count and adjust processes to avoid 429 errors.

There are two ways to check the API concurrent connection count:

Note that concurrent connection counts may remain below 100 at certain moments, but can unexpectedly spike. Therefore, a review of operational practices and program structures is advisable.

Finally

This article explains the concurrent connection limit of 100 for the Kintone REST API.

The increase in concurrent connections can arise from diverse factors.
This information helps developers create better customizations and program structures using the Kintone REST API. It also encourages users to review and improve existing customizations.