Limits & Timeouts

To ensure stability and prevent resource exhaustion, the QueCloud API operates with default limits on file sizes and processing time. For most use cases, these defaults are sufficient. However, for applications that handle very large files (e.g., high-resolution video), you may need to override these limits on a per-request basis.

Why configure limits?

  • Cost Control: Prevent unexpectedly large files from causing high processing and storage costs.
  • Reliability: Set appropriate timeouts for assets fetched from slow external URLs.
  • Security: Protect against denial-of-service attacks that use excessively large files to exhaust resources.

Overriding Default Limits

You can provide a limits object in your sign or verify requests. Any values you provide will override the system defaults for that specific request.

{
  "asset": {
    "bucket": "your-bucket",
    "key": "large-video.mp4"
  },
  "manifest_json": "...",
  "limits": {
    "max_asset_size_bytes": 536870912,
    "stream_timeout_ms": 120000
  }
}

Configurable Parameters

  • max_asset_size_bytes: The maximum allowed size of the source asset in bytes. The request will fail if the file is larger than this value.
  • max_output_size_bytes: The maximum allowed size of the signed asset. This prevents manifests from unexpectedly bloating the file size.
  • max_stream_copy_bytes: A limit on the amount of data buffered in memory during processing.
  • stream_timeout_ms: The timeout in milliseconds for downloading an asset, particularly relevant when using URL Inputs from a slow source.

Finding the Right Limits

It's best practice to set the tightest limits possible for your use case. For example, if your application only handles user profile pictures under 5MB, set max_asset_size_bytes to 5242880 to reject unexpectedly large uploads early.