先决条件#
¥Prerequisites
Feature availability
Embed requires an embed license. For more information about when to use Embed, as well as costs and licensing processes, refer to Embed on the n8n website.
此处提供的需求示例基于 n8n Cloud,仅供参考。你的要求可能因用户数量、工作流和执行次数而异。如需了解更多信息,请联系 n8n。
¥The requirements provided here are an example based on n8n Cloud and are for illustrative purposes only. Your requirements may vary depending on the number of users, workflows, and executions. Contact n8n for more information.
| 组件 | 大小调整 | 支持 |
|---|---|---|
| CPU/vCPU | 最低 10 个 CPU 周期,可根据需要扩展 | 任何公有云或私有云 |
| 数据库 | 512 MB - 4 GB SSD | SQLite 或 PostgreSQL |
| 内存 | 320 MB - 2 GB |
CPU 注意事项#
¥CPU considerations
n8n 对 CPU 的要求不高,因此即使是小型实例(例如 AWS 和 GCP 等提供商的实例)也足以满足大多数使用场景。通常,内存需求高于 CPU 需求,因此在规划基础架构时,应将资源集中用于内存。
¥n8n isn't CPU intensive so even small instances (of providers such as AWS and GCP) should be enough for most use cases. Usually, memory requirements supersede CPU requirements, so focus resources there when planning your infrastructure.
数据库注意事项#
¥Database considerations
n8n 使用其数据库存储 credentials、历史执行记录和工作流。
¥n8n uses its database to store credentials, past executions, and workflows.
n8n 的一个核心特性是数据库选择的灵活性。所有支持的数据库各有优缺点,你需要根据自身需求逐一考虑并选择最合适的数据库。默认情况下,如果给定位置不存在数据库,n8n 会创建一个 SQLite 数据库。
¥A core feature of n8n is the flexibility to choose a database. All the supported databases have different advantages and disadvantages, which you have to consider individually and pick the one that best suits your needs. By default n8n creates an SQLite database if no database exists at the given location.
n8n 建议每个 n8n 实例都使用专用数据库。这有助于防止依赖和潜在的性能下降。如果无法为每个 n8n 实例提供专用数据库,n8n 建议使用 Postgres 的 schema 功能。
¥n8n recommends that every n8n instance have a dedicated database. This helps to prevent dependencies and potential performance degradation. If it isn't possible to provide a dedicated database for every n8n instance, n8n recommends making use of Postgres's schema feature.
对于 Postgres,数据库必须已存在于数据库实例上。n8n 进程的数据库用户需要对其使用或创建的所有表拥有完全权限。n8n 创建并维护数据库架构。
¥For Postgres, the database must already exist on the DB-instance. The database user for the n8n process needs to have full permissions on all tables that they're using or creating. n8n creates and maintains the database schema.
最佳实践#
¥Best practices
- SSD 存储
¥SSD storage.
- 在容器化云环境中,请确保在停止/启动容器时卷已持久化并挂载。否则,所有数据将丢失。
¥In containerized cloud environments, ensure that the volume is persisted and mounted when stopping/starting a container. If not, all data is lost.
- 如果使用 Postgres,请勿使用
tablePrefix配置选项。它将在不久的将来被弃用。
¥If using Postgres, don't use the tablePrefix configuration option. It will be deprecated in the near future.
- 请注意新版本的变更日志,并在降级之前考虑回滚迁移。
¥Pay attention to the changelog of new versions and consider reverting migrations before downgrading.
- 至少设置基本的数据库安全性和稳定性机制,例如 IP 允许列表和备份。
¥Set up at least the basic database security and stability mechanisms such as IP allow lists and backups.
内存注意事项#
¥Memory considerations
n8n 实例通常不需要大量的可用内存。例如,一个空闲的 n8n 云实例需要约 100MB 内存。工作流的性质和正在处理的数据决定了你的内存需求。
¥An n8n instance doesn't typically require large amounts of available memory. For example an n8n Cloud instance at idle requires ~100MB. It's the nature of your workflows and the data being processed that determines your memory requirements.
例如,大多数节点只是将数据传递给工作流中的下一个节点,而 代码节点 会创建数据的预处理副本和后处理副本。处理大型二进制文件时,可能会耗尽所有可用资源。
¥For example, while most nodes just pass data to the next node in the workflow, the Code node creates a pre-processing and post-processing copy of the data. When dealing will large binary files, this can consume all available resources.