You cannot upload large objects by using simple Upload (PutObject)

Updated at:

Simple upload (PutObject) has a 5 GB per-object limit. Uploads that exceed this limit fail immediately. Uploads under 5 GB may also time out if the network interface controller (NIC) MTU is misconfigured.

Symptoms

  • Uploading a file larger than 5 GB fails immediately.

  • Uploading a file smaller than 5 GB times out with no response, even though smaller uploads succeed under normal conditions.

Cause 1: File size exceeds 5 GB

  • Simple upload (PutObject) supports objects up to 5 GB. Files larger than this limit cannot be uploaded using a single PutObject request.

Solution 1: Use multipart upload

Use multipart upload to split the object into smaller parts and upload them in parallel. Multipart upload supports objects larger than 5 GB and improves throughput and resilience to network errors, making it the preferred approach for large uploads.

Use the ossutil command line tool to split a large file into parts and upload them using the multipart upload API. For details on multipart upload and resumable upload operations, see Multipart upload and resumable upload.

Cause 2: NIC MTU causes upload timeouts

  • When a file is smaller than 5 GB but uploads consistently time out, the MTU (Maximum Transmission Unit) of the ECS instance's NIC may be set too high for the network path to OSS.

Solution 2: Adjust the MTU or switch to multipart upload

  1. Check the current MTU of each network interface on your ECS instance by running the following command:

    netstat -i

    The default MTU for both intranet and internet network interfaces is 1500.

    mtu

  2. Use one of the following methods to resolve the timeout:

    • Method 1: Lower the MTU on the ECS instance. Run the following command on a Linux ECS instance to set the MTU of the eth0 interface to 1470 (the recommended value for intranet access to OSS):

      ip link set dev eth0 mtu 1470
    • Method 2: Switch to multipart upload or ossutil. Multipart upload sends smaller individual requests, which avoids the packet fragmentation that causes timeouts on high-MTU interfaces. Use the multipart upload API or ossutil to upload the file.

Application scope

  • Object Storage Service (OSS)