mirror of https://github.com/istio/istio.io.git
29 lines
31 KiB
HTML
29 lines
31 KiB
HTML
<!doctype html><html lang=zh itemscope itemtype=https://schema.org/WebPage><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=theme-color content="#466BB0"><meta name=title content="最佳实践:Service Mesh 基准性能测试"><meta name=description content="评估 Istio 数据平面性能的工具和指南。"><meta name=author content="Megan O'Keefe (Google), John Howard (Google), Mandar Jog (Google)"><meta name=keywords content="microservices,services,mesh,performance,scalability,scale,benchmarks"><meta property="og:title" content="最佳实践:Service Mesh 基准性能测试"><meta property="og:type" content="website"><meta property="og:description" content="评估 Istio 数据平面性能的工具和指南。"><meta property="og:url" content="/v1.20/zh/blog/2019/performance-best-practices/"><meta property="og:image" content="https://raw.githubusercontent.com/istio/istio.io/master/static/img/istio-social.png"><meta property="og:image:alt" content="The Istio sailboat logo"><meta property="og:image:width" content="4096"><meta property="og:image:height" content="2048"><meta property="og:site_name" content="Istio"><meta name=twitter:card content="summary_large_image"><meta name=twitter:site content="@IstioMesh"><title>Istioldie 1.20 / 最佳实践:Service Mesh 基准性能测试</title>
|
||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-98480406-2"></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","UA-98480406-2")</script><link rel=alternate type=application/rss+xml title="Istio Blog" href=/v1.20/blog/feed.xml><link rel=alternate type=application/rss+xml title="Istio News" href=/v1.20/news/feed.xml><link rel=alternate type=application/rss+xml title="Istio Blog and News" href=/v1.20/feed.xml><link rel="shortcut icon" href=/v1.20/favicons/favicon.ico><link rel=apple-touch-icon href=/v1.20/favicons/apple-touch-icon-180x180.png sizes=180x180><link rel=icon type=image/png href=/v1.20/favicons/favicon-16x16.png sizes=16x16><link rel=icon type=image/png href=/v1.20/favicons/favicon-32x32.png sizes=32x32><link rel=icon type=image/png href=/v1.20/favicons/android-36x36.png sizes=36x36><link rel=icon type=image/png href=/v1.20/favicons/android-48x48.png sizes=48x48><link rel=icon type=image/png href=/v1.20/favicons/android-72x72.png sizes=72x72><link rel=icon type=image/png href=/v1.20/favicons/android-96x96.png sizes=96xW96><link rel=icon type=image/png href=/v1.20/favicons/android-144x144.png sizes=144x144><link rel=icon type=image/png href=/v1.20/favicons/android-192x192.png sizes=192x192><link rel=icon type=image/svg+xml href=/v1.20/favicons/favicon.svg><link rel=icon type=image/png href=/v1.20/favicons/favicon.png><link rel=mask-icon href=/v1.20/favicons/safari-pinned-tab.svg color=#466BB0><link rel=manifest href=/v1.20/manifest.json><meta name=apple-mobile-web-app-title content="Istio"><meta name=application-name content="Istio"><meta name=msapplication-config content="/browserconfig.xml"><meta name=msapplication-TileColor content="#466BB0"><meta name=theme-color content="#466BB0"><link rel=stylesheet href=/v1.20/css/all.css><link rel=preconnect href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&display=swap"><script src=/v1.20/js/themes_init.min.js></script></head><body class="language-unknown archive-site"><script>const branchName="release-1.20",docTitle="最佳实践:Service Mesh 基准性能测试",iconFile="/v1.20//img/icons.svg",buttonCopy="复制到剪切板",buttonPrint="打印",buttonDownload="下载"</script><script src="https://www.google.com/cse/brand?form=search-form" defer></script><script src=/v1.20/js/all.min.js data-manual defer></script><header class=main-navigation><nav class="main-navigation-wrapper container-l"><div class=main-navigation-header><a id=brand href=/v1.20/zh/ aria-label=logotype><span class=logo><svg xmlns="http://www.w3.org/2000/svg" width="128" height="60" viewBox="0 0 128 60"><path d="M58.434 48.823A.441.441.0 0158.3 48.497V22.583a.444.444.0 01.134-.326.446.446.0 01.327-.134h3.527a.447.447.0 01.325.134.447.447.0 01.134.326v25.914a.443.443.0 01-.134.326.444.444.0 01-.325.134h-3.527a.444.444.0 01-.327-.134z"/><path d="m70.969 48.477a6.556 6.556.0 01-2.818-1.955 4.338 4.338.0 01-1-2.78v-.345a.443.443.0 01.134-.326.444.444.0 01.326-.135h3.374a.444.444.0 01.326.135.445.445.0 01.134.326v.077a2.014 2.014.0 001.054 1.667 4.672 4.672.0 002.664.709 4.446 4.446.0 002.492-.633 1.862 1.862.0 00.958-1.591 1.426 1.426.0 00-.786-1.322 12.7 12.7.0 00-2.549-.939l-1.457-.46a21.526 21.526.0 01-3.3-1.227 6.57 6.57.0 01-2.262-1.783 4.435 4.435.0 01-.92-2.894 5.081 5.081.0 012.109-4.275 8.993 8.993.0 015.558-1.591 10.445 10.445.0 014.1.748 6.3 6.3.0 012.722 2.07 5 5 0 01.958 3.009.441.441.0 01-.134.326.441.441.0 01-.325.134h-3.258a.441.441.0 01-.326-.134.443.443.0 01-.134-.326 1.974 1.974.0 00-.978-1.667 4.647 4.647.0 00-2.665-.671 4.741 4.741.0 00-2.435.556 1.724 1.724.0 00-.938 1.553 1.512 1.512.0 00.9 1.4 15.875 15.875.0 003.01 1.055l.843.229a27.368 27.368.0 013.412 1.246 6.67 6.67.0 012.338 1.763 4.387 4.387.0 01.958 2.933 4.988 4.988.0 01-2.146 4.275 9.543 9.543.0 01-5.712 1.552 11.626 11.626.0 01-4.227-.709z"/><path d="m97.039 32.837a.443.443.0 01-.326.135h-3.911a.169.169.0 00-.191.192v9.239a2.951 2.951.0 00.632 2.108 2.7 2.7.0 002.013.652h1.15a.444.444.0 01.325.134.441.441.0 01.134.326v2.875a.471.471.0 01-.459.5l-1.994.039a8 8 0 01-4.524-1.035q-1.495-1.035-1.533-3.91V33.166A.17.17.0 0088.164 32.974H85.978A.441.441.0 0185.652 32.839.441.441.0 0185.518 32.513V29.83a.441.441.0 01.134-.326.444.444.0 01.326-.135h2.186a.169.169.0 00.191-.192v-4.485a.438.438.0 01.134-.326.44.44.0 01.325-.134h3.336a.443.443.0 01.325.134.442.442.0 01.135.326v4.485a.169.169.0 00.191.192h3.911a.446.446.0 01.326.135.446.446.0 01.134.326v2.683a.446.446.0 01-.133.324z"/><path d="m101.694 25.917a2.645 2.645.0 01-.767-1.955 2.65 2.65.0 01.767-1.955 2.65 2.65.0 011.955-.767 2.65 2.65.0 011.955.767 2.652 2.652.0 01.767 1.955 2.647 2.647.0 01-.767 1.955 2.646 2.646.0 01-1.955.767 2.645 2.645.0 01-1.955-.767zm-.211 22.906a.441.441.0 01-.134-.326V29.79a.444.444.0 01.134-.326.446.446.0 01.326-.134h3.527a.446.446.0 01.326.134.445.445.0 01.134.326v18.707a.443.443.0 01-.134.326.443.443.0 01-.326.134h-3.527a.443.443.0 01-.326-.134z"/><path d="m114.019 47.734a8.1 8.1.0 01-3.047-4.255 14.439 14.439.0 01-.652-4.37 14.3 14.3.0 01.614-4.371A7.869 7.869.0 01114 30.56a9.072 9.072.0 015.252-1.5 8.543 8.543.0 015.041 1.5 7.985 7.985.0 013.009 4.14 12.439 12.439.0 01.69 4.37 13.793 13.793.0 01-.651 4.37 8.255 8.255.0 01-3.028 4.275 8.475 8.475.0 01-5.1 1.553 8.754 8.754.0 01-5.194-1.534zm7.629-3.1a4.536 4.536.0 001.476-2.262 11.335 11.335.0 00.383-3.221 10.618 10.618.0 00-.383-3.22 4.169 4.169.0 00-1.457-2.243 4.066 4.066.0 00-2.531-.785 3.942 3.942.0 00-2.453.785 4.376 4.376.0 00-1.5 2.243 11.839 11.839.0 00-.383 3.22 11.84 11.84.0 00.383 3.221 4.222 4.222.0 001.476 2.262 4.075 4.075.0 002.549.8 3.8 3.8.0 002.44-.809z"/><path d="m15.105 32.057v15.565a.059.059.0 01-.049.059L.069 50.25A.06.06.0 01.005 50.167l14.987-33.47a.06.06.0 01.114.025z"/><path d="m17.631 23.087v24.6a.06.06.0 00.053.059l22.449 2.507a.06.06.0 00.061-.084L17.745.032a.06.06.0 00-.114.024z"/><path d="m39.961 52.548-24.833 7.45a.062.062.0 01-.043.0L.079 52.548a.059.059.0 01.026-.113h39.839a.06.06.0 01.017.113z"/></svg></span>
|
||
</a><button id=hamburger class=main-navigation-toggle aria-label="Open navigation">
|
||
<svg class="icon menu-hamburger"><use xlink:href="/v1.20/img/icons.svg#menu-hamburger"/></svg>
|
||
</button>
|
||
<button id=menu-close class=main-navigation-toggle aria-label="Close navigation"><svg class="icon menu-close"><use xlink:href="/v1.20/img/icons.svg#menu-close"/></svg></button></div><div id=header-links class=main-navigation-links-wrapper><ul class=main-navigation-links><li class=main-navigation-links-item><a class="main-navigation-links-link has-dropdown"><span>关于</span><svg class="icon dropdown-arrow"><use xlink:href="/v1.20/img/icons.svg#dropdown-arrow"/></svg></a><ul class=main-navigation-links-dropdown><li class=main-navigation-links-dropdown-item><a href=/v1.20/zh/about/service-mesh class=main-navigation-links-link>服务网格</a></li><li class=main-navigation-links-dropdown-item><a href=/v1.20/zh/about/solutions class=main-navigation-links-link>解决方案</a></li><li class=main-navigation-links-dropdown-item><a href=/v1.20/zh/about/case-studies class=main-navigation-links-link>案例学习</a></li><li class=main-navigation-links-dropdown-item><a href=/v1.20/zh/about/ecosystem class=main-navigation-links-link>生态系统</a></li><li class=main-navigation-links-dropdown-item><a href=/v1.20/zh/about/deployment class=main-navigation-links-link>部署</a></li><li class=main-navigation-links-dropdown-item><a href=/v1.20/zh/about/faq class=main-navigation-links-link>FAQ</a></li></ul></li><li class=main-navigation-links-item><a href=/v1.20/zh/blog/ class=main-navigation-links-link><span>博客</span></a></li><li class=main-navigation-links-item><a href=/v1.20/zh/news/ class=main-navigation-links-link><span>新闻</span></a></li><li class=main-navigation-links-item><a href=/v1.20/zh/get-involved/ class=main-navigation-links-link><span>加入我们</span></a></li><li class=main-navigation-links-item><a href=/v1.20/zh/docs/ class=main-navigation-links-link><span>文档</span></a></li></ul><div class=main-navigation-footer><button id=search-show class=search-show title='搜索 istio.io' aria-label=搜索><svg class="icon magnifier"><use xlink:href="/v1.20/img/icons.svg#magnifier"/></svg></button>
|
||
<a href=/v1.20/zh/docs/setup/getting-started class="btn btn--primary" id=try-istio>试用 Istio</a></div></div><form id=search-form class=search name=cse role=search><input type=hidden name=cx value=002184991200833970123:iwwf17ikgf4>
|
||
<input type=hidden name=ie value=utf-8>
|
||
<input type=hidden name=hl value=zh>
|
||
<input type=hidden id=search-page-url value=/zh/search>
|
||
<input id=search-textbox class="search-textbox form-control" name=q type=search aria-label='搜索 istio.io' placeholder=搜索>
|
||
<button id=search-close title=取消搜索 type=reset aria-label=取消搜索><svg class="icon menu-close"><use xlink:href="/v1.20/img/icons.svg#menu-close"/></svg></button></form></nav></header><div class=banner-container></div><article class=post itemscope itemtype=http://schema.org/BlogPosting><div class=header-content><h1>最佳实践:Service Mesh 基准性能测试</h1><p>评估 Istio 数据平面性能的工具和指南。</p></div><p class=post-author>Jul 9, 2019 <span>| </span>By Megan O'Keefe - Google, John Howard - Google, Mandar Jog - Google</p><div><p>服务网格为应用部署增加了很多功能,包括<a href=/v1.20/zh/docs/concepts/what-is-istio/#traffic-management>流量策略</a>、<a href=/v1.20/zh/docs/concepts/what-is-istio/#observability>可观察性</a>和<a href=/v1.20/zh/docs/concepts/what-is-istio/#security>安全通信</a>。但是,无论是时间(增加的延迟)还是资源(CPU 周期),向环境中添加服务网格都是有代价的。要就服务网格是否适合您的情况做出明智的决定,评估应用与服务网格一起部署时的性能非常重要。</p><p>今年早些时候,我们发布了关于 Istio 1.1 性能改进的<a href=/v1.20/zh/blog/2019/istio1.1_perf/>博客</a>。在发布 <a href=/v1.20/zh/news/releases/1.2.x/announcing-1.2>Istio 1.2</a> 之后,我们希望提供指导和工具,以帮助您在可用于生产的 Kubernetes 环境中对 Istio 的数据平面性能进行基准测试。</p><p>总体而言,我们发现 Istio <a href=/v1.20/zh/docs/ops/deployment/architecture/#envoy>sidecar 代理</a>的延迟取决于并发连接数。以每秒 1000 个请求(RPS)的速度,通过 16 个连接,Istio 延迟在 50% 时增加 <strong>3 毫秒</strong>,在 99% 时增加 <strong>10 毫秒</strong>。</p><p>在 <a href=https://github.com/istio/tools/tree/3ac7ab40db8a0d595b71f47b8ba246763ecd6213/perf/benchmark>Istio Tools 仓库</a>中,您将找到用于测量 Istio 数据平面性能的脚本和说明,以及有关如何使用另一服务网格实现 <a href=https://linkerd.io>Linkerd</a> 运行脚本的其他说明。在我们详细介绍性能测试框架的每个步骤的一些最佳实践时,请<a href=https://github.com/istio/tools/tree/3ac7ab40db8a0d595b71f47b8ba246763ecd6213/perf/benchmark#setup>遵循</a>。</p><h2 id=1-use-a-production-ready-Istio-installation>1. 使用生产就绪的 Istio 安装</h2><p>为了准确地大规模度量服务网格的性能,使用<a href=https://github.com/istio/tools/tree/3ac7ab40db8a0d595b71f47b8ba246763ecd6213/perf/istio-install#istio-setup>适当大小的</a> Kubernetes 集群很重要。我们使用三个工作节点进行测试,每个工作节点至少具有 4 vCPU 和 15 GB 的内存。</p><p>然后,在该群集上使用可用于生产的 Istio <strong>安装配置文件</strong> 很重要。这使我们能够实现面向性能的设置,例如控制平面 pod 自动伸缩,并确保资源限制适用于繁重的流量负荷。<a href=/v1.20/zh/docs/setup/install/helm/#%E5%AE%89%E8%A3%85%E6%AD%A5%E9%AA%A4>默认</a> Istio 安装适用于大多数基准测试用例。为了进行广泛的性能基准测试,并提供数千种注入代理的服务,我们还提供了<a href=https://github.com/istio/tools/blob/3ac7ab40db8a0d595b71f47b8ba246763ecd6213/perf/istio-install/values.yaml>调整后的 Istio 安装</a>,可为 Istio 控制平面分配额外的内存和 CPU。</p><p><svg class="large-icon"><use xlink:href="/v1.20/img/icons.svg#exclamation-mark"/></svg> Istio 的 <a href=/v1.20/zh/docs/setup/getting-started/>demo 安装</a>不适合进行性能测试,因为它被设计为部署在小型试用群集中,并且具有完整的跟踪和访问日志,可显示 Istio 的功能。</p><h2 id=2-focus-on-the-data-plane>2. 专注于数据平面</h2><p>我们的基准测试脚本专注于评估 Istio 数据平面:<span class=term data-title=Envoy data-body='<p>Envoy 是在 Istio 里使用的高性能代理,用于为所有<a href="/zh/docs/reference/glossary/#service-mesh">服务网格</a>里的<a href="/zh/docs/reference/glossary/#service">服务</a>调度进出的流量。
|
||
<a href="https://www.envoyproxy.io/">了解更多关于 Envoy</a>。</p>
|
||
'>Envoy</span> 代理,可在应用容器之间进行流量调度。为什么要关注数据平面?因为在大规模使用大量应用容器时,数据平面的 <strong>内存</strong> 和 <strong>CPU</strong> 使用率很快就会超过 Istio 控制平面。让我们看一个具体的例子:</p><p>假设您运行了 2,000 个注入 Envoy 的 pod,每个 pod 每秒处理 1,000 个请求。每个代理使用 50 MB 的内存,并且要配置所有这些代理,Pilot 使用 1 vCPU 和 1.5 GB 的内存。所有的资源中,Istio 数据平面(所有 Envoy 代理的总和)使用了 100 GB 的内存,而 Pilot 只使用了 1.5 GB。</p><p>考虑到 <strong>延迟</strong>,关注数据平面性能也很重要。这是因为大多数应用的请求会通过 Istio 数据平面,而不是通过控制平面。但是,有两个例外:</p><ol><li><strong>遥测报告:</strong> 每个代理将原始遥测数据发送到 Mixer,Mixer 将其处理为度量,跟踪和其他遥测。原始遥测数据类似于访问日志,因此要付出一定的代价。访问日志处理会消耗 CPU,并使工作线程无法处理下一个工作单元。在更高的吞吐量场景下,下一个工作单元更有可能在队列中等待被工作者接走。这可能导致 Envoy 的长尾延迟(99%)。</li><li><strong>自定义策略检查:</strong> 当使用<a href=/v1.20/zh/docs/concepts/observability/>自定义 Istio 策略适配器</a>时,策略检查位于请求路径上。这意味着数据路径上的请求 header 和 metadata 将被发送到控制平面(Mixer),从而导致更高的请求延迟。<strong>注意:</strong> 这些策略检查<a href=/v1.20/zh/docs/reference/config/installation-options/#global-options>默认情况下处于禁用状态</a>,因为最常见的策略用例(<a href=/v1.20/zh/docs/reference/config/security/istio.rbac.v1alpha1>RBAC</a>)完全由 Envoy 代理执行。</li></ol><p>当 <a href=https://docs.google.com/document/d/1QKmtem5jU_2F3Lh5SqLp0IuPb80_70J7aJEYu4_gS-s>Mixer V2</a> 将所有策略和遥测功能直接移到代理中时,这两个例外都会在将来的 Istio 版本中消失。</p><p>接下来,在大规模测试 Istio 的数据平面性能时,不仅要以每秒递增的请求进行测试,而且还要以越来越多的 <strong>并发</strong> 连接进行测试,这一点很重要。这是因为现实世界中的高吞吐量流量来自多个客户端。我们<a href=https://github.com/istio/tools/tree/3ac7ab40db8a0d595b71f47b8ba246763ecd6213/perf/benchmark#run-performance-tests>提供了脚本</a>允许您以递增的 RPS 对任意数量的并发连接执行相同的负载测试。</p><p>最后,我们的测试环境可以测量两个 pod 之间少量的请求。客户端 pod 是 <a href=http://fortio.org/>Fortio</a>,它将流量发送到服务端 pod。</p><p>为什么只用两个 pod 测试?因为增加吞吐量(RPS)和连接(线程)对 Envoy 的性能的影响比增加服务注册表的总大小(或 Kubernetes 集群中 Pod 和服务的总数)更大。当服务注册表的大小增加时,Envoy 必须跟踪更多的端点,并且每个请求的查找时间确实增加了,但是增加了一个很小的常数。如果您有许多服务,并且此常数成为延迟问题,则 Istio 提供 <a href=/v1.20/zh/docs/reference/config/networking/sidecar/>Sidecar 资源</a>,它使您可以限制每个 Envoy 知道的服务。</p><h2 id=3-measure-with-and-without-proxies>3. 有/无 度量的代理</h2><p>尽管 Istio 的许多特性,例如<a href=/v1.20/zh/docs/concepts/security/#mutual-TLS-authentication>双向 TLS 身份验证</a>,都依赖于应用 pod 的 Envoy 代理,但是您可以<a href=/v1.20/zh/docs/setup/additional-setup/sidecar-injection/#disabling-or-updating-the-webhook>选择性地禁用</a>一些网格服务的 sidecar 代理注入。在扩展 Istio 以进行生产时,您可能需要将 sidecar 代理增量添加到工作负载中。</p><p>为此,测试脚本提供了<a href=https://github.com/istio/tools/tree/3ac7ab40db8a0d595b71f47b8ba246763ecd6213/perf/benchmark#run-performance-tests>三种不同模式</a>。当请求同时通过客户端和服务器代理(<code>both</code>)、仅通过服务器代理(<code>serveronly</code>)和都不通过代理(<code>baseline</code>)时,这些模式将分析 Istio 的性能。</p><p>您还可以在性能测试期间禁用 <a href=/v1.20/zh/docs/concepts/observability/>Mixer</a> 以停止 Istio 的遥测,这将得到与 Mixer V2 工作完成时我们期望的性能相符的结果。Istio 还支持 <a href=https://github.com/istio/istio/wiki/Envoy-native-telemetry>Envoy 本地遥测</a>,其功能类似于禁用 Istio 的遥测。</p><h2 id=Istio-1-2-performance>Istio 1.2 性能</h2><p>让我们看看如何使用该测试环境来分析 Istio 1.2 数据平面的性能。我们还提供了运行 <a href=https://github.com/istio/tools/tree/3ac7ab40db8a0d595b71f47b8ba246763ecd6213/perf/benchmark/linkerd>Linkerd 数据平面的相同性能测试</a>的说明。Linkerd 目前仅支持延迟基准测试。</p><p>为了衡量 Istio sidecar 的代理延迟,我们考虑在 50%、90% 和 99% 时不断增加并发连接数量,从而保持了请求吞吐量(RPS)不变。</p><p>我们发现,通过 16 个并发连接和 1000 RPS,当请求同时通过客户端和服务器代理传输时,Istio 会在基线(P50)上增加 <strong>3ms</strong>。(从绿色线 <code>both</code> 中减去粉红色线 <code>base</code>)在 64 个并发连接上,Istio 在基线上增加了 <strong>12ms</strong>,但是禁用 Mixer(<code>nomixer_both</code>)后,Istio 仅增加了 <strong>7ms</strong>。</p><figure style=width:75%><div class=wrapper-with-intrinsic-ratio style=padding-bottom:60%><a data-skipendnotes=true href=/v1.20/zh/blog/2019/performance-best-practices/latency_p50.png title="Istio sidecar 代理, 50% 时的延迟"><img class=element-to-stretch src=/v1.20/zh/blog/2019/performance-best-practices/latency_p50.png alt="Istio sidecar 代理, 50% 时的延迟"></a></div><figcaption></figcaption></figure><p>在 90% 时,有 16 个并发连接,Istio 增加 <strong>6ms</strong>;在 64 个连接的情况下,Istio 增加了 <strong>20ms</strong>。</p><figure style=width:75%><div class=wrapper-with-intrinsic-ratio style=padding-bottom:60%><a data-skipendnotes=true href=/v1.20/zh/blog/2019/performance-best-practices/latency_p90.png title="Istio sidecar 代理, 90% 时的延迟"><img class=element-to-stretch src=/v1.20/zh/blog/2019/performance-best-practices/latency_p90.png alt="Istio sidecar 代理, 90% 时的延迟"></a></div><figcaption></figcaption></figure><p>最后,在具有 16 个连接的 99% 时,Istio 在基线之上增加了 <strong>10ms</strong>。在 64 个连接处,Istio 使用 Mixer 增加 <strong>25ms</strong>,不使用 Mixer 则增加 <strong>10ms</strong>。</p><figure style=width:75%><div class=wrapper-with-intrinsic-ratio style=padding-bottom:60%><a data-skipendnotes=true href=/v1.20/zh/blog/2019/performance-best-practices/latency_p99.png title="Istio sidecar 代理, 99% 时的延迟"><img class=element-to-stretch src=/v1.20/zh/blog/2019/performance-best-practices/latency_p99.png alt="Istio sidecar 代理, 99% 时的延迟"></a></div><figcaption></figcaption></figure><p>对于 CPU 使用率,我们以不断增加的请求吞吐量(RPS)和恒定数量的并发连接进行了测量。我们发现启用了 Mixer 的 Envoy 在 3000 RPS 时的最大 CPU 使用率是 <strong>1.2 vCPU</strong>。在 1000 RPS 时,一个 Envoy 大约使用了 50% 的 CPU。</p><figure style=width:75%><div class=wrapper-with-intrinsic-ratio style=padding-bottom:60%><a data-skipendnotes=true href=/v1.20/zh/blog/2019/performance-best-practices/cpu_max.png title="Istio sidecar 代理,最大 CPU 使用率"><img class=element-to-stretch src=/v1.20/zh/blog/2019/performance-best-practices/cpu_max.png alt="Istio sidecar 代理,最大 CPU 使用率"></a></div><figcaption></figcaption></figure><h2 id=summary>总结</h2><p>在对 Istio 的性能进行基准测试的过程中,我们吸取了一些重要的经验教训:</p><ul><li>使用模仿生产的环境。</li><li>专注于数据平面流量。</li><li>基于基准进行测量。</li><li>增加并发连接以及总吞吐量。</li></ul><p>对于在 16 个连接上具有 1000 RPS 的网格,Istio 1.2 仅在 50% 的基础上增加了 <strong>3 毫秒</strong> 的基准延迟。</p><div><aside class="callout tip"><div class=type><svg class="large-icon"><use xlink:href="/v1.20/img/icons.svg#callout-tip"/></svg></div><div class=content>Istio 的性能取决于您的具体设置和流量负载情况。由于存在这种差异,请确保您的测试设置能够准确反映您的生产工作负载。要试用基准测试脚本,请转到 <a href=https://github.com/istio/tools/tree/3ac7ab40db8a0d595b71f47b8ba246763ecd6213/perf/benchmark>Istio Tools 库</a>。</div></aside></div><p>另外,请查阅 <a href=/v1.20/zh/docs/ops/deployment/performance-and-scalability>Istio 性能和可伸缩性指南</a>获取最新的性能数据。感谢您的阅读,祝您基准测试愉快!</p></div><nav class=pagenav><div class=left><a title="使用 Istio 的出口流量管控来阻止相关出口流量攻击。" href=/v1.20/zh/blog/2019/egress-traffic-control-in-istio-part-2/ class=next-link><svg class="icon left-arrow"><use xlink:href="/v1.20/img/icons.svg#left-arrow"/></svg>Istio 中的安全管控出口流量,第二部分</a></div><div class=right><a title="了解如何延长 Istio 自签名根证书的有效期。" href=/v1.20/zh/blog/2019/root-transition/ class=next-link>延长 Istio 自签名根证书的有效期<svg class="icon right-arrow"><use xlink:href="/v1.20/img/icons.svg#right-arrow"/></svg></a></div></nav></article><footer class=footer><div class="footer-wrapper container-l"><div class="user-links footer-links"><a class=channel title='Istio 的代码在 GitHub 上开发' href=https://github.com/istio/community aria-label=GitHub><svg class="icon github"><use xlink:href="/v1.20/img/icons.svg#github"/></svg>
|
||
</a><a class=channel title='如果您想深入了解 Istio 的技术细节,请查看我们日益完善的设计文档' href=https://groups.google.com/forum/#!forum/istio-team-drive-access aria-label="team drive"><svg class="icon drive"><use xlink:href="/v1.20/img/icons.svg#drive"/></svg>
|
||
</a><a class=channel title='在 Slack 上与 Istio 社区交互讨论开发问题(仅限邀请)' href=https://slack.istio.io aria-label=slack><svg class="icon slack"><use xlink:href="/v1.20/img/icons.svg#slack"/></svg>
|
||
</a><a class=channel title='Stack Overflow 中列举了针对实际问题以及部署、配置和使用 Istio 的各项回答' href=https://stackoverflow.com/questions/tagged/istio aria-label="Stack Overflow"><svg class="icon stackoverflow"><use xlink:href="/v1.20/img/icons.svg#stackoverflow"/></svg>
|
||
</a><a class=channel title='关注我们的 Twitter 来获取最新信息' href=https://twitter.com/IstioMesh aria-label=Twitter><svg class="icon twitter"><use xlink:href="/v1.20/img/icons.svg#twitter"/></svg></a></div><hr class=footer-separator role=separator><div class="info footer-info"><a class=logo href=/v1.20/zh/ aria-label=logotype><svg xmlns="http://www.w3.org/2000/svg" width="128" height="60" viewBox="0 0 128 60"><path d="M58.434 48.823A.441.441.0 0158.3 48.497V22.583a.444.444.0 01.134-.326.446.446.0 01.327-.134h3.527a.447.447.0 01.325.134.447.447.0 01.134.326v25.914a.443.443.0 01-.134.326.444.444.0 01-.325.134h-3.527a.444.444.0 01-.327-.134z"/><path d="m70.969 48.477a6.556 6.556.0 01-2.818-1.955 4.338 4.338.0 01-1-2.78v-.345a.443.443.0 01.134-.326.444.444.0 01.326-.135h3.374a.444.444.0 01.326.135.445.445.0 01.134.326v.077a2.014 2.014.0 001.054 1.667 4.672 4.672.0 002.664.709 4.446 4.446.0 002.492-.633 1.862 1.862.0 00.958-1.591 1.426 1.426.0 00-.786-1.322 12.7 12.7.0 00-2.549-.939l-1.457-.46a21.526 21.526.0 01-3.3-1.227 6.57 6.57.0 01-2.262-1.783 4.435 4.435.0 01-.92-2.894 5.081 5.081.0 012.109-4.275 8.993 8.993.0 015.558-1.591 10.445 10.445.0 014.1.748 6.3 6.3.0 012.722 2.07 5 5 0 01.958 3.009.441.441.0 01-.134.326.441.441.0 01-.325.134h-3.258a.441.441.0 01-.326-.134.443.443.0 01-.134-.326 1.974 1.974.0 00-.978-1.667 4.647 4.647.0 00-2.665-.671 4.741 4.741.0 00-2.435.556 1.724 1.724.0 00-.938 1.553 1.512 1.512.0 00.9 1.4 15.875 15.875.0 003.01 1.055l.843.229a27.368 27.368.0 013.412 1.246 6.67 6.67.0 012.338 1.763 4.387 4.387.0 01.958 2.933 4.988 4.988.0 01-2.146 4.275 9.543 9.543.0 01-5.712 1.552 11.626 11.626.0 01-4.227-.709z"/><path d="m97.039 32.837a.443.443.0 01-.326.135h-3.911a.169.169.0 00-.191.192v9.239a2.951 2.951.0 00.632 2.108 2.7 2.7.0 002.013.652h1.15a.444.444.0 01.325.134.441.441.0 01.134.326v2.875a.471.471.0 01-.459.5l-1.994.039a8 8 0 01-4.524-1.035q-1.495-1.035-1.533-3.91V33.166A.17.17.0 0088.164 32.974H85.978A.441.441.0 0185.652 32.839.441.441.0 0185.518 32.513V29.83a.441.441.0 01.134-.326.444.444.0 01.326-.135h2.186a.169.169.0 00.191-.192v-4.485a.438.438.0 01.134-.326.44.44.0 01.325-.134h3.336a.443.443.0 01.325.134.442.442.0 01.135.326v4.485a.169.169.0 00.191.192h3.911a.446.446.0 01.326.135.446.446.0 01.134.326v2.683a.446.446.0 01-.133.324z"/><path d="m101.694 25.917a2.645 2.645.0 01-.767-1.955 2.65 2.65.0 01.767-1.955 2.65 2.65.0 011.955-.767 2.65 2.65.0 011.955.767 2.652 2.652.0 01.767 1.955 2.647 2.647.0 01-.767 1.955 2.646 2.646.0 01-1.955.767 2.645 2.645.0 01-1.955-.767zm-.211 22.906a.441.441.0 01-.134-.326V29.79a.444.444.0 01.134-.326.446.446.0 01.326-.134h3.527a.446.446.0 01.326.134.445.445.0 01.134.326v18.707a.443.443.0 01-.134.326.443.443.0 01-.326.134h-3.527a.443.443.0 01-.326-.134z"/><path d="m114.019 47.734a8.1 8.1.0 01-3.047-4.255 14.439 14.439.0 01-.652-4.37 14.3 14.3.0 01.614-4.371A7.869 7.869.0 01114 30.56a9.072 9.072.0 015.252-1.5 8.543 8.543.0 015.041 1.5 7.985 7.985.0 013.009 4.14 12.439 12.439.0 01.69 4.37 13.793 13.793.0 01-.651 4.37 8.255 8.255.0 01-3.028 4.275 8.475 8.475.0 01-5.1 1.553 8.754 8.754.0 01-5.194-1.534zm7.629-3.1a4.536 4.536.0 001.476-2.262 11.335 11.335.0 00.383-3.221 10.618 10.618.0 00-.383-3.22 4.169 4.169.0 00-1.457-2.243 4.066 4.066.0 00-2.531-.785 3.942 3.942.0 00-2.453.785 4.376 4.376.0 00-1.5 2.243 11.839 11.839.0 00-.383 3.22 11.84 11.84.0 00.383 3.221 4.222 4.222.0 001.476 2.262 4.075 4.075.0 002.549.8 3.8 3.8.0 002.44-.809z"/><path d="m15.105 32.057v15.565a.059.059.0 01-.049.059L.069 50.25A.06.06.0 01.005 50.167l14.987-33.47a.06.06.0 01.114.025z"/><path d="m17.631 23.087v24.6a.06.06.0 00.053.059l22.449 2.507a.06.06.0 00.061-.084L17.745.032a.06.06.0 00-.114.024z"/><path d="m39.961 52.548-24.833 7.45a.062.062.0 01-.043.0L.079 52.548a.059.059.0 01.026-.113h39.839a.06.06.0 01.017.113z"/></svg></a><div class=footer-languages><a tabindex=-1 lang=en id=switch-lang-en class=footer-languages-item>English
|
||
</a><a tabindex=-1 lang=zh id=switch-lang-zh class="footer-languages-item active"><svg class="icon tick"><use xlink:href="/v1.20/img/icons.svg#tick"/></svg>
|
||
中文</a></div></div><ul class=footer-policies><li class=footer-policies-item><a class=footer-policies-link href=https://www.linuxfoundation.org/legal/terms>条款
|
||
</a>|
|
||
<a class=footer-policies-link href=https://www.linuxfoundation.org/legal/privacy-policy>隐私政策
|
||
</a>|
|
||
<a class=footer-policies-link href=https://www.linuxfoundation.org/legal/trademark-usage>商标
|
||
</a>|
|
||
<a class=footer-policies-link href=https://github.com/istio/istio.io/edit/release-1.20/content/zh/index>在 GitHub 上编辑此页</a></li></ul><div class=footer-base><span class=footer-base-copyright>© 2024 the Istio Authors.</span>
|
||
<span class=footer-base-version>部分内容可能滞后于英文版本,同步工作正在进行中<br>版本
|
||
Istio 归档
|
||
1.20.3</span><ul class=footer-base-releases><li class=footer-base-releases-item><a tabindex=-1 class=footer-base-releases-link onclick='return navigateToUrlOrRoot("https://istio.io/blog/2019/performance-best-practices/"),!1'>当前版本</a></li><li class=footer-base-releases-item><a tabindex=-1 class=footer-base-releases-link onclick='return navigateToUrlOrRoot("https://preliminary.istio.io/blog/2019/performance-best-practices/"),!1'>下个版本</a></li><li class=footer-base-releases-item><a tabindex=-1 class=footer-base-releases-link href=https://istio.io/archive>旧版本</a></li></ul></div></div></footer><script src=https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js defer></script><div id=scroll-to-top-container aria-hidden=true><button id=scroll-to-top title=回到顶部 tabindex=-1><svg class="icon top"><use xlink:href="/v1.20/img/icons.svg#top"/></svg></button></div></body></html> |