jaeger-agent 流量降本

327 阅读1分钟

aws 跨可用区流量传输需要收费。

当你的应用流量 100 MB/S 的时候,每个月要消耗 5000 刀美元。

通过为 jaeger-agent 开启 zstd 压缩。

可以节省 80% 的费用。

agent 设计

agent 将数据缓存在内存中,通过 websocket 发送到 collector。

flush 条件:

  • time interval 到期。
  • buf 大小超过 maxBufferSize。

time interval 参数

time interval 影响:

  • compress ratio
  • 压缩消耗的 cpu
  • websocket 批量发送消耗的 cpu

image.png

压缩率,随 time interval 增长的并不明显。

根据之前的研究, websocket 发送所消耗的 cpu 跟批量大小影响不大。

image.png

为了降低压缩所消耗的 cpu, 将 time interval 设置为 1s。

maxBufferSize

记录当 time interval 为 1s 时。

uncompress bytes 的分位数。

p99 为 1MB, 因此将 max buffer size 设置为 4MB。

image.png