How Is AWS Graviton3 Performing?

API7.ai

June 7, 2022

Ecosystem

Background

AWS released the latest ARM-based AWS Graviton family of processors at the end of May 2022 - AWS Graviton3. According to AWS official data, compared with Graviton2 processor, based on leading DDR5 memory technology, Graviton3 processor can provide up to 25% performance improvement, up to 2x floating point performance and 50% faster memory access speed; Graviton3 also uses 60% less energy on the same EC2 instance of the same type.

So what about the actual data? Let's take a network IO dense API Gateway as an example to see how AWS Graviton3 performs. Here we use Apache APISIX to perform performance comparison tests on AWS Graviton2 (C6g) and AWS Graviton3 (C7g) server environments.

Apache APISIX is a cloud-native, high-performance, scalable API gateway. Based on NGNIX+LuaJIT and etcd, compared with traditional API gateways, APISIX has dynamic routing and plug-in hot loading features, which is especially suitable for API management under cloud native architecture.

Apache APISIX

Installation and Deployment

Prepare a server with an ARM64 chip, here we choose Amazon EC2 C7g(Only this model now has AWS Graviton3), and the operating system chooses Ubuntu 20.04.

Amazon EC2

Don't forget to install Docker:

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

Apache APISIX has released the latest version of the ARM64 image, which can be deployed with one click using Docker. The detailed process can be found below.

  1. Start 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 APISIX
sudo docker run --net=host -d apache/apisix:2.14.1-alpine
  1. Register Route
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. Test
curl -i http://127.0.0.1:9080/anything/das
HTTP/1.1 200 OK
.....

Performance Comparison of AWS Graviton2 and AWS Graviton3

According to the previous operations, based on the official script, the installation and compatibility test of APISIX on the AWS Graviton3 processor was successfully completed. Let's take a look at the performance of Apache APISIX on AWS Graviton2 (C6g) and AWS Graviton3 (C7g).

For the sake of simplicity, only one Worker is enabled in APISIX in this test, and the following performance test data are all run on a single-core CPU.

Scenario 1: Single upstream

Use a single upstream, without any plugins. It mainly tests the performance of APISIX in pure proxy back-to-origin mode.

# apisix: 1 worker + 1 upstream + no plugin

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

Scenario 2: 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.

# apisix: 1 worker + 1 upstream + 2 plugins (limit-count + prometheus)

# register 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, related testing and comparison were performed from the two levels of request processing and delay time. The results are as follows:

  1. QPS comparison

QPS

  1. Latency comparison

Latency

comparison table

It can also be seen from the above data that in a network IO dense computing scenario such as API Gateway, AWS Graviton3 improves the performance by 76% compared to AWS Graviton2, while reducing latency by 38%. This data is even better than the official data given by AWS mentioned at the beginning (25% performance improvement).

Summarize

This article mainly uses Apache APISIX to compare the performance of AWS Graviton3 and AWS Graviton2. It can be seen that in the network IO dense computing scenario of API gateway, AWS Graviton3 can be said to show the properties of a performance monster. Of course, it is also recommended that you practice a lot, and look forward to more test data for computing-intensive projects in the future.

Tags:
APISIX BasicsAWSComparison to Competitors