Memory Limits

This documentation is for Dash Enterprise.
Dash Enterprise is the fastest way to write & deploy Dash apps and
Jupyter notebooks.
10% of the Fortune 500 uses Dash Enterprise to productionize AI and
data science apps. Find out if your company is using Dash Enterprise.

Resources on Dash Enterprise like user-created Dash apps and workspaces consume memory on the cluster nodes.

Strategies for reducing Dash app memory usage

Here are a few strategies that Dash app developers can consider to reduce their apps’ memory usage.
* Using the --preload flag in their app’s Procfile. For example:
web: gunicorn app:server --workers 4 --preload

Do not use the --preload flag if shared database connection pools are used (see Database Connections). For more information on preloading, refer to the Gunicorn docs.
* Reducing the amount of workers defined in their app’s Procfile.
* Using a file type for their datasets that supports memory mapping, like Arrow, and reading it with libraries like Vaex.
* Performing data queries and aggregations within the query on a database layer instead of in memory with Python.

You can control the amount of memory that resources on Dash Enterprise can consume by managing memory limits. Managing memory limits is an administrator action and requires the admin role.

Managing Memory Limits

To manage memory limits, you can:

When an app reaches its memory limit, replicas. When a workspace reaches its memory limit (usually because the development app is running), the development app is stopped and killed is printed in the workspace terminal.

Changing the Default Memory Limit

Changing the default memory limit has no effect on app processes and workspaces that have custom memory limits.

To change the default memory limit:

  1. In the App Manager, go to Platform and Users. Remember that you need the admin role to be able to access platform and user information.
  2. In Memory Usage and Limits, select Edit Memory Limits.
  3. In Default Limits (GiB)s, enter the new default limit.
  4. Select Save.

New apps and workspaces will inherit the updated default memory limit. To apply the updated default limit to an existing app process that doesn’t have a custom limit, restart the process from the Overview tab in the App Info. To apply the updated default limit to an existing workspace that doesn’t have a custom limit, restart or rebuild the workspace from the Workspace tab in the App Info.

Setting a Custom Memory Limit for an App Process, Workspace, or Service

It’s good practice to set limits that are appropriate for each resource. If your organization has deployed apps with a variety of memory usage levels and the default memory limit is not appropriate for all of them, consider setting custom memory limits.

You can set custom memory limits for app processes, workspaces, and services to a maximum of 24,576 MiB, or 24 GiB.

If a process has multiple