diff --git a/docs/source/_data/guide_toc.yml b/docs/source/_data/guide_toc.yml index 38b3023d43..fd36df8d7d 100644 --- a/docs/source/_data/guide_toc.yml +++ b/docs/source/_data/guide_toc.yml @@ -38,4 +38,4 @@ Community: Contributing: /contributing.html Resource: /resource.html # Member Guide: /member_guide.html - # FAQ: /faq.html + FAQ: /faq.html diff --git a/docs/source/faq.md b/docs/source/faq.md index a710288575..f43f0be4b8 100644 --- a/docs/source/faq.md +++ b/docs/source/faq.md @@ -1,6 +1,13 @@ title: FAQ --- -# FAQ - If you have questions that is not contained below, please check [egg issues](https://github.com/eggjs/egg/issues). + +## Why not choose PM2 as process management tool? + +1. PM2 itself is too complex to issue problems if any. +2. Deep optimization could be difficlut to achieve if choosing PM2. +3. Pattern like one leader process communicating with remote services, along with serveral follower processes delegating request to it, is a rigid demand for reducing connections and data exchange load, espeically when facing applications in very large scale. egg originates from Ant Financial Group and Alibaba Group, we start with applications in that scale at first, so we take these goals into consideration. All of these goals above could be hard to achieve with PM2. + +Process management is very important. It defines the way we write code, meanwhile relates to deep runtime optimization. So we think it's better defined by framework itself. + diff --git a/docs/source/zh-cn/advanced/cluster.md b/docs/source/zh-cn/advanced/cluster.md index b90f8a2ace..b79c6a5cb0 100644 --- a/docs/source/zh-cn/advanced/cluster.md +++ b/docs/source/zh-cn/advanced/cluster.md @@ -715,3 +715,5 @@ exports.apiClient = { - APIClient - 内部调用 ClusterClient 做数据同步,无需关心多进程模型,用户最终使用的模块。API 都通过此处暴露,支持同步和异步。 有兴趣的同学可以看一下 [增强多进程研发模式](https://github.com/eggjs/egg/issues/322) 讨论过程。 + +[为什么我们没有选择 PM2?](/zh-cn/faq.html#进程管理为什么没有选型-pm2) diff --git a/docs/source/zh-cn/faq.md b/docs/source/zh-cn/faq.md new file mode 100644 index 0000000000..eca5b67739 --- /dev/null +++ b/docs/source/zh-cn/faq.md @@ -0,0 +1,16 @@ +title: 常见问题 +--- + +如果下面的内容无法解决你的问题,请查看 [egg issues](https://github.com/eggjs/egg/issues)。 + +## 进程管理为什么没有选型 PM2 ? + +1. PM2 模块本身复杂度很高,出了问题很难排查。我们认为框架使用的工具复杂度不应该过高,而 PM2 自身的复杂度超越了大部分应用本身。 +2. 没法做非常深的优化。 +3. 切实的需求问题,一个进程里跑 leader,其他进程代理到 leader 这种模式,在企业级开发中对于减少远端连接,降低数据通信压力等都是切实的需求。特别当应用规模大到一定程度,这就会是刚需。egg 本身起源于蚂蚁金服和阿里,我们对标的起点就是大规模企业应用的构建,所以不能做 toy,要非常全面。通过 PM2 无法做到。 + +进程模型非常重要,会影响到开发模式,运行期间的深度优化等,我们认为可能由框架来控制比较合适。 + + + +