-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: add pm2 faq #370
doc: add pm2 faq #370
Conversation
@shaoshuai0102, thanks for your PR! By analyzing the history of the files in this pull request, we identified @gxcsoccer, @popomore and @atian25 to be potential reviewers. |
@@ -715,3 +715,5 @@ exports.apiClient = { | |||
- APIClient - 内部调用 ClusterClient 做数据同步,无需关心多进程模型,用户最终使用的模块。API 都通过此处暴露,支持同步和异步。 | |||
|
|||
有兴趣的同学可以看一下 [增强多进程研发模式](https://github.com/eggjs/egg/issues/322) 讨论过程。 | |||
|
|||
[为什么我们没有选择 PM2?](http://localhost:4000/zh-cn/faq.html#进程管理为什么没有选型-pm2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url 改一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改好了
c46a587
to
d28a075
Compare
Codecov Report
@@ Coverage Diff @@
## master #370 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 28 28
Lines 637 637
=====================================
Hits 637 637 Continue to review full report at Codecov.
|
docs/source/zh-cn/faq.md
Outdated
|
||
1. PM2 模块本身复杂度很高,出了问题很难排查。我们认为框架使用的工具复杂度不应该过高,而 PM2 自身的复杂度超越了大部分应用本身。 | ||
2. 没法做非常深的优化。 | ||
3. 切实的需求问题,一个进程里跑 leader,其他进程代理到 leader 这种模式,在企业级开发中对于减少远端连接,降低数据通信压力等都是切实的需求。特别当应用规模大到一定程度,这就会是刚需。egg 本身起源于蚂蚁金服和阿里,我们对标的起点就是大规模企业应用的构建,所以不能做 toy,要非常全面。通过 PM2 无法做到。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
写得好像 pm2 是玩具那样。。。好像不是这种感觉,不应该让 pm2 的使用者感觉我们在攻击他们。。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我去掉关键词 -_-! 不是本意 哈哈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
d28a075
to
e1a8fd7
Compare
docs/source/zh-cn/faq.md
Outdated
|
||
1. PM2 模块本身复杂度很高,出了问题很难排查。我们认为框架使用的工具复杂度不应该过高,而 PM2 自身的复杂度超越了大部分应用本身。 | ||
2. 没法做非常深的优化。 | ||
3. 切实的需求问题,一个进程里跑 leader,其他进程代理到 leader 这种模式,在企业级开发中对于减少远端连接,降低数据通信压力等都是切实的需求。特别当应用规模大到一定程度,这就会是刚需。egg 本身起源于蚂蚁金服和阿里,我们对标的起点就是大规模企业应用的构建,所以要非常全面。这些特性通过 PM2 很难做到。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方是指 cluster-client? link 过去?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好
增加一个如果想用 pm2 启动如何实现?这个应该也是很多人的选择。 |
2b401ef
to
68afc49
Compare
加好了 @dead-horse |
嗯,有没有必要用 pm2 启动 egg,如果想,该如何配置。 |
docs/source/faq.md
Outdated
// server.js | ||
const egg = require('egg'); | ||
|
||
const workers = Number(process.argv[2] || require('os').cpus().length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worker 没必要传吧
@@ -715,3 +715,5 @@ exports.apiClient = { | |||
- APIClient - 内部调用 ClusterClient 做数据同步,无需关心多进程模型,用户最终使用的模块。API 都通过此处暴露,支持同步和异步。 | |||
|
|||
有兴趣的同学可以看一下 [增强多进程研发模式](https://github.com/eggjs/egg/issues/322) 讨论过程。 | |||
|
|||
[为什么我们没有选择 PM2?](/zh-cn/faq.html#进程管理为什么没有选型-pm2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
链接还是有问题吧,直接链接到 md?
@@ -38,4 +38,4 @@ Community: | |||
Contributing: /contributing.html | |||
Resource: /resource.html | |||
# Member Guide: /member_guide.html | |||
# FAQ: /faq.html | |||
FAQ: /faq.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看看这个中文有翻译吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
啥意思
btw 说好的说英语呢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the yml config about language, we should translate it in Chinese
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/source/faq.md
Outdated
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
放到 en 下
docs/source/zh-cn/faq.md
Outdated
|
||
1. PM2 模块本身复杂度很高,出了问题很难排查。我们认为框架使用的工具复杂度不应该过高,而 PM2 自身的复杂度超越了大部分应用本身。 | ||
2. 没法做非常深的优化。 | ||
3. 切实的需求问题,一个进程里跑 leader,其他进程代理到 leader 这种模式([多进程模型](/zh-cn/advanced/cluster.html)),在企业级开发中对于减少远端连接,降低数据通信压力等都是切实的需求。特别当应用规模大到一定程度,这就会是刚需。egg 本身起源于蚂蚁金服和阿里,我们对标的起点就是大规模企业应用的构建,所以要非常全面。这些特性通过 PM2 很难做到。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一个进程里跑 leader,其他进程代理到 leader 这种模式
就说 egg 自带多进程模型,不用说的这么具体吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
链接也改下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里连接有什么问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use .md extension
docs/source/zh-cn/faq.md
Outdated
|
||
进程模型非常重要,会影响到开发模式,运行期间的深度优化等,我们认为可能由框架来控制比较合适。 | ||
|
||
## 如何使用 PM2 启动应用? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个还是接着上面的问题吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好
用 md 的链接,不要用发布后的
发自我的 iPhone
… 在 2017年2月13日,20:14,Shawn ***@***.***> 写道:
@shaoshuai0102 commented on this pull request.
In docs/source/zh-cn/faq.md:
> @@ -0,0 +1,35 @@
+title: 常见问题
+---
+
+如果下面的内容无法解决你的问题,请查看 [egg issues](https://github.com/eggjs/egg/issues)。
+
+## 进程管理为什么没有选型 PM2 ?
+
+1. PM2 模块本身复杂度很高,出了问题很难排查。我们认为框架使用的工具复杂度不应该过高,而 PM2 自身的复杂度超越了大部分应用本身。
+2. 没法做非常深的优化。
+3. 切实的需求问题,一个进程里跑 leader,其他进程代理到 leader 这种模式([多进程模型](/zh-cn/advanced/cluster.html)),在企业级开发中对于减少远端连接,降低数据通信压力等都是切实的需求。特别当应用规模大到一定程度,这就会是刚需。egg 本身起源于蚂蚁金服和阿里,我们对标的起点就是大规模企业应用的构建,所以要非常全面。这些特性通过 PM2 很难做到。
这里连接有什么问题
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
go on reviewing @popmore |
docs/source/en/faq.md
Outdated
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 (([Cluster](./advanced/cluster.md)), 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
define
is a bit better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't define the process management
Commit message should start with docs |
Closes #345
b56f05b
to
01dc2db
Compare
docs/source/en/faq.md
Outdated
|
||
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. | ||
|
||
__How to start application with PM2?__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use **
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**
and __
have a same meaning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but just use one style
Checklist
npm test
passesAffected core subsystem(s)
Description of change