JuAPI, the latest API management tool created by aggregated data, has just been launched. As system developers, we were excited to run a performance comparison test to see if our product lived up to its promise of being simpler, freer, and, above all, faster.

The test was conducted on three computing ECS virtual machines with 2CPU+4G memory (instance type: ECS.c7.large) on Ali Cloud, running Ubuntu20.04 system, one of which acted as Nginx traffic barrier, one ran AB, and one ran API gateway. The API gateways planned for testing include:

hyperapi
Kong
goku
APISIX
Copy the code

The test was simply a simple request-forwarding scenario, accessing a static page on Nginx upstream of the gateway, all gateways configured with apiKey authentication and their RateLimit plug-in enabled.

Without further ado, here’s the result:

Refer to the Benchmark section of the project documentation for detailed configuration of each gateway in the test and the test commands to run.

Baseline

First, we used AB to test the performance of nginx to return a static page as a benchmark. Under the condition of 100 concurrent 500,000 requests, the CPU of nginx server is above 90%, and the number obtained is QPS: 38756.59

hyperapi

Hyperapi is the github name for JuAPI’s gateway. Hyperapi is an open source API gateway based on the Rust language, the Tokio asynchronous framework, and the Hyper library.

In this test, the gateway service was started with a handwritten static configuration file. In the test run of 200 concurrent 500,000 requests, the CPU usage of hyperAPI process was close to 100%, and the CPU usage of back-end Nginx process was about 20%. The final QPS was 10164, with no request errors. 99% request latency <26ms.

Kong

Kong is a well-known open source API gateway product, based on the development of Nginx and Lua, the product is divided into enterprise edition and community edition, official also provides a variety of system package management tools support, here is using Ubuntu apt-get to install Kong.

The Gateway configuration of Kong supports RESTful interfaces and configuration files. In order to simplify the configuration, the Database and management system are not installed here, and the Kong gateway is also started by handwritten configuration files.

In a test run with 200 concurrent 500,000 requests, Kong’s process CPU utilization was close to 100%, the backend Nginx process CPU utilization was about 20%, and the final QPS was 9598 with no request errors and 99% request latency <68ms.

Kong is an old open source gateway project, and the document quality is the best among the products compared, which is a good example for us to follow.

Goku

Goku is eolinker API gateway software, developed using Go language, products are divided into community edition and enterprise edition. However, the documentation of the Goku community version to be tested here is seriously missing. Although the console and gateway node are successfully installed through Docker, the test fails to be completed because it is stuck on the authentication-type set by Strategy Authentication. Maybe Eolinker does not want users to use the community version. According to the comparison of Kong’s test results on Goku website, it is estimated that the performance level is the same as that of Kong.

APISIX

As APISIX, a newly promoted top-level project of Apache, the test data on its official website amazed me. It can support 14000+ QPS with single core, and it is also an API gateway product based on Nginx and Lua. The performance level of Kong is very close to APISIX without enabling plug-ins in the same test environment. However, when limit Rate + Prometheus was enabled, performance dropped to around 2500QPS, perhaps due to the high cost of passing data between the Nginx and Lua virtual machines.

Here is the APISIX gateway and Dashboard installed using Docker as instructed in the APISIX manual. A service is configured in Dashboard, enabling apikey authentication and limi-req plug-in. Under the same hardware conditions, it does not show great advantages over Kong: In the test run of 200 concurrent 500,000 requests, APISIX process CPU utilization was close to 100%, back-end Nginx process CPU utilization was about 20%, the final QPS was 9385, no request errors, 99% request latency <46ms.

conclusion

With the high performance of the Rust language and the excellent asynchronous computing implementation of the Tokio framework, HyperAPI is in the top tier of API gateway products without special performance tuning. Of course, it could be that the project is young, features are streamlined, and there is a constant focus on performance in subsequent iterations of product features.

The P.S. test uses a preemptive instance of Aliyun ECS, enabling external IP to pay by traffic. The total cost of the half-day test is 2 RMB.

www.sdk.cn/details/eqZ…