<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Parca on Tarragon</title><link>https://tarrragon.github.io/blog/tags/parca/</link><description>Recent content in Parca on Tarragon</description><generator>Hugo -- gohugo.io</generator><language>zh-TW</language><copyright>Tarragon (CC BY 4.0)</copyright><lastBuildDate>Fri, 15 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://tarrragon.github.io/blog/tags/parca/index.xml" rel="self" type="application/rss+xml"/><item><title>Parca</title><link>https://tarrragon.github.io/blog/backend/09-performance-capacity/vendors/parca/</link><pubDate>Fri, 15 May 2026 00:00:00 +0000</pubDate><guid>https://tarrragon.github.io/blog/backend/09-performance-capacity/vendors/parca/</guid><description>&lt;p>Parca 的核心責任是用開源 continuous profiling 與 eBPF 路線建立 infrastructure-wide profile evidence。它適合需要低侵入、跨 process、跨 service、偏平台層的 profiling 團隊，重點在用 always-on profile 找出 CPU、memory、runtime 與 kernel / user space 的資源熱點。&lt;/p>
&lt;h2 id="服務定位">服務定位&lt;/h2>
&lt;p>Parca 是 Polar Signals 主導的 OSS continuous profiling、特色是 &lt;em>eBPF-based 採集 + pprof 標準格式 + Prometheus-style 拉取與 label 模型&lt;/em>。它跟 &lt;a href="https://tarrragon.github.io/blog/backend/09-performance-capacity/vendors/pyroscope/" data-link-title="Pyroscope" data-link-desc="用 Grafana 生態與開源 profiling backend 建立可自管 profile diff 與 flame graph 的工具">Pyroscope&lt;/a> 是 OSS 同類、跟 &lt;a href="https://tarrragon.github.io/blog/backend/09-performance-capacity/vendors/datadog-continuous-profiler/" data-link-title="Datadog Continuous Profiler" data-link-desc="用 SaaS APM 整合、deployment marker 與 profile diff 支援 release regression 定位的 profiling 工具">Datadog Continuous Profiler&lt;/a> 則是 OSS / 自管 vs SaaS / APM 整合的差異。eBPF agent 直接從 kernel 採 stack trace、不需要 application 改 code 或注入 runtime agent；pprof 格式讓既有 Go / Java / Python 工具鏈可以直接讀；Prometheus-style scrape 讓 Parca server 跟 metrics 用同一套 service discovery 與 label。&lt;/p>
&lt;h2 id="最短判讀路徑">最短判讀路徑&lt;/h2>
&lt;p>判斷 Parca 部署是否能撐起 platform-wide profiling、最少看四件事：&lt;/p>
&lt;ul>
&lt;li>&lt;strong>eBPF agent deploy&lt;/strong>：Parca Agent 走 DaemonSet 跑在每個 node、需要 kernel ≥ 4.18（CO-RE / BTF）、&lt;code>SYS_ADMIN&lt;/code> 或 &lt;code>PERF_EVENT&lt;/code> capability、host PID namespace。受管 Kubernetes（GKE / EKS / AKS）的 worker node 是否允許這個權限是第一個判讀點&lt;/li>
&lt;li>&lt;strong>Parca server scrape&lt;/strong>：server 跟 agent 走 pull-based、Prometheus-style ServiceMonitor / scrape config、label 跟 metrics 同模型（namespace / pod / container / node）。scrape interval、retention、storage backend（FrostDB 內建 / object storage）要明確&lt;/li>
&lt;li>&lt;strong>pprof query&lt;/strong>：profile 以 pprof format 存、Parca UI 提供 flame graph 與 compare view、也可 export pprof file 給 &lt;code>go tool pprof&lt;/code> 或其他既有工具離線分析&lt;/li>
&lt;li>&lt;strong>Grafana integration&lt;/strong>：Parca 提供 datasource plugin、profile 可以跟 metrics / log / trace 在 Grafana 同一頁 correlate、配 &lt;a href="https://tarrragon.github.io/blog/backend/09-performance-capacity/vendors/pyroscope/" data-link-title="Pyroscope" data-link-desc="用 Grafana 生態與開源 profiling backend 建立可自管 profile diff 與 flame graph 的工具">Pyroscope&lt;/a> 或 Tempo 形成 observability 對齊&lt;/li>
&lt;/ul>
&lt;p>四件事任一缺失、就是 profiling control plane 還沒上線的待補項目。&lt;/p></description><content:encoded><![CDATA[<p>Parca 的核心責任是用開源 continuous profiling 與 eBPF 路線建立 infrastructure-wide profile evidence。它適合需要低侵入、跨 process、跨 service、偏平台層的 profiling 團隊，重點在用 always-on profile 找出 CPU、memory、runtime 與 kernel / user space 的資源熱點。</p>
<h2 id="服務定位">服務定位</h2>
<p>Parca 是 Polar Signals 主導的 OSS continuous profiling、特色是 <em>eBPF-based 採集 + pprof 標準格式 + Prometheus-style 拉取與 label 模型</em>。它跟 <a href="/blog/backend/09-performance-capacity/vendors/pyroscope/" data-link-title="Pyroscope" data-link-desc="用 Grafana 生態與開源 profiling backend 建立可自管 profile diff 與 flame graph 的工具">Pyroscope</a> 是 OSS 同類、跟 <a href="/blog/backend/09-performance-capacity/vendors/datadog-continuous-profiler/" data-link-title="Datadog Continuous Profiler" data-link-desc="用 SaaS APM 整合、deployment marker 與 profile diff 支援 release regression 定位的 profiling 工具">Datadog Continuous Profiler</a> 則是 OSS / 自管 vs SaaS / APM 整合的差異。eBPF agent 直接從 kernel 採 stack trace、不需要 application 改 code 或注入 runtime agent；pprof 格式讓既有 Go / Java / Python 工具鏈可以直接讀；Prometheus-style scrape 讓 Parca server 跟 metrics 用同一套 service discovery 與 label。</p>
<h2 id="最短判讀路徑">最短判讀路徑</h2>
<p>判斷 Parca 部署是否能撐起 platform-wide profiling、最少看四件事：</p>
<ul>
<li><strong>eBPF agent deploy</strong>：Parca Agent 走 DaemonSet 跑在每個 node、需要 kernel ≥ 4.18（CO-RE / BTF）、<code>SYS_ADMIN</code> 或 <code>PERF_EVENT</code> capability、host PID namespace。受管 Kubernetes（GKE / EKS / AKS）的 worker node 是否允許這個權限是第一個判讀點</li>
<li><strong>Parca server scrape</strong>：server 跟 agent 走 pull-based、Prometheus-style ServiceMonitor / scrape config、label 跟 metrics 同模型（namespace / pod / container / node）。scrape interval、retention、storage backend（FrostDB 內建 / object storage）要明確</li>
<li><strong>pprof query</strong>：profile 以 pprof format 存、Parca UI 提供 flame graph 與 compare view、也可 export pprof file 給 <code>go tool pprof</code> 或其他既有工具離線分析</li>
<li><strong>Grafana integration</strong>：Parca 提供 datasource plugin、profile 可以跟 metrics / log / trace 在 Grafana 同一頁 correlate、配 <a href="/blog/backend/09-performance-capacity/vendors/pyroscope/" data-link-title="Pyroscope" data-link-desc="用 Grafana 生態與開源 profiling backend 建立可自管 profile diff 與 flame graph 的工具">Pyroscope</a> 或 Tempo 形成 observability 對齊</li>
</ul>
<p>四件事任一缺失、就是 profiling control plane 還沒上線的待補項目。</p>
<h2 id="定位">定位</h2>
<p>Parca 適合平台團隊建立 profiling control plane。當問題橫跨 Kubernetes cluster、node pool、multi-service path 或 shared runtime 成本，Parca 能從更接近 infrastructure 的角度收集 profile。</p>
<p>這個定位讓 Parca 接到 <a href="/blog/backend/09-performance-capacity/bottleneck-localization/" data-link-title="9.5 瓶頸定位流程" data-link-desc="從 app 到 DB / cache / broker / 第三方 quota 的逐層瓶頸定位">9.5 瓶頸定位流程</a> 與 <a href="/blog/backend/04-observability/continuous-profiling/" data-link-title="4.9 Continuous Profiling" data-link-desc="把 CPU / memory / lock profile 從一次性除錯升級為持續訊號">4.9 Continuous Profiling</a>。它的價值在於低侵入與平台廣度；它的代價在於 eBPF 支援、symbolization、storage、權限與平台維運責任。</p>
<h2 id="適用場景">適用場景</h2>
<p>Infrastructure-wide profiling 適合 Parca。平台團隊可以觀察 cluster、node、namespace、service 與 process 的 CPU 熱點，找出共同 library、runtime、sidecar、agent 或 kernel path 的成本。</p>
<p>Kubernetes 平台適合 Parca。當服務在多 namespace、多 workload、多 node pool 上運作，Parca 可以把 profile 維度接到 pod、container、node、namespace 與 label。</p>
<p>低侵入 profiling 適合 Parca。eBPF-based profiling 可以降低 application instrumentation 成本，讓團隊先取得廣域視角，再對特定服務加更細的 runtime profiler 或 APM 整合。</p>
<h2 id="選型判準">選型判準</h2>
<table>
  <thead>
      <tr>
          <th>判準</th>
          <th>Parca 的價值</th>
          <th>需要補的能力</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>eBPF / low overhead</td>
          <td>低侵入取得廣域 profile</td>
          <td>kernel / runtime 支援與權限治理</td>
      </tr>
      <tr>
          <td>Platform-wide</td>
          <td>node、namespace、service 維度可對照</td>
          <td>Kubernetes label 與 ownership discipline</td>
      </tr>
      <tr>
          <td>Open source</td>
          <td>profiling platform 可自管</td>
          <td>storage、retention、upgrade</td>
      </tr>
      <tr>
          <td>Compare / diff</td>
          <td>profile compare 支援退化定位</td>
          <td>deploy label、baseline 與 symbolization</td>
      </tr>
  </tbody>
</table>
<p>eBPF / low overhead 價值來自平台廣度。團隊可以先觀察整個基礎設施的 CPU 熱點，再決定哪些服務需要更深入的 application-level profiling。</p>
<p>Platform-wide 價值來自共同成本治理。Sidecar、agent、logging library、serialization library 或 runtime upgrade 的成本可能散在多個服務中，Parca 這類工具能把分散成本聚合回平台決策。</p>
<h2 id="跟其他工具的取捨">跟其他工具的取捨</h2>
<p>Parca 和 Datadog Continuous Profiler 的主要差異是平台模型。Parca 偏開源、自管、eBPF 與 infra-wide profiling；Datadog 偏 SaaS、APM drilldown、deployment marker 與產品化 workflow。</p>
<p>Parca 和 Pyroscope 的主要差異是視角。Pyroscope 偏 Grafana / application profiling backend；Parca 偏 eBPF、Kubernetes / infrastructure-level profiling 與平台團隊治理。</p>
<p>Parca 和 language runtime profiler 的主要差異是導入方式。Runtime profiler 能提供語言特定維度；Parca 能先提供低侵入廣域 profile，但 symbolization 與語言細節需要額外治理。</p>
<h2 id="核心取捨表">核心取捨表</h2>
<table>
  <thead>
      <tr>
          <th>取捨維度</th>
          <th>Parca</th>
          <th>Pyroscope</th>
          <th>Datadog Continuous Profiler</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>採集方式</td>
          <td>eBPF agent（kernel-level、unwound）</td>
          <td>eBPF + SDK 雙路、語言 SDK 較豐富</td>
          <td>APM agent 內建、語言 SDK 整合</td>
      </tr>
      <tr>
          <td>Profile format</td>
          <td>pprof（Google 標準）</td>
          <td>自家 + pprof export</td>
          <td>Datadog proprietary、可 export pprof</td>
      </tr>
      <tr>
          <td>採集模型</td>
          <td>Pull-based、Prometheus-style scrape</td>
          <td>Push or pull（Grafana Agent）</td>
          <td>Push to Datadog backend</td>
      </tr>
      <tr>
          <td>Label 模型</td>
          <td>Prometheus label（namespace / pod）</td>
          <td>Grafana label</td>
          <td>Datadog tag</td>
      </tr>
      <tr>
          <td>部署模型</td>
          <td>Self-hosted OSS + Polar Signals SaaS</td>
          <td>Self-hosted OSS + Grafana Cloud SaaS</td>
          <td>SaaS only</td>
      </tr>
      <tr>
          <td>Storage</td>
          <td>FrostDB 內建 / object storage</td>
          <td>自家 storage / Grafana backend</td>
          <td>Datadog managed</td>
      </tr>
      <tr>
          <td>APM 整合</td>
          <td>弱 — 走 Grafana correlation</td>
          <td>中 — Grafana stack 整合</td>
          <td>強 — trace ↔ profile drilldown 內建</td>
      </tr>
      <tr>
          <td>適合場景</td>
          <td>Platform team 自管、Prometheus stack</td>
          <td>Grafana stack 已用、應用層 profiling</td>
          <td>已用 Datadog、APM-first、SaaS-only 可</td>
      </tr>
  </tbody>
</table>
<h2 id="進階主題">進階主題</h2>
<p><strong>Polar Signals Cloud</strong>：Parca 上游公司 Polar Signals 提供 managed SaaS — agent 一樣走 OSS、server / storage / UI 託管。適合不想養 Parca server 又要 OSS agent 路線的團隊。差異點是 ingestion cost 跟 retention 由 SaaS 計費、license / data residency 要看合約。</p>
<p><strong>Prometheus 同 label model</strong>：Parca 的 service discovery、scrape config 跟 label 跟 Prometheus 幾乎同形 — 既有 ServiceMonitor、relabel rule、Kubernetes SD 可以直接複用。意義是 profile 維度跟 metric 維度天然對齊、<code>namespace=foo, service=bar</code> 在兩邊都成立、cross-signal correlation 不需要再 mapping。</p>
<p><strong>Compare profiles（diff before/after deploy）</strong>：Parca UI 支援選 baseline window 跟 candidate window 做 flame graph diff、顏色標示哪個 stack frame 變胖變瘦。配 <a href="/blog/backend/09-performance-capacity/improvement-loop/" data-link-title="9.9 Performance Improvement Loop" data-link-desc="壓測 → profile → fix → re-test → release gate 的閉環">9.9 Performance Improvement Loop</a> 的 deploy marker、可以把「這次發版讓 CPU +15%」直接歸因到具體 frame。</p>
<p><strong>Continuous profiling vs sampling-only</strong>：傳統 profiler 是「出問題時手動跑 30 秒」、Parca 是「always-on、低頻率持續採」。差異是 <em>事後回溯能力</em> — incident 發生時直接拉時間區間的 profile、不用重現問題；sampling-only 工具在偶發 spike 時抓不到現場。代價是 storage 跟 agent overhead 要長期治理。</p>
<h2 id="操作成本">操作成本</h2>
<p>Parca 的主要成本是平台維運。Agent / scraper、server、storage、retention、symbolization、upgrade 與 Kubernetes 權限都需要平台團隊負責。</p>
<p>Symbolization 成本來自可讀性。Profile 如果缺 symbol、debug info、build ID 或 source mapping，flame graph 會變成難以行動的 address / binary offset，因此 build pipeline 要保留符號資訊策略。</p>
<p>權限成本來自 eBPF 與 node visibility。低層 profiling 需要足夠 host / kernel 權限，受管 Kubernetes、security policy、multi-tenant cluster 與 compliance 要先評估。</p>
<h2 id="evidence-package">Evidence Package</h2>
<p>Parca 結果應回寫到 evidence package。最小欄位包括 cluster、namespace、service、node pool、profile type、baseline window、candidate window、compare link、symbolization status、agent overhead、known gap 與 owner。</p>
<table>
  <thead>
      <tr>
          <th>欄位</th>
          <th>Parca 證據來源</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Source</td>
          <td>Parca query、compare view、flame graph</td>
      </tr>
      <tr>
          <td>Time range</td>
          <td>baseline / candidate profile window</td>
      </tr>
      <tr>
          <td>Query link</td>
          <td>Parca UI / dashboard / metrics link</td>
      </tr>
      <tr>
          <td>Data quality</td>
          <td>label completeness、symbolization status</td>
      </tr>
      <tr>
          <td>Confidence</td>
          <td>cluster coverage、agent overhead</td>
      </tr>
      <tr>
          <td>Known gap</td>
          <td>未覆蓋 node、symbol 缺失、kernel 限制</td>
      </tr>
  </tbody>
</table>
<p>Evidence package 的核心用途是把平台層 profile 變成容量決策。Reviewer 要能看到成本來自 application code、runtime、sidecar、kernel path 還是 shared library，並把結果回寫到 owner。</p>
<h2 id="排錯與失敗快速判讀">排錯與失敗快速判讀</h2>
<ul>
<li><strong>eBPF agent 起不來 / kernel 不支援</strong>：舊 kernel（&lt; 4.18）或缺 BTF / CO-RE 支援、受管 Kubernetes 不開 <code>SYS_ADMIN</code> — 先確認 node OS image、必要時換 distribution 或升級 worker node pool</li>
<li><strong>Profile storage 暴增</strong>：scrape interval 太密 + retention 沒設 + label cardinality 爆炸（把 request-id 放進 label）— 降頻、限 retention window、把高 cardinality 維度移出 profile label</li>
<li><strong>Symbol resolution 失敗 / flame graph 全是 address</strong>：build pipeline 沒保留 debug info、stripped binary、容器 image 不含符號 — 在 build 階段保留 debug symbol、用 separate debuginfo 上傳 Parca debuginfod、或在 image 保留 unstripped binary</li>
<li><strong>JIT 語言（Java / Node.js）stack 不完整</strong>：eBPF 看到的是 native frame、JIT-compiled frame 需要額外 perf map / JVMTI agent — 補語言層 profiler 或開 JIT symbol dump</li>
<li><strong>Agent overhead 影響 production</strong>：sample rate 預設 19 Hz、特定 workload 可能仍敏感 — 在 noisy neighbor 敏感的 node pool 降頻或排除特定 namespace</li>
<li><strong>多 cluster scrape 中心化太重</strong>：單一 Parca server 拉 N 個 cluster 變瓶頸 — 改 federation 模型、每 cluster 一個 Parca server、上層做 query aggregation</li>
</ul>
<h2 id="案例回寫">案例回寫</h2>
<p>Parca 適合回寫平台層與 multi-service 成本案例。它可接 <a href="/blog/backend/09-performance-capacity/cases/gcp-130k-node-gke-cluster/" data-link-title="9.C34 GCP：130,000-node GKE cluster 的工程極限" data-link-desc="Google 用單一 GKE control plane 跑 13 萬個 node、AI workload &#43; 1000 Pods/sec 創建吞吐">9.C34 GCP 130K node GKE cluster</a> 的 cluster-scale profiling 需求、<a href="/blog/backend/09-performance-capacity/cases/riot-games-eks-multi-cluster/" data-link-title="9.C12 Riot Games：246 個 EKS cluster 的多遊戲多地區治理" data-link-desc="Riot Games 從 Mesos 遷移到 EKS、用 246 個 cluster 跨遊戲跨地區治理、年省 1000 萬美金">9.C12 Riot Games EKS multi-cluster</a> 的 246 cluster 平台成本治理、<a href="/blog/backend/09-performance-capacity/cases/netflix-aurora-consolidation/" data-link-title="9.C23 Netflix：把關聯式 DB 統一到 Aurora、效能 &#43;75%、成本 -28%" data-link-desc="Netflix 把多套關聯式 DB 統一到 Aurora、效能提升 75%、成本下降 28%、串流數十億小時">9.C23 Netflix Aurora consolidation</a> 的 shared platform noise 降低、<a href="/blog/backend/09-performance-capacity/cases/maersk-bosch-azure-aks/" data-link-title="9.C33 Maersk &#43; Bosch：傳統產業在 Azure AKS 上的微服務治理" data-link-desc="全球海運 Maersk 跟 Bosch 智慧建築把 AKS 當微服務治理基礎、釋放工程資源做業務功能">9.C33 Maersk + Bosch Azure AKS</a> 的傳統產業多 BU 平台層歸因，以及 <a href="/blog/backend/09-performance-capacity/cases/capcom-gaming-dynamodb-eks/" data-link-title="9.C19 Capcom：Resident Evil / Monster Hunter 在 DynamoDB &#43; EKS 上的遊戲後端" data-link-desc="Capcom 把 Resident Evil、Street Fighter、Monster Hunter 遊戲後端跑在 DynamoDB &#43; EKS、單一秒位數延遲、營運成本降 30%">9.C19 Capcom DynamoDB + EKS</a> 跨遊戲共用後端的 profile 切分。</p>
<p>這些案例的重點是平台視角。Parca 頁引用案例時，要把 case 轉成 cluster / namespace / service label、compare window、symbolization、shared library cost 與 owner routing — 例如 GCP 130K-node 規模下，Parca 自身的 storage / scrape capacity 也成為 profile target、不只是觀測 application。</p>
<p>兩個典型用途值得單獨點名：</p>
<ul>
<li><strong>Performance regression detection</strong>：發版前後拉 compare profile、把「這次 release 讓 P99 CPU +18%」歸因到具體 stack frame。配 <a href="/blog/backend/09-performance-capacity/cases/riot-games-eks-multi-cluster/" data-link-title="9.C12 Riot Games：246 個 EKS cluster 的多遊戲多地區治理" data-link-desc="Riot Games 從 Mesos 遷移到 EKS、用 246 個 cluster 跨遊戲跨地區治理、年省 1000 萬美金">9.C12 Riot Games EKS multi-cluster</a> 的 246 cluster 規模、單一 service rollout 在 always-on profile 下可秒級看出 hot path 變化、不需要等 SRE 跑手動 pprof</li>
<li><strong>Cost engineering</strong>：把 CPU profile 折算成 node 成本、找出 shared library / runtime / sidecar 的 hidden cost。配 <a href="/blog/backend/09-performance-capacity/cases/netflix-aurora-consolidation/" data-link-title="9.C23 Netflix：把關聯式 DB 統一到 Aurora、效能 &#43;75%、成本 -28%" data-link-desc="Netflix 把多套關聯式 DB 統一到 Aurora、效能提升 75%、成本下降 28%、串流數十億小時">9.C23 Netflix Aurora consolidation</a> 的 platform consolidation 思路、profile 證據可以決定要不要重寫熱點、換 library、還是接受成本</li>
</ul>
<h2 id="下一步路由">下一步路由</h2>
<ul>
<li>上游：<a href="/blog/backend/09-performance-capacity/bottleneck-localization/" data-link-title="9.5 瓶頸定位流程" data-link-desc="從 app 到 DB / cache / broker / 第三方 quota 的逐層瓶頸定位">9.5 瓶頸定位流程</a></li>
<li>上游：<a href="/blog/backend/09-performance-capacity/improvement-loop/" data-link-title="9.9 Performance Improvement Loop" data-link-desc="壓測 → profile → fix → re-test → release gate 的閉環">9.9 Performance Improvement Loop</a></li>
<li>跨模組：<a href="/blog/backend/04-observability/continuous-profiling/" data-link-title="4.9 Continuous Profiling" data-link-desc="把 CPU / memory / lock profile 從一次性除錯升級為持續訊號">4.9 Continuous Profiling</a></li>
<li>平行：<a href="/blog/backend/09-performance-capacity/vendors/datadog-continuous-profiler/" data-link-title="Datadog Continuous Profiler" data-link-desc="用 SaaS APM 整合、deployment marker 與 profile diff 支援 release regression 定位的 profiling 工具">Datadog Continuous Profiler</a></li>
<li>平行：<a href="/blog/backend/09-performance-capacity/vendors/pyroscope/" data-link-title="Pyroscope" data-link-desc="用 Grafana 生態與開源 profiling backend 建立可自管 profile diff 與 flame graph 的工具">Pyroscope</a></li>
<li>官方：<a href="https://www.parca.dev/docs/">Parca documentation</a></li>
</ul>
]]></content:encoded></item></channel></rss>