You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Performance optimization
Best practices for optimizing performance
Copy page
Download PDF
Best practices for optimizing performance
This topic describes how to achieve high performance for applications with TOS implementations.​
Background information​
TOS is a distributed object storage product designed for scenarios involving massive data. To provide applications with a high level of service, TOS offers linear performance scalability and dynamic data load balancing. Data partitioning and indexing are based on the UTF-8 encoding of bucket name + object name. In sequential read/write mode, TOS limits QPS to 2,000. For more information about TOS constraints, see Limits.​
If you use sequential prefixes in your naming convention for objects (e.g., timestamps or alphabetical order), requests may concentrate on a specific shard. This creates hotspots. These hotspots are subject to the storage medium's read/write upper limits, which may increase access delays. You can apply the methods discussed in this topic to improve program performance.​
warning​
Performance optimization occurs gradually when reading or writing objects, rather than taking effect immediately. You may still encounter some errors after optimizing sequential prefixes, but these errors will disappear once the optimization is complete.​
Optimization methods​
To avoid the above-mentioned issues, we recommend that you consider the following optimizations when designing your application:​
Handling hotspots caused by adjacent objects​
  • Write data from different businesses to different buckets.​
  • ​
    bucket:log​
    object:​
    20220610-001.log.tar.gz​
    20220610-002.log.tar.gz​
    20220610-003.log.tar.gz​
    ......​
    20220610-0xx.log.tar.gz​
    ​
  • ​
    bucket:meta​
    object:​
    20220610-001.log.meta​
    20220610-002.log.meta​
    20220610-003.log.meta​
    ......​
    20220610-0xx.log.meta​
    ​
  • Store buckets with sequential prefixes in different buckets.​
  • If a bucket still has massive sequential objects, name them in the following ways.​
  • Add a random prefix. For example, calculate a hash of the object name, then use a segment of the hash value between two and ten characters long as the object's prefix.​
  • ​
    //Original​
    20220610-001.log.tar.gz//sha256:fa473ff003b91aa20239e20e41...​
    20220610-002.log.tar.gz//sha256:dba85a4f69850bd8b7ba6fbe79...​
    20220610-003.log.tar.gz//sha256:bd6665a44717e3bda18d12ea51...​
    ......​
    20220610-0xx.log.tar.gz//sha256:a70364eaa3ce1b037c5707b06e...​
    //After distribution ​
    fa473f-20220610-001.log.tar.gz​
    dba85a-20220610-002.log.tar.gz​
    bd6665-20220610-003.log.tar.gz​
    ......​
    a70364-20220610-0xx.log.tar.gz​
    ​
  • Reverse the sequential object prefix. For example, reverse the date in the object name.​
  • ​
    //Original​
    20220610-001.log.tar.gz​
    20220610-002.log.tar.gz​
    20220610-003.log.tar.gz​
    ......​
    20220610-0xx.log.tar.gz​
    //After reversion​
    100-01602202.log.tar.gz​
    200-01602202​
    300-01602202​
    ......​
    1xx-01602202​
    ​
Handling hotspots caused by the same object​
If your application sends many requests to the same object concurrently, the access speed will be subject to the TOS bandwidth and region restrictions. We recommend that you use Volcano Engine's Content Delivery Network (CDN) to improve performance while reducing your costs. For more information on accessing TOS through CDN, see Accelerating access to TOS resources using CDN.​
Addressing TOS server-side throttling​
TOS adopts server-side throttling so that all users can have a positive experience. For more information on TOS throttling, see Limits. The TOS throttling mechanism is explained below.​
  • List operations: TOS is a key-value storage service and provides list APIs for better O&M. However, we recommend that you not rely heavily on these APIs in your application. Particularly in scenarios involving frequent writes and paginated listing, your application will not be able to detect newly written or deleted objects from the previous page in real time, potentially leading to errors.​
  • Read and write operations: Even after implementing the anti-hotspot optimizations mentioned above, if you continue to frequently trigger TOS throttling, we recommend designing your application to avoid concurrent request peaks.​
tip​
When a throttling event occurs, TOS explicitly responds with a 429 status code. To avoid TOS throttling, we recommended that your application proactively implement back-off or rate limiting strategies. For back-off methods, see SDK documentation.​
Adjusting TOS server-side throttling limits​
If you are still not satisfied with your application's performance after applying the above optimizations, submit a ticket to request an increased throttling limit.​
Last updated: 2025.11.18 14:49:33