From 8f54fe9e99963d8721b9a7caea1b56a66dd55c13 Mon Sep 17 00:00:00 2001 From: leye Date: Mon, 13 Nov 2023 23:25:07 +0800 Subject: [PATCH] docs: add note about --workers option on deployment.md (#5272) --- site/docs/core/deployment.md | 2 ++ site/docs/core/deployment.zh-CN.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/site/docs/core/deployment.md b/site/docs/core/deployment.md index e811b7f8bc..a9ff392b5d 100644 --- a/site/docs/core/deployment.md +++ b/site/docs/core/deployment.md @@ -76,6 +76,8 @@ Options: More about [egg-scripts] and [egg-cluster] documents. +> Note: `--workers`, default to `process.env.EGG_WORKERS`, if unset, egg will use `os.cpus().length`. However, in the docker, the `os.cpus().length` may not be equal to the number of allocated cores, and the obtained value may be large, leading to startup failure. Then try to manually set `--workers`, see [#1431](https://github.com/eggjs/egg/issues/1431#issuecomment-573989059). + #### Dispatch with Arguments Arguments of dispatch can be configured in `config.{env}.js`. diff --git a/site/docs/core/deployment.zh-CN.md b/site/docs/core/deployment.zh-CN.md index 9df157aee0..f38e854368 100644 --- a/site/docs/core/deployment.zh-CN.md +++ b/site/docs/core/deployment.zh-CN.md @@ -77,6 +77,8 @@ $ egg-scripts start --port=7001 --daemon --title=egg-server-showcase 更多参数可查看 [egg-scripts] 和 [egg-cluster] 文档。 +> 注意:`--workers` 默认使用 `process.env.EGG_WORKERS`,或者 `os.cpus().length` 值进行设置,但在 docker 中 `os.cpus().length` 不一定等于分配的核数,获得的值可能较大,导致启动失败,需要手动设置下 `--workers`,参见 [#1431](https://github.com/eggjs/egg/issues/1431#issuecomment-573989059)。 + #### 启动配置项 你也可以在 `config.{env}.js` 中配置指定启动配置。