当前位置:网站首页>Performance monster on arm64: installation and performance test of API gateway Apache APIs IX on AWS graviton3

Performance monster on arm64: installation and performance test of API gateway Apache APIs IX on AWS graviton3

2022-06-13 11:07:00 Apacheapisik China Community

background

AWS stay 2022 year 5 At the end of the month, the latest version based on ARM Architecturally AWS Graviton Family processor ——AWS Graviton3. According to the AWS Official data show , And Graviton2 Processor comparison , Based on leading DDR5 Memory technology ,Graviton3 The processor can provide up to 25% Performance improvement of 、 the height is 2 Times the floating-point performance and 50% Memory access speed ; The performance is similar to that of the same kind EC2 With the same instance ,Graviton3 Can also reduce 60% Energy .

So what about the actual data ? Let's take CPU intensive API For example, gateway , Let's see AWS Graviton3 How do you behave . Here we use Apache APISIX stay AWS Graviton2(C6g) and AWS Graviton3(C7g) Performance comparison test under two server environments .

Apache APISIX It's a cloud native 、 High performance 、 Extensible API gateway . be based on NGNIX+LuaJIT and etcd To achieve , And traditional API Gateway compared to ,APISIX It has the characteristics of dynamic routing and plug-in hot loading , It is especially suitable for the cloud native architecture API management .

Apache APISIX

Get ready : Installation and deployment

Before testing , It is necessary to prepare one to carry ARM64 Chip servers , Here we choose Amazon EC2 C7g( Now only this model is equipped with AWS Graviton3), The operating system chose Ubuntu 20.04.

Amazon EC2

At the same time to install Docker.

sudo apt-get update && sudo apt-get install docker.io

at present ,APISIX The latest version of ARM64 Mirror image , have access to Docker One click deployment . Refer to the following for the specific process :

  1. start-up etcd
sudo docker run -d \--name etcd -p 2379:2379 -e ETCD_UNSUPPORTED_ARCH=arm64 \-e ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379 \-e ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379 \rancher/coreos-etcd:v3.4.16-arm64
  1. start-up APISIX
sudo docker run --net=host -d apache/apisix:2.14.1-alpine
  1. Registered routing
curl "http://127.0.0.1:9080/apisix/admin/routes/1" \-H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '{  "uri": "/anything/*",  "upstream": {    "type": "roundrobin",    "nodes": {      "httpbin.org:80": 1    }  }}'
  1. Access test
curl -i http://127.0.0.1:9080/anything/das
HTTP/1.1 200 OK.....

AWS Graviton2 and AWS Graviton3 Performance comparison of

According to the above operation , be based on Official script It's done APISIX stay AWS Graviton3 Installation and compatibility testing on the processor . Let's take a look Apache APISIX stay AWS Graviton2(C6g) and AWS Graviton3(C7g) Performance on .

For testing purposes , In this example APISIX Only one... Has been opened Worker, The following performance test data are in the single core CPU Running on .

Scene one : Single upstream

A single upstream... Is used in this scenario ( Does not contain any plug-ins ), Main tests APISIX Performance in pure proxy back to source mode . Testing in a local environment :

# apisix: 1 worker + 1 upstream + no plugin#  Registered routing curl http://127.0.0.1:9080/apisix/admin/routes/1 \-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '{    "uri": "/hello",    "plugins": {    },    "upstream": {        "type": "roundrobin",        "nodes": {            "127.0.0.1:1980":1        }    }}'

Scene two : Single upstream + Multiple plug-ins

The other scenario uses single upstream and multiple plug-ins , Two plug-ins are used here . Main tests APISIX In the open limit-count and prometheus Performance performance of two cores when consuming performance plug-ins .

# apisix: 1 worker + 1 upstream + 2 plugins (limit-count + prometheus)#  Registered routing curl http://127.0.0.1:9080/apisix/admin/routes/1 \-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '{    "uri": "/hello",    "plugins": {        "limit-count": {            "count": 2000000000000,            "time_window": 60,            "rejected_code": 503,            "key": "remote_addr"        },        "prometheus": {}    },    "upstream": {        "type": "roundrobin",        "nodes": {            "127.0.0.1:1980":1        }    }}'

Data comparison

In the above two scenarios , The related tests and comparisons are carried out from the two aspects of request processing and delay time . give the result as follows :

  1. QPS contrast

QPS

  1. Latency contrast

Latency

From the data above, you can see , stay API The gateway is like this CPU In a dense computing scenario ,AWS Graviton3 Than AWS Graviton2 The performance of 76%, The delay is also reduced 38%. This figure is better than the one mentioned at the beginning AWS Official figures (25% Performance improvement ) And excellent .

summary

This paper mainly uses Apache APISIX the AWS Graviton3 And AWS Graviton2 Performance comparison of , You can see in the API gateway CPU In a dense computing scenario ,AWS Graviton3 It shows the properties of the performance monster . Of course , I also recommend you to practice more , We look forward to more test data of computing intensive projects in the future .

原网站

版权声明
本文为[Apacheapisik China Community]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206131103325237.html