Skip to content
Saleor
Esc
↑↓navigate↵open⌘Jpreview
On this page

Usage Limits

Saleor limits how many requests you can send, how large a single request can be, and which files you can upload. This page lists the values in Saleor Cloud. A self-hosted Saleor sets these limits with environment variables.

Rate limits

Saleor Cloud sandboxes are limited to 120 requests/minute on the free plan and 2,000 requests/minute on paid plans. The limit is applied to all API requests, including GraphQL and Storefront API and is calculated for the entire environment, not per individual IP address. You will receive a HTTP 429 response code if you exceed the limit. The limit resets every 60 seconds and is not a moving window.

Saleor Cloud production environments and on-premise deployments have no rate limiting in place for the API.

Request limits

Limit Value
Operations in one batched request 10
Mutations in one operation 10
Aliases in one operation 550
Request duration 30 seconds

A request over any of the first three limits is rejected with HTTP 400 and is not executed. The error message names the limit, for example Number of batch queries exceeded. or Number of aliases exceed the limit of 550.

Query cost

The GraphQL API calculates the number of requested objects to determine the cost of a query. The cost is calculated based on the number of objects requested, not the number of objects returned. For example, a query that requests 10 products will cost the same even if there are only 5 products in the database.

Certain fields may impose an additional cost. For example, fields that return unfiltered lists of objects and fields that can return large JSON structures.

Saleor will refuse to execute queries that exceed the maximum cost allowed by the server.

You can find the cost of each query and the maximum cost allowed by the server in the extensions.cost field of the response.

{
  "data": {
    // ...
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 5,
      "maximumAvailable": 50000
    }
  }
}

Example: Query cost calculation

The cost breakdown for the following GraphQL query is as follows:

  • Number of products fetched (products.first): 10
  • Attributes cost: 10 (products.first) × 100 (complexity factor) = 1,000
  • Variants cost: 10 (products.first) × 100 (complexity factor) = 1,000

Total cost:

10 (base cost for 10 products)
+ 10 (attributes): 10 (`products.first`) × 1
+ 10 (variants): 10 (`products.first`) × 1
= 30
{
  products(first: 10, channel: "default-channel") {
    edges {
      node {
        attributes {
          __typename
        }
        variants {
          id
        }
      }
    }
  }
}

Individual field limits

Fields that use pagination (first/last/before/after) are limited to 100 items per page. See pagination for details on how to paginate through results.

File uploads

Image size

Environment Maximum image size
Sandbox 30 MB
Production 100 MB

The limit applies to image upload mutations such as productMediaCreate, categoryCreate, collectionCreate, and userAvatarUpdate. A larger image is rejected with the FILE_SIZE_LIMIT_EXCEEDED error code.

File types

Mutations that accept any file, such as fileUpload and digitalContentCreate, accept only an allowed list of file types. Saleor Cloud also accepts PDF files (.pdf).

Last updated on

Was this page helpful?