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.
User-created Dash apps and any attached workspaces or services consume memory (RAM) and CPU on the cluster nodes.
The Dash Enterprise Helm chart defines default memory and CPU requests and limits that are appropriate for most organizations. Under most circumstances, these defaults ensure that user-created resources and the cluster as a whole remain healthy.
Default requests and limits
| Memory request | Memory limit | CPU request | CPU limit | |
|---|---|---|---|---|
| Dash apps | 128 MiB | 8192 MiB | 100 millicores | None |
| Workspaces | 128 MiB | 8192 MiB | 200 millicores | None |
| Services | 128 MiB | 128 MiB | 100 millicores | None |
It is possible to override these defaults if they are not optimal for your infrastructure or business needs. This guide can help you rightsize memory and CPU for user-created resources.
When an app reaches its memory limit, Database Connections. 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.
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 replicas). 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.
To manage memory, you can:
If your organization has deployed apps with a variety of memory usage levels and the default memory limit (8192 MiB unless overridden) is not appropriate for all of them, consider setting custom memory limits. You can safely set custom memory limits directly from the Dash Enterprise App Manager.
If an app process has multiple role, the custom memory limit applies to each replica. It is not shared between replicas.
When you save a custom memory limit, the resource is restarted. In the case of a service, both the service and the workspace (if one is attached) are restarted.
Prerequisites:
admin Defining Variables for the Installation.To set a custom memory limit on an app process, workspace, or service:
You can override the default memory requests or limits by making a configuration change to Dash Enterprise and applying it with helm upgrade.
Caution: Helm does not perform any validation when you override the default memory requests or limits. Memory limits (including any custom memory limits) must always be equal or greater than memory requests. Applying default requests that are equal to limits may impact the capacity of the cluster. We strongly recommend being familiar with Resource Management for Pods and Containers before following the steps below.
Important: Changing the default memory request affects the minimum custom memory limit that can be applied via the App Manager.
Prerequisites:
RELEASE_NAME and NAMESPACE variables are defined according to Defining Variables for the Installation.To override the default memory requests or limits:
values-custom.yml.yaml
agents:
worker:
app:
# -- Default memory request for dash app containers (MiB)
defaultMemoryRequestMiB: 128
# -- Default memory limit for dash app containers (MiB)
defaultMemoryLimitMiB: 8192For workspaces:
yaml
agents:
worker:
workspace:
# -- Default memory request for workspace-editor container (MiB)
defaultMemoryRequestMiB: 128
# -- Default memory limit for workspace-editor container (MiB)
defaultMemoryLimitMiB: 8192
For Redis and Postgres managed database services:
yaml
agents:
worker:
service:
redis:
# -- Default memory request for per-app redis service (MiB)
defaultMemoryRequestMiB: 128
# -- Default memory limit for per-app redis service (MiB)
defaultMemoryLimitMiB: 128
postgresql:
# -- Default memory request for per-app postgresql service (MiB)
defaultMemoryRequestMiB: 128
# -- Default memory limit for per-app postgresql service (MiB)
defaultMemoryLimitMiB: 128
sh
helm upgrade $RELEASE_NAME -f values-custom.yaml \
--namespace $NAMESPACE \
--reset-then-reuse-values
changing the name of your custom values file if it’s different.
The --reset-then-reuse-values flag applies all the other configurations that were set during the original installation.
Updated default memory limits are applied to new and existing resources that do not have a custom memory limit.
You can override the default CPU requests or limits by making a configuration change to Dash Enterprise and applying it with helm upgrade.
Caution: Helm does not perform any validation when you override the default CPU requests or limits. CPU limits, when they exist, must always be equal or greater than CPU requests. We strongly recommend being familiar with Resource Management for Pods and Containers before following the steps below.
Prerequisites:
RELEASE_NAME and NAMESPACE variables are defined according to