Latency Critical Systems

作者 affaan-mef648e01899bMIT275K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库3天前更新

Optimize and verify latency-sensitive systems — realtime dashboards, market data feeds, streaming agents, execution gateways, queues, and caches — by tracking p50/p95/p99 latency, freshness age, and queue depth, mapping hot paths, and running live readbacks. Use when p95 latency, throughput, or data freshness matters.

AI 生成的概览

指导使用 p50/p95/p99 指标、热路径映射和实时回读来测量和优化延迟敏感系统。

功能
该技能提供优化和验证延迟敏感系统的说明,例如实时仪表盘、行情数据源、流式代理、执行网关、队列和缓存。它指导代理跟踪 p50/p95/p99 延迟、吞吐量、数据新鲜度、队列深度、缓存命中率、提供商响应时间和浏览器渲染时间,并绘制从源事件到用户可见状态的热路径。它还规定了优化顺序和针对已部署界面的实时回读检查,并给出防止用快速缓存命中掩盖过期数据或省略校验的防护规则。
适用场景
当 p95 延迟、吞吐量或数据新鲜度很重要时,或当用户关注实时行为、热路径、流式新鲜度或执行速度时使用。该技能以工程为重点,不授权实盘交易或提供财务建议。
运行要求
仅为说明文档,不附带脚本。需要具备文件和命令行工具的代理(Read、Write、Edit、Bash、Grep、Glob),并且在进行实时回读时需要访问已部署界面,例如 HTTP 端点、提供商状态、队列状态、边缘/缓存状态以及浏览器验证。

Latency Critical Systems

Use this skill when the user cares about realtime behavior, hot paths, streaming freshness, or execution speed. This includes HFT-like infrastructure, but the skill is engineering-focused. It does not authorize live trading or financial advice.

Split The Metrics

Do not collapse everything into "fast." Track:

  • p50, p95, and p99 latency;
  • throughput;
  • freshness age;
  • queue depth;
  • cache hit rate;
  • provider/API response time;
  • browser render time;
  • correctness under load;
  • failure and retry behavior.

Map The Hot Path

Write the path from user/event to final visible state:

text
source event -> provider API -> ingest worker -> queue -> cache -> edge route-> client stream -> browser render -> user-visible state

Then measure each segment separately.

Optimization Order

  1. Remove unnecessary round trips.
  2. Cache stable reads with freshness metadata.
  3. Batch small calls and writes.
  4. Move compute closer to the data or the user.
  5. Split hot and cold paths.
  6. Apply backpressure before queues grow unbounded.
  7. Use streaming only when it improves freshness or user experience.
  8. Add canaries for stale data, degraded providers, and bad cache state.

Verification

Use live readbacks when a deployed surface exists:

  • HTTP timing and response headers;
  • provider freshness timestamp;
  • queue or job state;
  • edge/cache state;
  • browser verification for actual UI freshness;
  • logs around retries and degraded mode.

For market-data or execution-adjacent paths, also verify orderbook age, VWAP assumptions, provider status, and kill-switch behavior before calling the path ready.

Guardrails

  • Do not optimize latency by dropping required validation.
  • Do not hide stale data behind fast cache hits.
  • Do not claim millisecond behavior from client labels without measurement.
  • Do not run live orders, destructive migrations, or customer-impacting deploys without an explicit approval gate.
  • Keep secrets and private payloads out of logs and benchmark artifacts.

来源与署名

来源:affaan-m/ecc位于skills/latency-critical-systems提交ef648e0

许可证: MIT

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架