apisix/doc/zh-cn/benchmark.md

70 lines
2.1 KiB
Markdown
Raw Normal View History

2019-10-31 09:27:28 +08:00
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
-->
[English](../benchmark.md)
2019-06-06 14:57:09 +08:00
### 测试环境
2019-06-06 14:57:09 +08:00
使用谷歌云的服务器进行测试,型号为 n1-highcpu-8 (8 vCPUs, 7.2 GB memory)
2019-09-18 17:24:13 +08:00
我们最多只使用 4 核去运行 APISIX, 剩下的 4 核用于系统和压力测试工具 [wrk](https://github.com/wg/wrk)。
2019-06-06 14:57:09 +08:00
### 测试反向代理
2019-06-06 14:57:09 +08:00
我们把 APISIX 当做反向代理来使用,不开启任何插件,响应体的大小为 1KB。
#### QPS
2019-06-06 14:57:09 +08:00
下图中 x 轴为 CPU 的使用个数y 轴为每秒处理的请求数:
<img src="../doc/images/benchmark-1.jpg" width="70%" height="70%">
#### 延时
2019-06-06 14:57:09 +08:00
请注意 y 轴延时的单位是**微秒(μs)**,而不是毫秒:
<img src="../doc/images/latency-1.jpg" width="70%" height="70%">
#### 火焰图
2019-06-06 14:57:09 +08:00
火焰图的采样结果:
<img src="../doc/images/flamegraph-1.jpg">
### 测试反向代理,开启 2 个插件
2019-06-06 14:57:09 +08:00
我们把 APISIX 当做反向代理来使用,开启限速和 prometheus 插件,响应体的大小为 1KB。
#### QPS
2019-06-06 14:57:09 +08:00
下图中 x 轴为 CPU 的使用个数y 轴为每秒处理的请求数:
<img src="../doc/images/benchmark-2.jpg" width="70%" height="70%">
#### Latency
2019-06-06 14:57:09 +08:00
请注意 y 轴延时的单位是**微秒(μs)**,而不是毫秒:
<img src="../doc/images/latency-2.jpg" width="70%" height="70%">
#### 火焰图
2019-06-06 14:57:09 +08:00
火焰图的采样结果:
![火焰图采样结果](../images/flamegraph-2.jpg)