Problem description
When you use the PutObject API to upload objects to Object Storage Service (OSS), the upload may fail in one of the following ways:
| Symptom | Object size | Error behavior |
|---|---|---|
| Upload is rejected | Greater than 5 GB | Request fails immediately |
| Upload times out with no response | Less than 5 GB | Request hangs and eventually times out |
Cause
Objects larger than 5 GB
The PutObject API has a maximum file size limit of 5 GB. Any attempt to upload an object that exceeds this limit is rejected.
Objects smaller than 5 GB that time out
When you upload a large object from an Elastic Compute Service (ECS) instance over the internal network, the maximum transmission unit (MTU) on the server may be too large. An oversized MTU value can cause network transmission issues that lead to timeouts.
Solution
Objects larger than 5 GB: Use multipart upload
For objects that exceed the 5 GB limit of PutObject, use multipart upload to split the object into smaller parts.
| Object size | Recommended upload method |
|---|---|
| Less than 5 GB (small objects) | Simple upload (PutObject) |
| Less than 5 GB (large objects with timeout issues) | Multipart upload or ossutil |
| Greater than 5 GB | Multipart upload or ossutil |
You can use the ossutil command line tool to perform multipart upload. The ossutil tool automatically splits a large object into multiple parts and uploads them. For more information, see Multipart upload and resumable upload.
Objects smaller than 5 GB: Adjust the MTU value
If uploads of large objects smaller than 5 GB time out, the MTU on the ECS instance may be too large. Perform the following steps to check and adjust the MTU value:
Step 1: Check the current MTU value
Run the following command on the ECS instance:
netstat -iThe default MTU for the internal and public network interface controllers is 1500.

Step 2: Resolve the issue
Use one of the following methods:
Method 1: Reduce the MTU value on the ECS instance Run the following command to set the MTU to 1470. This example assumes that the ECS instance accesses OSS over the internal network through
eth0:ip link set dev eth0 mtu 1470Method 2: Use multipart upload Use the multipart upload API or
ossutilto upload the object. Multipart upload splits the object into smaller parts, which avoids the timeout issue caused by MTU configuration.
Applies to
Object Storage Service (OSS)