更新时间:2024-10-17 GMT+08:00
OBS性能优化建议
OBS按照对象名的UTF-8编码范围来进行分区管理,对系统进行水平扩展与动态负载均衡。如果用户在对象命名规则上使用了顺序前缀(如时间戳或字母顺序),可能导致大量对象的请求访问集中于某个特定分区,造成访问热点。热点分区上的请求速率受限,访问时延上升。
推荐使用随机前缀对象名,这样请求就会均匀分布在多个分区,达到水平扩展的效果。
示例:
比如典型的日志归档场景,可能上传的对象名都是如下形式:
yourbucket/obslog/20190610-01.log.tar.gz yourbucket/obslog/20190610-02.log.tar.gz yourbucket/obslog/20190610-03.log.tar.gz yourbucket/obslog/20190610-04.log.tar.gz ... yourbucket/obslog/20190611-01.log.tar.gz yourbucket/obslog/20190611-02.log.tar.gz yourbucket/obslog/20190611-03.log.tar.gz yourbucket/obslog/20190611-04.log.tar.gz
建议为对象名添加3位以上16进制哈希前缀:
yourbucket/6ac-obslog/20140610-01.log.tar.gz yourbucket/b42-obslog/20140610-02.log.tar.gz yourbucket/17f-obslog/20140610-03.log.tar.gz yourbucket/ac9-obslog/20140610-04.log.tar.gz ... yourbucket/95d-obslog/20140611-01.log.tar.gz yourbucket/4a5-obslog/20140611-02.log.tar.gz yourbucket/ea2-obslog/20140611-03.log.tar.gz yourbucket/ba3-obslog/20140611-04.log.tar.gz