Skip to content
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

pm2 状态问题 #3

Closed
wdfsinap opened this issue Apr 9, 2015 · 18 comments
Closed

pm2 状态问题 #3

wdfsinap opened this issue Apr 9, 2015 · 18 comments
Labels

Comments

@wdfsinap
Copy link

wdfsinap commented Apr 9, 2015

pm2 list下有个程序restarted状态里重启了很多次,这正常吗?
5

@keenwon
Copy link
Owner

keenwon commented Apr 9, 2015

id是3的这个是worker吗?你看看pm2 logs有什么错误信息没,还有log文件夹下也看看。
一般情况下,没报错的话,内存超过限制,也会重启的,尽量避免频繁重启。
如果你服务器内存足够的话,可以把内存限制调大,配置看这里 config.js:35

@wdfsinap
Copy link
Author

wdfsinap commented Apr 9, 2015

pm2 logs:
[female[1]-3 (out)] ##############################################################
[female[1]-3 (out)] #
[female[1]-3 (out)] # !!! MONGOOSE WARNING !!!
[female[1]-3 (out)] #
[female[1]-3 (out)] # This is an UNSTABLE release of Mongoose.
[female[1]-3 (out)] # Unstable releases are available for preview/testing only.
[female[1]-3 (out)] # DO NOT run this in production.
[female[1]-3 (out)] #
[female[1]-3 (out)] ##############################################################
[female[1]-3 (out)]
[female[1]-3 (out)] Warning: Redis server does not require a password, but a password was supplied.
[worker[3009]-14 (out)] '[bencode decode error] 81.163.27.232:1027'
[female[1]-3 (err)] FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory
[female[1]-3 (out)]
[female[1]-3 (out)] ##############################################################
[female[1]-3 (out)] #
[female[1]-3 (out)] # !!! MONGOOSE WARNING !!!
[female[1]-3 (out)] #
[female[1]-3 (out)] # This is an UNSTABLE release of Mongoose.
[female[1]-3 (out)] # Unstable releases are available for preview/testing only.
[female[1]-3 (out)] # DO NOT run this in production.
[female[1]-3 (out)] #
[female[1]-3 (out)] ##############################################################
[female[1]-3 (out)]
[female[1]-3 (out)] Warning: Redis server does not require a password, but a password was supplied.

有很多错误。我的内存是16G的。那内存限制调成100M?

@wdfsinap
Copy link
Author

wdfsinap commented Apr 9, 2015

本地log:
2015-04-09T16:56:50.593Z - error: [bencode decode error] 109.106.141.34:5285
2015-04-09T16:57:10.789Z - error: [bencode decode error] 77.163.226.136:6881
2015-04-09T16:57:45.202Z - error: [bencode decode error] 92.105.21.205:51413
2015-04-09T16:58:03.076Z - error: [bencode decode error] 109.106.141.34:5285
2015-04-09T17:00:21.122Z - error: [bencode decode error] 194.186.211.6:62835
2015-04-09T17:05:01.802Z - error: [bencode decode error] 77.253.228.83:6881
2015-04-09T17:05:02.220Z - error: [bencode decode error] 194.158.205.190:62323
2015-04-09T17:08:55.604Z - error: [bencode decode error] 39.78.55.30:1059
2015-04-09T17:09:15.488Z - error: [bencode decode error] 81.163.27.232:1027
2015-04-09T17:12:48.539Z - error: [bencode decode error] 5.40.23.4:6881

@keenwon
Copy link
Owner

keenwon commented Apr 9, 2015

我只看到一个内存溢出,其他的无关紧要,bencode decode error这个错误没影响,是种子文件有问题
默认的配置是运行在1G的机器上的,你是16G的话,可以把限制提高点
也可以运行更多的进程,这样效率更高

@wdfsinap
Copy link
Author

wdfsinap commented Apr 9, 2015

调大female及其它内存限制到120,增加了3个female 仍然female内存溢出,是不是要重启下female,如何重启?

@keenwon
Copy link
Owner

keenwon commented Apr 9, 2015

重启就是pm2 restart id
如果是female的话,你看下.temp下是不是有很大的种子文件,解析太大的文件会比较占内存
不过你内存16G那么多,可以再调大点

@wdfsinap
Copy link
Author

wdfsinap commented Apr 9, 2015

我感觉怎么不像是内存限制的问题,我都调大到8000了还是有出错

@wdfsinap
Copy link
Author

wdfsinap commented Apr 9, 2015

目前启动了11个worker, 1个male, 3个female,是不是male太少了?

@keenwon
Copy link
Owner

keenwon commented Apr 9, 2015

关于比例问题,规则参考这个

@wdfsinap
Copy link
Author

female内存调到10000,开了5个,基本没问题了。现在又出来worker内存不够。
还有个问题想问下你的elasticsearch现在还需要不每天手动更新下?能不能自动更新?

@keenwon
Copy link
Owner

keenwon commented Apr 10, 2015

可以自动更新的,但是最初的方法效率比较低,没有正真使用。

@wdfsinap
Copy link
Author

现在worker老是重启,提示内存不够。我都把内存限制提到1000了,怎么还这样?

@keenwon
Copy link
Owner

keenwon commented Apr 13, 2015

还真没遇到过worker经常重启的,有可能是你的内存不足,或则你的频率太高了,调整试试
整套的AntColony是要“调教”的,每个时间段的配比是不一样的。

@wdfsinap
Copy link
Author

还有个问题。搜索你为什么选择elasticsearch, 为什么不选择sphinx呢

@keenwon
Copy link
Owner

keenwon commented Apr 13, 2015

@wdfsinap 随便选的,你熟悉sphinx的话,也可以用

@wdfsinap
Copy link
Author

为毛mongodb能占用3.1G的内存?
6
开了21个worker,负载太大。

@keenwon
Copy link
Owner

keenwon commented Apr 14, 2015

正常的,mongodb本来就很占内存和硬盘,可以把数据库部在另一台机器上,这样影响小点。

@lock
Copy link

lock bot commented Dec 28, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants