How rails server on production works?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 20:38:42

问题


I wonder, in general is it more like PHP (it loads into memory, executes, and dies for each connect). Or it like Node.js (single instance stays in memory and accepts all requests)


回答1:


Technically it's the latter, but depending on the application server, it can be made to look like the former because the former is easier to manage. One example is Phusion Passenger. Take a look at https://www.phusionpassenger.com/ and http://www.modrails.com/documentation/Architectural%20overview.html




回答2:


Second option.

In fact it Ruby that boot the application (can have multiple instances depending of the case .i.e: using puma you can request multiple workers to handle requests) then as soon as ready (depending of the side of your application .i.e: if your routes.rb file where you build each URLs is huge, it will take more time of course) the application start to handle the requests.



来源:https://stackoverflow.com/questions/17706827/how-rails-server-on-production-works

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!