OpenAI 介绍其基于 Codex 构建的 Performance Factory 系统,可在云端自动调查并修复性能回退问题。其中 Regression Workflow 在三个多月内完成逾 1700 次调查,定位 600 多起根因,日均自动调查 17 次。该系统将性能工程从人工排查推进到端到端 agent 工作流,为大规模 agentic 开发下的性能维护提供了可复用范式。
OpenAI detailed the Performance Factory, a Codex-powered cloud system that autonomously investigates and fixes performance regressions. Its first Regression Workflow tracked more than 1,700 investigations and root-caused over 600 cases in just over three months, averaging 17 automated investigations per day. The system moves performance engineering from manual debugging to end-to-end agent workflows, offering a reusable model for maintaining performance amid rapid agentic development.
我们由 Codex 驱动的系统可自动发现并修复性能问题。
Our Codex-powered system automates finding and fixing performance issues.
作者:Okay Zed 与 Cyrus Forbes,技术团队成员
By Okay Zed and Cyrus Forbes, Members of Technical Staff
智能体开发的惊人速度已使传统的性能工程方式难以为继。为跟上节奏,我们构建了 Performance Factory,这是一个自主系统,利用 Codex 和我们模型的全套能力,以前所未有的速度发现并修复性能回退。Performance Factory 在云端运行,自动完成性能问题的调查与解决,使我们能够跟上路线图的雄心。
The staggering pace of agentic development has made traditional approaches to performance engineering unsustainable. To keep up, we built the Performance Factory, an autonomous system that uses the full capabilities of Codex and our models to find and fix regressions at an unprecedented speed. The Performance Factory, which runs in the cloud and automates investigating and resolving performance problems, enables us to keep pace with the ambition of our roadmap.
在 Performance Factory 中,我们的工程师为周期性任务定义工作流,并为执行这些任务的 Codex 智能体编写指令。其中,Regression Workflow 会在性能告警触发时创建一个任务。一个智能体调查性能下降的原因,将发现记录在任务中,并提出修复方案供工程师审核。部署之后,另一个智能体会接手同一任务,检查性能是否已恢复到基线水平。从调查到编写修复方案再到验证缓解效果,Performance Factory 中的这第一个工作流已实现了修复性能回退全流程的自动化。在短短三个多月里,Regression Workflow 跟踪了 1,700 多次调查,并对 600 多起案例完成了根因定位。这相当于每天 17 次自动化调查。
In the Performance Factory, our engineers define workflows for recurring jobs and write instructions for the Codex agents that carry them out. In particular, the Regression Workflow opens a task when a performance alert fires. An agent investigates the slowdown, records its findings in the task, and proposes a fix for an engineer to review. After deployment, another agent picks up the same task to check whether performance has returned to baseline. From investigating to authoring the fix to verifying mitigation, this first workflow in the Performance Factory has automated the entire process of fixing regressions. In just over three months, the Regression Workflow tracked more than 1,700 investigations and root caused over 600 cases. That’s 17 automated investigations every day.
在本文中,我们将分享我们对 Codex 的使用如何演变为如今的 Performance Factory,介绍我们首个投入运行的工作流,并分享在生产环境中构建和运行智能体工作流的早期经验。
Here, we’ll share how our use of Codex evolved into what’s now the Performance Factory, walk through our first running workflow, and share early lessons from building and running agent workflows in production.
随着我们将 Codex 用于更多性能工作,我们注意到团队的工作方式呈现出一种演进。我们希望其他服务团队在将智能体工作流引入其他领域时,能从我们的实践中有所借鉴。
As we used Codex for more of our performance work, we noticed a progression in how our team worked. We hope other service teams can learn from our process as they adopt agentic workflows in other domains.
软件工作正从人工劳动,演进为与机器协作,再演进为智能体工厂。
Software work evolves from manual labor to partnering with machines to agent factories.
1. Codex 之前。在 Codex 出现之前,工程师需要手动检查指标和日志、比对追踪数据、调试线上机器,并阅读代码来排查性能下降问题。这项工作耗时费力,而且往往需要深入了解该服务才能知道从哪里入手。相关信号很容易被遗漏。当我们反复遇到同类问题——比如 ChatGPT 首 token 延迟出现回退——我们便构建了 CPU 与内存分配分析器等高级工具,让这些排查工作更轻松。随着时间推移,我们积累了 30 多个性能工具。
1. Pre-Codex . Before Codex, engineers manually examined metrics and logs, compared traces, debugged live machines, and read code to investigate a slowdown. This work was time consuming, and knowing where to look often required deep knowledge of the service. Relevant signals were easy to miss. When we encountered the same kinds of problems repeatedly—like regressions in ChatGPT’s first token latency—we built advanced tools, like CPU and allocation profilers, to make those investigations easier. Over time, we accumulated more than 30 performance tools.
2. 让 Codex 作为伙伴。有了 Codex 作为伙伴后,工程师可以直接问:“为什么这个变慢了?”并与 Codex 一起排查,即使面对不熟悉的系统也能如此。Codex 能够搜索大型代码库、找到相关指标和追踪数据、追踪跨服务的交互,并执行适当的性能分析,从而拼凑出事情的经过。但工程师仍需引导整个过程,知道该使用哪些性能工具,以及如何引导排查方向。对于更多人来说,困难排查变得更容易调试,所需的专业知识和时间也更少。
2. Codex as a partner . Once we had Codex as a partner, engineers could ask, “Why did this get slower?” and work with Codex to investigate, even in an unfamiliar system. Codex could search large codebases, find relevant metrics and traces, follow interactions across services, and do appropriate profiling to piece together what had happened. But engineers still had to steer the process, knowing which performance tools to use and how to guide the investigation. Difficult investigations were more debuggable for more people, with less expertise and time required.
3. 可复用的技能。为了进一步自动化,我们将性能团队的排查流程固化到一个名为 perf-forensics 的共享技能中。它会告诉 Codex 有哪些可用工具、何时使用这些工具,以及如何逐步排查性能下降问题,从而让 Codex 尝试从多个角度解决问题:
3. Reusable skills . To automate further, we captured our performance team’s investigation process in a shared skill called perf-forensics . It tells Codex which tools are available, when to use them, and how to work through a slowdown so Codex can try to resolve the problem from a few angles:
排查是否由部署或配置变更导致
Investigate whether deployments or configuration changes could explain it
我们使用基于过往回退案例的评估来测试并改进 perf-forensics 技能。对于我们重点关注的回退类型(例如 ChatGPT 延迟和可用性下降),我们现在只需把告警交给 Codex,就能在一次运行中获得诊断结果,无需逐步引导它。
We tested and refined the perf-forensics skill using evals based on past regressions. For the types of regressions we focused on (for example, ChatGPT latency and availability drops), we could now give Codex an alert and get back a diagnosis in a single run, without guiding it through each step.
4. 人类代理。随着我们不断添加和改进 perf-forensics 等与性能相关的 Codex 技能,我们开始感觉自己像是告警与 Codex 之间的代理。告警触发后,工程师只需将其复制粘贴到 Codex 中并配上合适的技能,然后再把发现结果粘贴回 Slack。
4. The human proxy . As we added and refined perf-related Codex skills like perf-forensics , we started to feel like a proxy between our alerts and Codex. An alert would fire, and an engineer would simply copy and paste it into Codex with the right skill, then paste the findings back into Slack.
5. 自动化调查。接下来,我们将调查迁移到云端,使警报能够自动启动 Codex 会话。Codex 调查了变慢的原因,并将其发现发布在 Slack 线程中,但自动化到此回复为止。工程师仍然需要接手诊断、制定修复方案,并在部署后检查是否有效。随着警报不断累积,即使只是弄清楚哪些回归需要关注,也意味着要在 Slack 线程中逐一筛选。
5. Automated investigations . Next, we moved investigations to the cloud so an alert could start a Codex session automatically. Codex investigated the slowdown and posted its findings in the Slack thread, but the automation ended with that reply. An engineer still had to pick up the diagnosis, develop a fix, and check whether it worked after deployment. As alerts accumulated, even figuring out which regressions needed attention meant sifting through Slack threads.
6. 工厂。我们构建了 Performance Factory,用于运行端到端的智能体性能工程工作流。它会跟踪每个活跃任务下一步需要什么,并在该步骤就绪时分配一个智能体。每个任务都会保留其状态和发现,因此工作可以在智能体和工程师之间传递,并在代码审查或部署后恢复。对于回归问题,工作从调查警报开始,到验证生产环境恢复结束。我们可以将常见的优化转化为定期跨服务运行的工作流。一个发现潜在优化的工作流可以在另一个工作流中打开任务来测试并实施它。
6. The factory . We built the Performance Factory to run end-to-end agentic performance engineering workflows. It tracks what each active task needs next and assigns an agent when that step is ready. Each task keeps its state and findings, so work can pass between agents and engineers and resume after a code review or deployment. For a regression, the work starts with investigating an alert and ends with verifying recovery in production. We can turn common optimizations into workflows that run regularly across our services. A workflow that spots a potential optimization can open a task in another workflow to test and implement it.
Performance Factory 由四个组件组成:一个具有可配置工作流的任务跟踪器、一个将就绪工作分配给智能体的调度循环、一个在云端运行 Codex 的 API,以及在某些变化发生时(例如 GitHub 审查评论发布或部署完成)唤醒智能体的订阅机制。
The Performance Factory is made up of four components: a task tracker with configurable workflows, a dispatch loop that assigns ready work to agents, an API that runs Codex in the cloud, and subscriptions that wake agents when something changes (such as a GitHub review comment posting or a deployment completing).
Performance Factory 由任务服务、调度循环、云端执行和订阅机制组成。
Performance Factory consists of a task service, dispatch loop, cloud execution, and subscriptions.
任务服务是工程师通过添加配置文件和供智能体遵循的提示(以 Markdown 编写)来定义工作流的地方。配置列出了任务可以经历的状态、允许的转换,以及哪些步骤需要工程师参与。单独的提示告诉智能体在每个步骤该做什么。
The task service is where engineers define workflows by adding configuration files and prompts for the agents to follow, written in Markdown. The configuration lists the states a task can move through, the allowed transitions, and which steps need an engineer. Separate prompts tell agents what to do at each step.
代码更改任务包含一个配置文件,以及用于实施和审查的 Markdown 提示。
A code change task contains a configuration file, along with Markdown prompts for implementing and reviewing.
每一项工作都会成为工作流中的一个任务,所有工作流都可以在界面中看到。工程师可以查看哪些任务处于开放状态、跟踪进度,并与可能掌握更多背景信息或能够协助下一步工作的队友共享任务。
Each piece of work becomes a task in a workflow, and all workflows are visible in a UI. Engineers can see what’s open, follow progress, and share a task with a teammate who might have more context or be able to help with the next step.
调度循环会定期检查哪些任务已准备好进入下一步。它通过启动一个 Codex 回合并附带该任务当前状态的指令,为每个任务分配一个智能体。智能体在任务上记录其进度,并在完成该步骤后将任务推进到下一状态。
A dispatch loop periodically checks which tasks are ready for the next step. It assigns an agent to each task by starting a Codex turn with the instructions for the task’s current state. The agent records its progress on the task and moves it to the next state if it completes the step.
任务分配完成后,智能体需要一个执行工作的环境,并能访问工程师会使用的相同工具。我们构建了一个内部 API,以编程方式在云端调用 Codex 回合。该 Codex 回合在我们网络内的环境中运行,可访问我们的代码仓库以及工程师使用的可观测性工具,例如指标、日志、追踪、CPU 性能分析和内存快照。
Once a task is assigned, the agent needs a place to do the work, with access to the same tools an engineer would use. We built an internal API to programmatically invoke a Codex turn in the cloud. The Codex turn runs on an environment inside our network, with access to our code repositories and the observability tools our engineers use, such as metrics, logs, traces, CPU profiles, and memory snapshots.
智能体以服务身份运行,因此我们可以限定其权限范围,并查看哪些操作来自我们的性能智能体。将智能体工作迁移到云端,使我们能够并行运行工作,而无需依赖工程师的笔记本电脑保持开机,也无需手动管理单个云开发机。
The agent runs under a service identity, so we can scope its permissions and see which actions came from our performance agents. Moving agentic work to the cloud lets us run work in parallel without relying on engineers’ laptops being open or manually managing individual cloud development boxes.
发现、定位根因并解决性能回归,是我们在 Performance Factory 中构建的第一个工作流。我们称之为 Regression Workflow。性能回归会经历多个阶段:需要调查、已定位根因、已提出修复方案和已解决,因此我们构建了自动化工作流,以反映这些阶段并推动任务依次经过这些阶段。
Finding, root causing, and solving regressions is the first workflow we built inside the Performance Factory. We call it the Regression Workflow. A performance regression moves through several stages: needs investigation , root caused , fix proposed , and resolved , so we built the automated workflow to reflect and move a task through those same stages.
当其配置的某个性能告警触发时,Regression Workflow 会创建一个任务,由智能体接手并推动其跨越这些阶段。任务会在任何单个智能体的上下文之外记录其状态和关键发现,以便其他智能体或工程师可以接手这项工作。工程师可以在 Slack 或 Regression Workflow 界面中跟踪工作进展、补充背景信息并审查提议的更改。修复部署后,智能体会在解决任务之前检查性能是否已恢复到原始状态。
When one of its configured performance alerts fires, the Regression Workflow opens a task that agents pick up and move across these stages. The task records its status and key findings outside of any one agent’s context so that other agents or engineers can pick up the work. Engineers can follow the work in Slack or the Regression Workflow UI, add context, and review proposed changes. After a fix is deployed, an agent checks whether the performance has recovered to its original state before resolving the task.
回归工作流的步骤包括:定位根因、提出修复方案、审查与部署、验证恢复。
The Regression Workflow’s steps include finding the root cause, proposing a fix, reviewing and deploying, and verifying recovery.
定位根因(可能不止一个)是工作流中的第一个主要步骤。智能体首先查明哪些指标变差、何时开始变化以及哪些服务请求受到影响。perf-forensics 技能让 Codex 能够使用我们性能工程师所用的工具,并提供了一套用于解决这些问题的操作手册。
Finding the root cause (or causes) is the first major step in the workflow. The agent starts by figuring out which metrics got worse, when they started to change, and which service requests were affected. The perf-forensics skill gives Codex access to the tools our performance engineers use and a playbook for working through those questions.
当指标越过阈值时会触发告警,但回归可能早在数小时前就已开始。智能体会回溯数据,找出指标首次变差的时间点。随后它对比请求分组:是相似的请求确实变慢了,还是我们正在处理更多本就缓慢的请求?这些发现指向不同的原因。
An alert fires when a metric crosses a threshold, but the regression may have started hours earlier. The agent looks back through the data to find when the metric first got worse. It then compares groups of requests: did similar requests actually get slower, or were we serving more requests that were already slow? Those findings point to different causes.
一旦知道何时、何处去查,智能体就会检查部署和功能开关变更,然后阅读相关代码。它会核实变更实际到达受影响请求的时间,并利用日志或追踪来检验代码能否解释所发生的情况。
Once it knows when and where to look, the agent examines deployments and feature flag changes, then reads the relevant code. It checks when a change actually reached the affected requests and uses logs or traces to test whether the code could explain what happened.
早期,智能体有时会止步于它们找到的第一个看似合理的解释,而其中一些诊断后来被证明是错误的。为了捕捉这些错误,我们增加了一道对抗性审查:由一个独立的 Codex 会话尝试推翻所提出的诊断。审查者会重新检查假设并测试反事实。如果某次发布导致了变慢,那么未受影响的相似请求是否保持正常?如果疑似变更被回滚,受影响的指标是否恢复?
Early on, agents sometimes stopped at the first plausible explanation they found, and some of those diagnoses turned out to be wrong. To catch these mistakes, we added an adversarial review: a separate Codex session that tries to disprove the proposed diagnosis. The reviewer rechecks the assumptions and tests counterfactuals. If a rollout caused the slowdown, did similar requests that weren’t exposed stay healthy? If the suspected change was rolled back, did the affected metric recover?
在一次调查中,一个智能体将失败的 ChatGPT 对话追溯到图片下载错误,并标记为已找到原因。Codex 审查者注意到,负责定位文件的内部服务已经恢复,而图片请求仍在失败。该诊断无法解释持续存在的故障,因此 AI 审查者重新启动了调查,并记录了仍需确认的事项。
In one investigation, an agent traced failing ChatGPT conversations to errors in image downloads and marked the cause as found. The Codex reviewer noticed that the internal service responsible for locating files had already recovered while image requests were still failing. The diagnosis did not explain the continuing failures, so the AI reviewer reopened the investigation and recorded what still needed to be established.
我们成功地将较大的任务拆分为聚焦的 Codex 轮次。在对 100 条根因建议的人工审查中,我们评定 70% 为准确,30% 需要进一步细化或未能完全确立因果关系。在回归工作流中,不同的轮次分别调查回归、质疑诊断并提出修复方案,通过相互制衡来提高准确率。
We’ve had success breaking larger jobs into focused Codex turns. In a manual review of 100 root cause suggestions, we graded 70% as accurate, with 30% needing further refinement or not fully establishing causality. In the Regression Workflow, different turns investigate regressions, challenge diagnoses, and propose fixes to increase accuracy numbers through checks and balances.
一旦诊断通过对抗性审查,工作流就会要求 Codex 实施修复并提交拉取请求。工程师审查该 PR 并决定是否合并。我们投入了大量工作,使这一交接尽可能顺畅。每个任务都有一份报告,其中自动生成回归摘要、影响、根因和建议修复方案。我们调整了这些摘要,使其易于快速浏览,包括指标时间序列、CPU 火焰图和追踪信息,帮助工程师快速理解发现并核查证据。工程师可以直接编辑 PR,或利用诊断信息自行编写修复方案。如果他们在 PR 上留下评论,工作流会唤醒一个 agent 来处理这些评论。
Once the diagnosis passes adversarial review, the workflow asks Codex to implement a fix and open a pull request. An engineer reviews the PR and decides whether to merge it. We’ve put a significant amount of work into making this handoff as easy as possible. Each task has a report with an automatically generated summary of the regression, its impact, the root cause, and the proposed fix. We’ve tuned these summaries to be easy to scan, including metrics time series, CPU flame graphs, and traces to help engineers quickly understand the findings and inspect the evidence. Engineers can edit the PR directly or use the diagnosis to write their own fix. If they leave comments on the PR, the workflow wakes an agent to address them.
一个回归任务的示例报告展示了关键细节、根因和建议修复方案。
An example task report for a regression shows key details, root cause, and proposed fix.
在工程师部署修复后,工作流会唤醒一个 agent 检查性能是否已恢复到先前的基线水平。如果已恢复,该 agent 会将任务标记为已解决。如果性能仅部分恢复,该 agent 会解决原始回归,并为剩余的变慢问题开启一个新任务,该问题可能由不同原因导致。如果没有改善,该 agent 会记录所发生的情况,并将该回归发回调查。
After an engineer deploys the fix, the workflow wakes an agent to check whether performance has returned to its earlier baseline. If it has, the agent marks the task as resolved. If performance has only partially recovered, the agent resolves the original regression and opens a new task for the remaining slowdown, which may have a different cause. If there’s no improvement, the agent records what happened and sends the regression back for investigation.
把修复做对比找到根因更难。例如,我们见过智能体提出的改动比必要的更复杂,或者引入了新问题。与根因分析步骤类似,我们为每个提议的修复增加了对抗性审查,以检查它们是否解决了根因,并帮助发现缺陷或意外后果。有些修复还需要更高层面的架构决策。例如,增加缓存可能提升性能,但会引入陈旧数据。这类改动需要了解该服务、能够权衡取舍的工程师提供指导。
Getting fixes right has been harder than finding the cause. For example, we’ve seen cases where the agent-proposed changes are more complicated than necessary or introduce new issues. Similar to the root cause step, we added an adversarial review of each proposed fix to check whether they address the root cause and help catch bugs or unintended consequences. Some fixes also require higher level architectural decisions. For example, adding a cache might improve performance but introduce stale data. Changes like these benefit from guidance from an engineer who knows the service and can weigh the tradeoffs.
我们正在利用这些案例构建一个评估与改进闭环。通过将智能体提出的修复与工程师最终合并的改动进行对比,我们可以更好地理解提议在哪些方面存在不足,构建评估,并改进工作流。我们还在研究使用合成性能测试,让智能体能够衡量提议的修复,并在请求工程师审查之前进行修订。我们也在探索智能体如何利用我们的其他智能体审查工具来识别低风险改动,并最终在无需人工介入的情况下交付这些修复。
We’re building an evaluation and improvement loop using these cases. By comparing the fixes agents propose with the changes engineers ultimately merge, we can better understand where proposals fall short, build evals, and improve the workflow. We’re also working on using synthetic performance tests so agents can measure proposed fixes and revise them before asking an engineer for review. We’re also exploring how agents could use our other agentic review tools to identify low-risk changes and eventually ship those fixes without a human in the loop.
构建和运行 Performance Factory 让我们学到了很多关于在生产环境中开发和运营智能体工作流的经验。以下是一些面向构建自有智能体工作流的团队的经验教训。
Building and running the Performance Factory has taught us a lot about developing and operating agent workflows in production. Here are some lessons for teams building their own agentic workflows.
Codex 调查的原始输出可能是一大段难以解析的文字。要弄清楚智能体在声称什么,并追踪图表以查看数据是否支持其说法,需要付出不少努力。我们希望工程师把注意力花在决策上,而不是重建智能体的工作过程。
The raw output from a Codex investigation can be a wall of text that’s hard to parse. It takes effort to figure out what the agent is claiming and track down the graphs to see whether the data backs it up. We want engineers to spend their attention on decisions rather than reconstructing the agent’s work.
智能体能够调查的回归问题数量,远超团队有时间阅读的范围。我们的第一个版本给工程师提供了一个满是发现的 UI,但仍然需要有人来决定哪些信息重要。一个回归问题也可能在告警、监控和渠道中表现为多个事件。现在,该工作流会关联相关事件,按团队关心的指标对它们分组,并对它们的预估影响进行排序。工程师可以专注于补充上下文、权衡取舍,并决定交付什么。
Agents can investigate more regressions than a team has time to read about. Our first version gave engineers a UI full of findings, but someone still had to decide which information mattered. One regression can also appear as several incidents across alerts, monitors, and channels. The workflow now links related incidents, groups them by the metrics teams care about, and ranks their estimated impact. Engineers can focus on adding context, weighing tradeoffs, and deciding what to ship.
更新调查技能或升级模型,可能会让智能体在某些案例的诊断上表现更好,而在另一些案例上表现更差,因此我们需要在更新之前测试它们的影响。我们分别测试两件事:1)智能体的调查效果如何;2)其总结对工程师有多大用处。
Updating an investigation skill or upgrading the model can make the agent better at diagnosing some cases and worse at others, so we nee d to test their impact before updating them . W e test two things separately: 1) how well the agent investigates and 2) how useful its summaries are to engineers.
对于调查,我们会针对过去的生产事故进行回测。我们将这些事故转化为一套测试用例,以便在更改技能时重新运行。一个 Codex 智能体会尝试调查并解决该事故,然后我们将智能体的行为与实际的过往解决数据进行对比。每个用例都从一个全新的 Codex 调查员和原始信号开始,并剥离可能泄露答案的细节。
For investigations, we backtest against past production incidents. We turn those incidents into a suite of test cases we can rerun when we change the skill. A Codex agent attempts to investigate and resolve the incident, and we compare the agent’s behavior to the actual past resolution data. Each case starts with a fresh Codex investigator and the original signal, stripped of details that might give away the answer.
历史测试需要谨慎对待。指标和追踪会过期,而恢复后收集的证据可能会泄露原因。只有当我们了解调查员可能看到哪些证据时,测试才有用。智能体可以在设定限制内检查代码并查询生产遥测数据。它不能使用保存的记忆(先前调查的笔记)、阅读事故报告或查看先前运行的结果。我们之后还会检查其记录,以查找可能破坏测试的信息。
Historical tests need care. Metrics and traces expire, while evidence collected after recovery can give away the cause. A test is only useful if we understand what evidence the investigator could see. The agent can inspect code and query production telemetry within set limits. It cannot use saved memories (notes from earlier investigations), read the incident writeup, or see results from previous runs. We also inspect its transcript afterward for information that might have spoiled the test.
我们评估问题开始的时间、规模大小以及哪些请求受到影响。我们还会评估智能体如何利用证据对可能的原因进行排序,并解释哪些方面仍不确定。智能体可能把时间判断正确,却归咎于错误的部署,因此我们会分别对这些方面评分。
We score when the problem began, how large it was, and which requests were affected. We also evaluate how the agent uses evidence to rank possible causes and explain what remains uncertain. An agent can get the timing right and still blame the wrong deployment, so we score those separately.
我们使用已保存任务的快照来评估任务总结。这些快照特别适合回测,因为总结不依赖于会过期的外部指标或追踪。一个独立的评分器会检查不熟悉该系统的工程师是否能理解发生了什么及其重要性、有用的图表是否被保留,以及所提出的下一步是否得到证据支持。
We evaluate task summaries using snapshots of saved tasks. These make particularly good backtests because summarization does not depend on external metrics or traces that expire. A separate grader checks whether an engineer unfamiliar with the system can understand what happened and why it matters, whether useful charts were kept, and whether the proposed next step is supported by the evidence.
最后,我们的智能体需要像它们所调查的服务一样受到监控。一个损坏的性能分析器或缺失的权限,都可能使智能体无法验证导致变慢的原因。这些故障在最终报告中很难被发现,因此我们每天运行一个智能体,检查近期运行的消息和日志,查找工具故障和访问错误。
Lastly, our agents need monitoring just as much as the services they investigate. A broken profiler or a missing permission can keep an agent from verifying what caused a slowdown. Those failures can be hard to spot in the final report, so we run an agent every day to look through messages and logs from recent runs for tool failures and access errors.
我们使用 Performance Factory 来自行修复并解决这项检查发现的问题。当同一个工具错误阻碍了多项调查时,智能体会创建一个任务来修复它。如果原因明确,智能体会提出修复方案,工程师审查该变更并决定是否合并。在合并此类变更后,我们还会使用评估来检查智能体能否越过此前阻碍它们的步骤。
We use the Performance Factory to self-repair and fix the problems this check uncovers. When the same tool error blocks several investigations, the agent creates a task to fix it. If the cause is clear, an agent proposes a fix, and an engineer reviews the change and decides whether to merge it. After merging changes like this, we also use evals to check whether agents can get past the step that previously blocked them.
Regression Workflow 只是智能体工厂模式的一个实例,该模式让任务在明确的状态之间流转。当有更多工作就绪时,智能体推进任务;独立的审查者质疑结论;当下一步决策需要判断时,工程师介入。其他工作流可以复用同一套机制,只需使用不同的状态、指令和事件。
The Regression Workflow is just one instance of the agent factory pattern that moves tasks through explicit states. Agents advance the task when more work is ready; separate reviewers challenge the conclusions; engineers step in when the next decision requires judgment. Other workflows can reuse the same machinery with different states, instructions, and events.
从一个工作流到多个工作流。Performance Factory 可以跨工作流协调智能体,一个工作流中的智能体可以为另一个工作流创建任务。
From one workflow to many. The Performance Factory can coordinate agents across workflows, with agents in one workflow creating tasks for another.
目前,我们的 Regression Workflow 在告警触发时启动。不过,我们正在研究更主动的方式,让 Performance Factory 即使在没有告警触发时也能发现变慢和优化机会。我们希望智能体利用我们已经收集的大量细粒度性能数据,发现告警遗漏的回归或发现优化机会。通过比较不同类型的数据(成批的 CPU 和内存性能分析、堆转储以及跨版本的请求追踪),智能体可能会注意到某个请求的 CPU 使用率小幅上升。然后它可以在 Regression Workflow 中创建一个任务,追踪该上升的成因,实施修复,并创建一个 PR 供工程师审查。
Currently, our Regression Workflow starts when an alert fires. However, we’re working on more proactive ways for the Performance Factory to find slowdowns and optimizations even when no alert fires. We want agents to use the large amount of fine-grained performance data we already collect to spot regressions our alerts miss or discover optimizations. By comparing different kinds of data (batches of CPU and memory profiles, heap dumps, and request traces across releases), an agent might notice a small increase in CPU for a given request. It can then open a task in the Regression Workflow to trace the increase to its cause, implement a fix, and open a PR for an engineer to review.
在我们已经知道要查找什么的情况下,我们正致力于将已知信号编码到更多的 Performance Factory 工作流中。例如,我们的服务规模调整技能可帮助代理发现那些使运行副本数超过服务实际需求的自动扩缩容设置。当我们学会识别这样的模式时,我们希望为其构建工作流并在所有服务中定期运行,从而在快速变化的环境中持续优化。借助 Performance Factory,工程师从一次变慢中学到的经验可以影响我们调查和修复下一次变慢的方式,即使数月后发生在不同的服务中也是如此。
In cases where we already know what to look for, we’re working to encode known signals into more Performance Factory workflows. Our service rightsizing skill, for example, helps agents spot autoscaling settings that keep more replicas running than a service needs. When we learn to recognize a pattern like that, we want to build and regularly run a workflow for it across all our services, constantly optimizing in a rapidly changing environment. With the Performance Factory, what an engineer learns from one slowdown can shape how we investigate and fix the next one, even months later in a different service.
下次你使用 ChatGPT 并注意到变慢时,Performance Factory 很可能已经在查明原因。如今,瓶颈可能在于等待工程师审查并合并修复。我们已经在探索代理能否自行完成这项工作。随着产品开发借助 Codex 不断加速,性能系统需要变得越来越自主和自我改进才能跟上。Codex 已经帮助我们更快地构建 ChatGPT。现在它正帮助我们保持 ChatGPT 的速度。
Next time you’re using ChatGPT and notice a slowdown, there’s a good chance the Performance Factory is already figuring out why. Today, the bottleneck may be waiting for an engineer to review and merge the fix. We’re already exploring whether agents can do this themselves. As product development keeps accelerating with Codex, performance systems need to become increasingly autonomous and self-improving to keep up. Codex already helps us build ChatGPT faster. Now it’s helping us keep ChatGPT fast.
特别感谢构建 Performance Factory 的团队,以及我们的文章贡献者 Brendan Gregg、Pieter Hooimeijer、Nick Cooper 和 Louis Brandy。
Special thanks to the team that built the Performance Factory, as well as our post contributors Brendan Gregg, Pieter Hooimeijer, Nick Cooper, and Louis Brandy.