Cloudflare开发了Cache Transcoding系统,通过在Pingora架构中使用Zstandard压缩算法对缓存资产进行编码。1该系统在初期测试中将符合条件的资产压缩至原大小的三分之一,同时以较小的CPU成本换取数PB级缓存容量和跨数据中心带宽的显著节省。1
系统的转码对象为4KiB及以上的未压缩文本内容,包括HTML、JSON、CSS和JavaScript文件。1Cloudflare的测试表明,约71%的符合条件文本内容以未压缩形式到达,而在受控测试中这类资产的压缩比约为2.8倍。1使用Zstandard level 3压缩设置,额外的CPU开销保持在几个百分点以内。1测试覆盖了100多万请求,跨越10台缓存服务器。1
相比其他压缩方案,Zstandard在压缩速度上比Brotli快42%,生成的文件大小比gzip小11.3%。1图像、视频和字体虽然仅占请求数的21.4%,却占总字节数的63.3%,因此不在该系统的转码范围内。1缓存资产经过一次性编码后,在后续每次被重用时都能持续获得存储和带宽的收益。1
Cloudflare has developed a Cache Transcoding system that compresses cached assets using the Zstandard algorithm within its Pingora architecture, achieving significant reductions in storage and cross-datacenter bandwidth consumption.1 In initial testing, eligible assets were compressed to approximately one-third of their original size, delivering substantial capacity and bandwidth savings at minimal CPU cost.1
The system performs one-time encoding of qualifying text content—uncompressed HTML, JSON, CSS, and JavaScript files larger than 4 kilobytes—and continues to deliver storage and bandwidth benefits each time those assets are reused.1 Testing revealed that approximately 71 percent of eligible text content currently arrives in uncompressed form, and the compression ratio for qualifying assets in controlled tests reached roughly 2.8 times.1 By limiting transcoding to uncompressed text files of 4 kilobytes or larger, the system captures nearly all storage benefits while keeping additional CPU overhead to just a few percentage points using Zstandard level 3 compression.1
The evaluation covered more than one million requests across ten cache servers.1 Images, videos, and fonts—which represent 21.4 percent of requests but account for 63.3 percent of bytes—were excluded from transcoding.1 Zstandard itself demonstrates performance advantages, compressing 42 percent faster than Brotli while producing files 11.3 percent smaller than gzip.1
评论
还没有评论,欢迎留下第一条。