铁路上的ruby-产生大量机架应用的乘客
作者:互联网
乘客记忆状态的输出
----- Passenger processes -----
PID VMSize Private Name
-------------------------------
28572 207.4 MB ? Rack: /home/myapp/application
28580 207.0 MB ? Rack: /home/myapp/application
28588 206.0 MB ? Rack: /home/myapp/application
28648 206.5 MB ? Rack: /home/myapp/application
29005 23.0 MB ? PassengerWatchdog
29008 100.5 MB ? PassengerHelperAgent
29010 43.1 MB ? Passenger spawn server
29013 70.8 MB ? PassengerLoggingAgent
29053 202.0 MB ? Passenger ApplicationSpawner: /home/myapp/application
29105 202.3 MB ? Rack: /home/myapp/application
29114 202.3 MB ? Rack: /home/myapp/application
29121 202.3 MB ? Rack: /home/myapp/application
29130 202.3 MB ? Rack: /home/myapp/application
29138 202.3 MB ? Rack: /home/myapp/application
看起来好像产生了很多程序…这是一个正在开发中的应用程序,没有人(我知道)碰到过它…
乘客状态的输出
App root: /home/myapp/application
* PID: 29105 Sessions: 1 Processed: 0 Uptime: 15m 11s
* PID: 29114 Sessions: 1 Processed: 0 Uptime: 14m 0s
* PID: 29121 Sessions: 1 Processed: 0 Uptime: 14m 0s
* PID: 29130 Sessions: 1 Processed: 0 Uptime: 14m 0s
* PID: 29138 Sessions: 1 Processed: 0 Uptime: 14m 0s
首先,这正常吗?
第二,可能的原因?
解决方法:
对于任何遇到此问题的Rails挂起的人…如果您正在有限的内存VPS上运行,请检查并确保调整max_pool,以免产生过多的应用程序实例供您的系统处理.默认值为6,这显然对于内存不足的VPS来说太多了.
有关最大池设置的文档:
http://www.modrails.com/documentation/Users%20guide%20Nginx.html#PassengerMaxPoolSize
标签:nginx,passenger,rack,ruby,ruby-on-rails 来源: https://codeday.me/bug/20191201/2082252.html