先决条件(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 使用其数据库来存储 凭据、过去的执行记录和工作流。
🌐 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 存储
- 在容器化的云环境中,确保在停止或启动容器时卷能够被持久化并挂载。否则,所有数据将丢失。
- 如果使用 Postgres,不要使用
tablePrefix配置选项。它将在不久的将来被废弃。 - 请注意新版本的变更日志,并在降级之前考虑回滚迁移。
- 至少设置基本的数据库安全性和稳定性机制,例如 IP 允许列表和备份。
内存注意事项(Memory considerations)#
n8n 实例通常不需要大量可用内存。例如,一个空闲的 n8n Cloud 实例大约需要 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.