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--preloadflag in their app’sProcfile. For example:
web: gunicorn app:server --workers 4 --preloadDo not use the
--preloadflag if shared database connection pools are used (see Database Connections). For more information on preloading, refer to the Gunicorn docs.
* Reducing the amount ofworkersdefined in their app’sProcfile.
* 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.
To manage memory limits, you can:
Known limitation: Services don’t inherit the default memory limit.
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 has no effect on app processes and workspaces that have custom memory limits.
To change the default memory limit:
admin role to be able to access platform and user information.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.
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