MEGA S4的Rclone设置指南

Rclone is a powerful command-line tool for managing files across cloud storage platforms. It supports backing up and encrypting files to the cloud, as well as restoring and decrypting them when needed. This guide walks you through setting up Rclone for use with MEGA S4.

Create a new bucket

  1. Click Object storage on the left-hand panel.
  2. Click Create bucket.
  3. Name the bucket.
  4. 点击创建

Set up your access keys

  1. Click Object storage on the left-hand panel.
  2. Click Keys on the left-hand panel.
  3. Click Create key.
  4. Name the key.
  5. Copy the Access key and Secret key.

  1. Download and install Rclone from the Rclone website.
  2. 打开命令行并执行命令rclone config开始安装程序。
  3. Enter n for new remote and enter a name, for example s4.
  4. 对于存储类型,选择兼容Amazon S3标准的存储提供商
  5. For provider, choose MEGA S4 Object Storage.
  6. 输入env_auth
  7. 选择在下一步中输入AWS凭证
  8. For access_key_id, enter the Access key you copied earlier.
  9. For secret_access_key, enter the Secret key you copied earlier.
  10. For endpoint, choose from the list provided or enter one of your choice.

标准配置现已完成,但应用程序会询问您是否要进入高级配置。

  1. Enter y to go to advanced configuration settings (see below).

  1. 输入n以完成配置。
  1. 输入y保存配置。
  2. 输入q退出设置。
  • s3-upload-cutoff(默认为200Mb)
    • --s3-upload-cutoff在指定的点上,Rclone从单部分上传切换到分段上传
  • s3-chunk-size(默认为5Mb)
    • 分段上传中使用的区块大小。默认最小限制为5Mb。
  • s3-force-path-style
    • 如果将此选项设置为ture,Rclone将使用路径样式代替虚拟托管风格。

Here’s how to verify that your Rclone remote (s4) is working correctly.

  1. Create a bucket.
    rclone mkdir s4:mybucket
  2. List your buckets.
    rclone lsf s4:
    • You should see mybucket in the output.
  3. Delete the empty bucket.
    rclone rmdir s4:mybucket
  4. Confirm the bucket is gone.
    rclone lsf s4:
    • No output means it was deleted successfully.
ActionCommandExample
Lists files and directorieslsfrclone lsf s4:bucketname or rclone lsf s4: for the top level
Lists objects in a bucket with sizeslsrclone ls s4:bucketname
Lists objects in a bucket with sizes and modification timestampslslrclone lsl s4:bucketname
Remove the empty directory at the pathsizerclone size s4:bucketname
Creates a bucketmkdirrclone mkdir s4:newbucketname
Remove the empty directory at pathrmdirrclone rmdir s4:bucketname
Remove the path and all of its contentspurgerclone purge s4:bucketname
Copies objects from source to destinationcopyrclone copy C:\MyFolder s4:bucketname
Copies objects from source to destinationmoverclone move C:\MyFolder s4:bucketname
Shows the current Rclone configurationShows the total size of the bucketrclone config show
Syncs the destination to match the source exactly. Can be local to cloud storage or cloud to cloudsyncrclone sync C:\MyFolder s4:bucketname\MyFolder

More commands and configuration options can be found on the Rclone website.

The following are settings you can try, depending on the type of objects you are using.

Large object uploads – e.g., 1GB and above

Use multipart uploads

  • Set --s3-upload-cutoff to a good size, so large objects always use MPU.
    • Try value of 64Mi–256Mi.
  • Larger --s3-chunk-size means fewer API requests and less overhead, but requires more RAM.
    • A good range is 64Mi, 128Mi, 256Mi.
  • Increase --s3-upload-concurrency – The number of parts uploaded in parallel per file. Higher values can hit diminishing returns or provider throttling.
    • A range of 4 – 32 can work well for most workloads.
  • Keep --transfers low when uploading large files. Performance scaling comes from --s3-upload-concurrency, not from file-level parallelism.
    • For multiple large files, increase --transfers only if a single file upload does not fully saturate your available bandwidth.
    • If one file already fills the link, increasing --transfers will not increase total throughput. It will only increase memory usage and may trigger provider throttling.

Small objects uploads (1KB to a few MB)

Prefer single PUT over multipart

  • Set --s3-upload-cutoff higher so most “small” files stay single PUT.
    • Try 256Mi–1Gi
    • Note: Rclone’s --s3-upload-cutoff max is 5 GiB.

Use high file parallelism:

  • --transfers (file uploads in parallel)
  • --checkers (listing/stat in parallel)
  • Due to API limitations, increasing --transfers beyond approximately 45 concurrent uploads will not improve throughput.
    • The practical maximum achievable rate is around 42–45 objects per second.
    • Because of this objects-per-second cap, it is always preferable to upload larger objects whenever possible. Larger objects are not negatively affected by this limit, while very small objects are.

Reduce validation checks

These flags reduce the number of API calls and checksum operations Rclone performs. They improve performance but reduce verification.

--s3-disable-checksum Disables MD5 calculation before upload. Reduces CPU usage and startup delay for large files, but removes stored checksum metadata.

--s3-no-head Skips the HEAD request after each upload. Reduces one API call per object and improves objects-per-second performance for small file workloads.

--fast-list Reduces the number of listing API calls when scanning large directory trees before upload. Improves performance for sync and copy of many files, but increases RAM usage.

--ignore-checksum Skips checksum validation when copying, moving, or syncing. Improves performance but relies on size and timestamp instead of hash validation. See note below on using this when files are copied to S4 from Mega Cloud drive.

      Rclone assumes files are uploaded using Rclone itself, so for objects smaller than the s3-upload-cutoff value, it verifies integrity using the ETag (MD5 hash).

      However, files uploaded via MEGA software don’t store the MD5 in the ETag, causing these downloads to fail checksum validation. To avoid this, use the --ignore-checksum flag when copying, moving, or syncing files.