Dify Stack Presets
Heavy Python & Node Sandbox Preset for Workflow Code Nodes
Prevent SIGKILL OOM terminations inside dify-sandbox when workflows parse CSVs, run regex transforms, or compute financial aggregates.
520 - 1,400 MB Sandbox Cap · 30s Timeout · 16 GB KVM 4
Why Sandbox Containers Die Silently
Dify runs user-authored Python and JavaScript workflow code nodes inside an isolated sandbox container with strict seccomp and memory ceilings. Passing large JSON arrays from HTTP nodes into a 512 MB sandbox causes silent 137 OOM kills.
Right-Sizing Sandbox Limits
Raising the sandbox deploy limit to 1,536M on a 16 GB KVM 4 node and extending SANDBOX_WORKER_TIMEOUT to 30s eliminates mid-workflow failures.
Measured Thresholds & Container Limits
| Parameter | Light Default | Heavy Python/Node |
|---|---|---|
| Sandbox Container Limit | 512M | 1,536M - 2,048M |
| SANDBOX_WORKER_TIMEOUT | 15 seconds | 30 seconds |
| CODE_EXECUTION_READ_TIMEOUT | 30 seconds | 60 seconds |
| Concurrent Runs Safe Cap | 20 - 40 runs | 80 - 150 runs |