GitHub Actions 的成本花在哪里?

简体中文 | English 假设你给一个 PR 推了一次代码,8 分钟后检查结束。这次检查用了多少 Runner 时间? 点开这次运行,里面有三个同时开始的 Job。Linux 跑了 8 分钟,Windows 跑了 6 分钟,macOS 跑了 5 分钟。三个 Runner 加起来用了 8 + 6 + 5 = 19 分钟。要算费用,还得把每个 Job 的时长和对应的 Runner 费率放在一起看。 AI 生成代码快了,一天里能做的改动也更多。如果这些改动变成更多 PR,或者在同一个 PR 上多推几次代码,CI 也可能多跑。按刚才那条检查算,多跑 5 次就多用 5 × 19 = 95 分钟 Runner 时间。这些额外的分钟进入计费后,Actions 账单也会跟着涨。 要解释账单为什么涨,我会先找出开销最大的工作流,再看它是跑得更勤了,还是每次跑得更久了。 ...

2026-11-28 · 4 分钟 · 1742 字 · 翟志军 Jack Zhai

Where Does the Money Go in GitHub Actions?

English | 简体中文 Suppose you push a commit to a pull request branch and the checks finish eight minutes later. How much runner time did they use? Open the run and you see three jobs that started together. The Linux job ran for eight minutes, the Windows job for six, and the macOS job for five. That adds up to 8 + 6 + 5 = 19 runner minutes. To estimate the cost, you also need the rate for each runner. AI can generate code faster, so teams can get more changes ready in a day. If that means more pull requests or more pushes to the same branch, those events can trigger more CI runs. Five extra runs of the checks above would use another 5 × 19 = 95 runner minutes. When that extra time is billable, the monthly Actions cost goes up. I’d check the most expensive workflow first. Did it run more often, or did its jobs take longer? ...

2026-11-28 · 5 min · 978 words · 翟志军 Jack Zhai

我是如何进行日志降本的

最近行业里流行降本增效。本文就一个现实中经常发生的日志成本的案例进行讨论,讨论该如何降本。 背景 假如存在一家IoT公司,它拥有1亿的在线设备(长连接着云端)。这些设备每21秒会向云端发送心跳,以进行连接的保活。假如1次连接的保活,在云端产生1条日志,那么1台设备1天产生的日志量是:24 * 60 * 60 / 21 = 4114条,假设1条日志100字节,所以: ...

2023-04-22 · 3 分钟 · 1324 字 · 翟志军 Jack Zhai