我正在使用Passenger和Nginx在Centos 6.5服务器上运行Rails应用程序。如何在不停止的情况下检查它正在运行的环境?
最佳答案
使用passenger-status
命令。例如,这表明我的乘客正在运行production
环境(Application groups
标题下的第一行):
(production-web) ubuntu@ip-10-0-3-146 ~% sudo passenger-status
Version : 5.0.15
Date : 2015-08-20 17:40:24 +0000
Instance: lNNFwV1C (Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.0.15)
----------- General information -----------
Max pool size : 12
App groups : 1
Processes : 6
Requests in top-level queue : 0
----------- Application groups -----------
/home/my-app/deploy/current (production):
App root: /home/my-app/deploy/current
Requests in queue: 0
* PID: 11123 Sessions: 0 Processed: 12997 Uptime: 21h 14m 2s
CPU: 0% Memory : 190M Last used: 1s ago
* PID: 11130 Sessions: 0 Processed: 140 Uptime: 21h 14m 2s
CPU: 0% Memory : 153M Last used: 9m 32s a
* PID: 11137 Sessions: 0 Processed: 15 Uptime: 21h 14m 2s
CPU: 0% Memory : 103M Last used: 57m 54s
* PID: 11146 Sessions: 0 Processed: 6 Uptime: 21h 14m 2s
CPU: 0% Memory : 101M Last used: 7h 47m 4
* PID: 11153 Sessions: 0 Processed: 5 Uptime: 21h 14m 1s
CPU: 0% Memory : 100M Last used: 8h 42m 3
* PID: 11160 Sessions: 0 Processed: 2 Uptime: 21h 14m 1s
CPU: 0% Memory : 81M Last used: 8h 42m 3
rails控制台不可靠-它仅告诉您控制台在什么环境下运行。乘客可以配置为在不同的环境中奔跑。
关于ruby-on-rails - 如何在运行时检查我的Rails应用程序是否在开发环境或生产环境中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32075266/