当前位置:网站首页>Performance test of API gateway APIs IX in Google cloud T2a and T2D

Performance test of API gateway APIs IX in Google cloud T2a and T2D

2022-07-28 10:11:00 InfoQ

background

2022  year  7  month  13  Japan  Google Cloud  Released the first one based on  Arm  Architecturally  Tau T2A  Of  VM  Series Preview .T2A VM  Based on  Ampere Altra Arm  The processor provides support , Google claims that it has an attractive price and excellent single thread performance .

It is worth noting that ,Ampere Altra Arm  It is a cloud native processor , be based on  Ampere Altra Arm  The processor  Tau T2A  Virtual machines can therefore run horizontally expanding cloud native applications in an efficient way .

How about the actual experience and performance ? We take a cloud native  API  For example, gateway , Take a look at  Google Cloud Tau T2A  Virtual machine performance . here , We chose  Apache APISIX  stay  Google Cloud Tau T2A  Install and test on the server environment .

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

null

Preparation

The first thing you need to do is  Google Cloud  Previous start one  T2A  example , Operating system selection  Ubuntu 20.04.

null
Then install  Docker, Facilitate the subsequent use of containerization to install and deploy  Apache APISIX.

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

Deploy  Apache APISIX

Apache APISIX  Use  etcd  As configuration center , So here we need to start one  etcd  example .

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

start-up  Apache APISIX  example .

sudo docker run --net=host -d apache/apisix:2.14.1-alpine

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
 }
 }
}'

Access test .

curl -i http://127.0.0.1:9080/anything/das
HTTP/1.1 200 OK
.....

Google Cloud T2D vs Google Cloud T2A

From the above operation ,Apache APISIX  stay  Google Cloud Tau T2A  The installation and compatibility test on can be successfully completed . that  Google Cloud T2A  What is the actual performance of ? Next we will use  Apache APISIX  Respectively in  Google Cloud T2A  and  Google Cloud T2D  Do performance test comparison on , Look at its actual performance .

Google Cloud T2D  yes  Google Cloud Tau  Another model of the series , Is based on  AMD x86  Architecturally ,  So the above  etcd  The installation steps are slightly different :

sudo docker run -d --name etcd \
 -p 2379:2379 \
 -e ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379 \
 -e ALLOW_NONE_AUTHENTICATION=yes \
 -e ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379 \
 bitnami/etcd:3.4.16

For the sake of simplicity , This test  APISIX  Only one is enabled in  Worker, The following performance test data are in single core  CPU  Up operation .

Scene one : Single upstream

In this scenario, a single upstream ( 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  2: Single upstream  +  Two plug-ins

In this scenario, a single upstream and two plug-ins will be used , Main tests  APISIX  In the open  
limit-count
  and  
prometheus
  The performance of two core performance consumption 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 , Respectively from the
request  QPS
Queries per second
)  and
Delay time
The two levels are tested and compared . give the result as follows :

  • QPS  Compare

null
  • Request delay comparison

null


It can also be seen from the above data , stay  API Gateway  Wait for the Internet  IO  Intensive computing scenario ,T2A  Compared with the same series  T2D  virtual machine , There is still a gap in performance . But another good news is , In the same configuration ,T2A  The price of  T2D  cheap  10%  about . In actual machine selection , Users can make flexible decisions according to their business volume .

summary

This article mainly uses  Apache APISIX  contrast  Google Cloud T2A  and  Google Cloud T2D  Performance of . It can be seen that , stay  API  Gateway and other networks  IO  In the intensive computing scenario ,Google Cloud T2A  comparison  T2D, Although the performance is not so bright , But as a  Google Cloud  stay  Arm  The first attempt under the framework , I believe it will be in  Arm  Continue to work on the virtual machine of the architecture , We also look forward to the performance of its subsequent iterations .
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/209/202207280956465538.html