云端数据管理#
在云端管理数据时有两个关注点:
- 内存使用:处理大量数据的复杂工作流可能会超出 n8n 的内存限制。如果发生这种情况,实例可能会崩溃并变得无法访问。
- 数据存储:根据您的执行设置和数量,您的 n8n 数据库可能会增长并耗尽存储空间。
为了避免这些问题,n8n 建议您在构建工作流时考虑内存效率,并且不要保存不必要的数据
Memory limits on each Cloud plan#
Current plans:
- Trial: 320MiB RAM, 10 millicore CPU burstable
- Starter: 320MiB RAM, 10 millicore CPU burstable
- Pro-1 (10k executions): 640MiB RAM, 20 millicore CPU burstable
- Pro-2 (50k executions): 1280MiB RAM, 80 millicore CPU burstable
- Enterprise: 4096MiB RAM, 80 millicore CPU burstable
Legacy plans:
- Start: 320MiB RAM, 10 millicore CPU burstable
- Power: 1280MiB RAM, 80 millicore CPU burstable
n8n gives each instance up to 100GB of data storage.
How to reduce memory consumption in your workflow#
The way you build workflows affects how much data they consume when executed. Although these guidelines aren't applicable to all cases, they provide a baseline of best practices to avoid exceeding instance memory.
- 将处理的数据拆分为更小的块。例如,不要在每次执行时获取10,000行数据,而是在每次执行时处理200行数据。
- 尽可能避免使用代码节点。
- 在处理大量数据时避免手动执行。
- 将工作流拆分为子工作流,并确保每个子工作流只向其父工作流返回有限的数据量。
将工作流拆分起初可能看起来有悖常理,因为这通常需要至少添加两个节点:用于将项目拆分为较小批次的循环处理项目节点和用于启动子工作流的执行工作流节点。
但是,只要您的子工作流对每个批次进行繁重的处理,然后只向主工作流返回一个小的结果集,这就会减少内存消耗。这是因为子工作流只在内存中保存当前批次的数据,之后内存就会再次释放。
Note that n8n itself consumes memory to run. On average, the software alone uses around 180MiB RAM.
Interactions with the UI also consume memory. Playing around with the workflow UI while it performs heavy executions could also push the memory capacity over the limit.
How to manage execution data on Cloud#
Execution data includes node data, parameters, variables, execution context, and binary data references. It's text-based.
Binary data is non-textual data that n8n can't represent as plain text. This is files and media such as images, documents, audio files, and videos. It's much larger than textual data.
If a workflow consumes a large amounts of data and is past testing stage, it's a good option to stop saving the successful executions.
There are two ways you can control how much execution data n8n stores in the database:
In the admin dashboard:
- From your workspace or editor, navigate to Admin Panel.
- Select Manage.
- In Executions to Save deselect the executions you don't want to log.
In your workflow settings:
- Select the Options
menu.
- Select Settings. n8n opens the Workflow settings modal.
- Change Save successful production executions to Do not save.
Cloud data pruning and out of memory incident prevention#
Automatic data pruning#
n8n automatically prunes execution logs after a certain time or once you reach the max storage limit, whichever comes first. The pruning always happens from oldest to newest and the limits depend on your Could plan:
- Start and Starter plans: max 2500 executions saved and 7 days execution log retention;
- Pro and Power plans: max 25000 executions saved and 30 days execution log retention;
- Enterprise plan: max 50000 executions saved and unlimited execution log retention time.
手动数据清理#
尽管有自动清理做法,更繁重的执行和用例可能会超出数据库容量。在这种情况下,n8n 将手动清理数据以保护实例稳定性。
- 如果实例达到 85% 磁盘容量,警报系统会警告 n8n。
- n8n 清理执行数据。n8n 通过运行实例备份(工作流、用户、凭证和执行数据)并在不包含执行数据的情况下恢复来完成此操作。
由于此过程中的人工步骤,警报系统并不完美。如果在下班后触发警告或数据消耗率很高,可能没有时间在剩余磁盘空间填满之前清理数据。
🚀 与作者交流

📚 教程 💡 案例 🔧 技巧

⚡ 快答 🎯 定制 🚀 支持