You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sy...@apache.org on 2022/08/11 01:30:15 UTC

[apisix-website] branch master updated: docs: Add Azure test performance blog (#1280)

This is an automated email from the ASF dual-hosted git repository.

sylviasu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 0f1fee70b8a docs: Add Azure test performance blog (#1280)
0f1fee70b8a is described below

commit 0f1fee70b8a2b5cd31af7018b462f80d72bba1bd
Author: Sylvia <39...@users.noreply.github.com>
AuthorDate: Thu Aug 11 09:30:11 2022 +0800

    docs: Add Azure test performance blog (#1280)
    
    * docs: Add Azure test performance blog
---
 .../08/apache-apisix-performance-test-in-azure.md  | 220 +++++++++++++++++++++
 .../08/apache-apisix-performance-test-in-azure.md  | 219 ++++++++++++++++++++
 2 files changed, 439 insertions(+)

diff --git a/blog/en/blog/2022/08/08/apache-apisix-performance-test-in-azure.md b/blog/en/blog/2022/08/08/apache-apisix-performance-test-in-azure.md
new file mode 100644
index 00000000000..09e4d27b24c
--- /dev/null
+++ b/blog/en/blog/2022/08/08/apache-apisix-performance-test-in-azure.md
@@ -0,0 +1,220 @@
+---
+title: "API Gateway Apache APISIX performance testing in Azure"
+authors:
+  - name: "Shirui Zhao"
+    title: "Author"
+    url: "https://github.com/soulbird"
+    image_url: "https://github.com/soulbird.png"
+  - name: "Fei Han"
+    title: "Technical Writer"
+    url: "https://github.com/hf400159"
+    image_url: "https://github.com/hf400159.png"
+keywords: 
+- API gateway
+- Azure
+- Microsoft
+- Apache APISIX
+- Arm
+description: This article uses API Gateway Apache APISIX to compare the performance of Azure Ddsv5 and Azure Dpdsv5 in network IO-intensive scenarios.
+tags: [Ecosystem]
+---
+
+> This article uses API Gateway Apache APISIX to compare the performance of Azure Ddsv5 and Azure Dpdsv5 in network IO-intensive scenarios.
+
+<!--truncate-->
+
+<head>
+    <link rel="canonical" href="https://api7.ai/2022/08/08/apache-apisix-performance-test-in-azure/" />
+</head>
+
+## Background
+
+In April, Microsoft announced a preview of its family of Azure virtual machines based on Ampere® Altra® Arm processors. The new VM series includes general-purpose Dpsv5 and memory-optimized Epsv5 VMs. For details, refer to the following figure:
+
+![VM series](https://static.apiseven.com/2022/blog/0808/1.png)
+
+Notably, Ampere® Altra® Arm is a cloud-native processor, and Azure virtual machines based on Ampere® Altra® Arm processors can therefore run scale-out cloud-native applications in an efficient manner.
+
+So what is the actual experience and performance? Let's take a cloud-native API gateway as an example to show you the performance of an Azure virtual machine based on the Arm architecture. Here, we choose Apache APISIX for installation and testing on the general-purpose Dpdsv5 series virtual machine environment.
+
+Apache APISIX is a cloud-native, high-performance, scalable API gateway. Based on NGNIX + LuaJIT and etcd, APISIX has the characteristics of dynamic routing and plug-in hot loading compared with traditional API gateways, which is especially suitable for API management under cloud-native architecture.
+
+![Apache APISIX](https://static.apiseven.com/2022/blog/0808/2.png)
+
+## Preliminary preparation
+
+First, you need to start a Dpdsv5 series instance on Azure, and choose Ubuntu 20.04 as the operating system.
+
+![Dpdsv5](https://static.apiseven.com/2022/blog/0808/3.jpeg)
+
+Then install Docker to facilitate subsequent use of containerized methods to install and deploy Apache APISIX.
+
+```shell
+sudo apt-get update && sudo apt-get install docker.io
+```
+
+## Deploy Apache APISIX
+
+Apache APISIX uses etcd as the configuration center, so you need to start an etcd instance first.
+
+```shell
+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
+```
+
+Then start an instance of Apache APISIX.
+
+```shell
+sudo docker run --net=host -d apache/apisix:2.14.1-alpine
+```
+
+Create routes.
+
+```shell
+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 the test.
+
+```shell
+curl -i http://127.0.0.1:9080/anything/das
+```
+
+The installation is successful if the following results are returned:
+
+```shell
+HTTP/1.1 200 OK
+.....
+```
+
+## Azure Ddsv5 vs Azure Dpdsv5
+
+From the above operations, the installation and compatibility test of Apache APISIX on Azure Dpdsv5 can be successfully completed. So what is the actual performance of Azure Dpdsv5? Next, we will use Apache APISIX to do performance test comparisons on Azure Dpdsv5 and Azure Ddsv5 to see their actual performance.
+
+Azure Ddsv5 is another model of Azure D series, which is based on Intel® x86 architecture, so the above etcd installation steps are slightly different:
+
+```shell
+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
+```
+
+### Single upstream + no plugin
+
+Use a single upstream, without any plugins. It mainly tests the performance of APISIX in pure proxy back-to-origin mode.
+
+```shell
+# apisix: 1 worker + 1 upstream + no plugin
+
+# create route
+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
+        }
+    }
+}'
+```
+
+### Single upstream + two plugins
+
+Using a single upstream, two plugins. It mainly tests the performance of APISIX when the two core performance-consuming plugins, limit-count and prometheus, are enabled.
+
+```shell
+# apisix: 1 worker + 1 upstream + 2 plugins (limit-count + prometheus)
+
+# create route
+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, relevant tests and comparisons were carried out from the two levels of request QPS (queries per second) and delay time. The result is as follows:
+
+1. QPS comparison
+
+    ![QPS](https://static.apiseven.com/2022/blog/0808/4.png)
+2. Latency Comparison
+
+    ![Latency](https://static.apiseven.com/2022/blog/0808/5.png)
+
+<table>
+    <tr>
+        <td><b>  </b></td>
+        <td colspan="2">Single upstream + no plugin</td>
+        <td colspan="2">Single upstream + two plugins</td>
+    </tr>
+    <tr>
+        <td><b>  </b></td>
+        <td><b>Azure Ddsv5</b></td>
+        <td><b>Azure Dpdsv5</b></td>
+        <td><b>Azure Ddsv5</b></td>
+        <td><b>Azure Dpdsv5</b></td>
+    </tr>
+    <tr>
+        <td><b>QPS(request/s)</b></td>
+        <td><b>14900</b></td>
+        <td><b>13400</b></td>
+        <td><b>13100</b></td>
+        <td><b>11000</b></td>
+    </tr>
+    <tr>
+        <td><b>Latency(ms)</b></td>
+        <td><b>1.07</b></td>
+        <td><b>1.21</b></td>
+        <td><b>1.21</b></td>
+        <td><b>1.43</b></td>
+    </tr>
+    </table>
+
+It can also be seen from the above data that in network IO-intensive computing scenarios such as API gateways, Dpdsv5 still has a performance gap compared to the same series of Ddsv5. But another good news is that the price of Dpdsv5 is about 20% cheaper than Ddsv5 under the same configuration. In actual machine selection, users can make flexible decisions according to their business volume.
+
+## Summary
+
+This article mainly uses Apache APISIX to compare the performance of Azure Ddsv5 and Azure Dpdsv5. It can be seen that in network IO-intensive computing scenarios such as API gateways, Azure Dpdsv5 is not so bright compared to Ddsv5, but since this series of models is still in preview, Microsoft is making continuous improvements and optimizations. Looking forward to its sequel.
+
+## Reference
+
+[Now in preview: Azure Virtual Machines with Ampere Altra Arm-based processors](https://azure.microsoft.com/en-us/blog/now-in-preview-azure-virtual-machines-with-ampere-altra-armbased-processors/)
diff --git a/blog/zh/blog/2022/08/08/apache-apisix-performance-test-in-azure.md b/blog/zh/blog/2022/08/08/apache-apisix-performance-test-in-azure.md
new file mode 100644
index 00000000000..5c8560340fe
--- /dev/null
+++ b/blog/zh/blog/2022/08/08/apache-apisix-performance-test-in-azure.md
@@ -0,0 +1,219 @@
+---
+title: "API 网关 Apache APISIX 在 Azure 的性能测试"
+authors:
+  - name: "赵士瑞"
+    title: "Author"
+    url: "https://github.com/soulbird"
+    image_url: "https://github.com/soulbird.png"
+  - name: "韩飞"
+    title: "Technical Writer"
+    url: "https://github.com/hf400159"
+    image_url: "https://github.com/hf400159.png"
+keywords: 
+- API 网关
+- Azure
+- 微软
+- Apache APISIX
+- 虚拟机
+description: 本文使用 API 网关 Apache APISIX 来对比 Azure Ddsv5 和 Azure Dpdsv5 在网络 IO 密集型场景下的性能。
+tags: [Ecosystem]
+---
+
+> 本文使用 API 网关 Apache APISIX 来对比 Azure Ddsv5 和 Azure Dpdsv5 在网络 IO 密集型场景下的性能。
+
+<!--truncate-->
+
+## 背景
+
+今年 4 月,微软宣布推出基于 Ampere® Altra® Arm 处理器的 Azure 虚拟机系列预览版。新的 VM 系列包括通用 Dpsv5 和内存优化的 Epsv5 VM,具体信息参考下图:
+
+![VM 系列](https://static.apiseven.com/2022/blog/0808/1.png)
+
+值得注意的是,Ampere® Altra® Arm 是一款云原生处理器,基于 Ampere® Altra® Arm 处理器的 Azure 虚拟机也因此能以高效的方式运行横向扩展的云原生应用程序。
+
+那么实际体验和性能如何呢?接下来我们将以一个云原生的 API 网关为例,带大家一起看看基于 ARM 架构的 Azure 虚拟机的表现。这里,我们选择了 Apache APISIX 在通用型 Dpdsv5 系列虚拟机上进行安装测试。
+
+Apache APISIX 是一个云原生、高性能、可扩展的 API 网关。基于 NGNIX + LuaJIT 和 etcd,APISIX 与传统 API 网关相比,具有动态路由和插件热加载特性,特别适合云原生架构下的 API 管理。
+
+![Apache APISIX](https://static.apiseven.com/2022/blog/0808/2.png)
+
+## 前期准备
+
+首先,我们在 Azure 上启动一个 Dpdsv5 系列的实例,操作系统选择 Ubuntu 20.04。
+
+![Dpdsv5](https://static.apiseven.com/2022/blog/0808/3.jpeg)
+
+然后安装 Docker,方便后续使用容器化的方式来部署 Apache APISIX。
+
+```shell
+sudo apt-get update && sudo apt-get install docker.io
+```
+
+## 部署 Apache APISIX
+
+Apache APISIX 使用 etcd 作为配置中心,因此需要先启动一个 etcd 实例。
+
+```shell
+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
+```
+
+启动 Apache APISIX 实例。
+
+```shell
+sudo docker run --net=host -d apache/apisix:2.14.1-alpine
+```
+
+创建路由。
+
+```shell
+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
+        }
+    }
+}'
+```
+
+进行访问测试。
+
+```shell
+curl -i http://127.0.0.1:9080/anything/das
+```
+
+返回以下结果则表示安装成功:
+
+```shell
+HTTP/1.1 200 OK
+.....
+```
+
+## Azure Ddsv5 vs Azure Dpdsv5
+
+从上述操作来看,Apache APISIX 在 Azure Dpdsv5 上的安装和兼容性测试都能顺利完成。那么 Azure Dpdsv5 的实际性能到底如何呢?接下来我们将使用 Apache APISIX 分别在 Azure Dpdsv5 和  Azure Ddsv5 上做性能测试对比,看看实际表现。
+
+Azure Ddsv5 是 Azure D 系列的另一款机型,是基于 Intel® x86 架构的, 所以上述 etcd 安装步骤略有不同:
+
+```shell
+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
+```
+
+为简单起见,本次测试 APISIX 中只启用了一个 Worker,以下性能测试数据均在单核 CPU 上运行。
+
+### 场景一:单上游
+
+该场景下将使用单个上游(不包含任何插件),主要测试 APISIX 在纯代理回源模式下的性能表现。在本地环境中进行测试:
+
+```shell
+# apisix: 1 worker + 1 upstream + no plugin
+
+# 注册路由
+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
+        }
+    }
+}'
+```
+
+### 场景 2:单个上游 + 两个插件
+
+该场景下将使用单个上游与两个插件进行,主要测试 APISIX 在开启 `limit-count` 和 `prometheus` 两个核心性能消耗插件时的表现。
+
+```shell
+# apisix: 1 worker + 1 upstream + 2 plugins (limit-count + prometheus)
+
+# 注册路由
+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
+        }
+    }
+}'
+```
+
+### 数据比较
+
+上述两个场景中,分别从请求 QPS(每秒查询数) 和延迟时间两个层面进行了相关的测试对比。结果如下:
+
+1. QPS 比较
+
+    ![QPS](https://static.apiseven.com/2022/blog/0808/4.png)
+
+2. 请求延迟比较
+
+    ![Latency](https://static.apiseven.com/2022/blog/0808/5.png)
+
+<table>
+    <tr>
+        <td><b>  </b></td>
+        <td colspan="2">单个上游</td>
+        <td colspan="2">单个上游+两个插件</td>
+    </tr>
+    <tr>
+        <td><b>  </b></td>
+        <td><b>Azure Ddsv5</b></td>
+        <td><b>Azure Dpdsv5</b></td>
+        <td><b>Azure Ddsv5</b></td>
+        <td><b>Azure Dpdsv5</b></td>
+    </tr>
+    <tr>
+        <td><b>QPS(request/s)</b></td>
+        <td><b>14900</b></td>
+        <td><b>13400</b></td>
+        <td><b>13100</b></td>
+        <td><b>11000</b></td>
+    </tr>
+    <tr>
+        <td><b>Latency(ms)</b></td>
+        <td><b>1.07</b></td>
+        <td><b>1.21</b></td>
+        <td><b>1.21</b></td>
+        <td><b>1.43</b></td>
+    </tr>
+    </table>
+
+从以上数据也可以看出,在 API 网关等网络 IO 密集计算场景下,Dpdsv5 相比同系列 Ddsv5 在性能上仍然有差距。不过另一个好消息是,在同等配置的情况下,Dpdsv5 的价格要比 Ddsv5 便宜 20% 左右。在实际机器选型时,用户可以根据自己的业务体量来灵活决策。
+
+## 总结
+
+本文主要使用 Apache APISIX 来对比 Azure Ddsv5 和 Azure Dpdsv5 的性能。从结果可以看出 Azure Dpdsv5 相比 Ddsv5,表现虽然不是那么亮眼,但是由于该系列的机型尚处于预览版,微软正在进行持续的改进和优化,我们也非常期待它的后续表现。
+
+## 参考链接
+
+[Now in preview: Azure Virtual Machines with Ampere Altra Arm-based processors](https://azure.microsoft.com/en-us/blog/now-in-preview-azure-virtual-machines-with-ampere-altra-armbased-processors/)