Passenger简介,,https://ww


https://www.phusionpassenger.com/docs/tutorials/what_is_passenger/


What is Passenger?

一个开源的web程序服务。它除了HTTP请求,管理进程和资源,能够administration, monitoring,并进行问题诊断。

技术分享图片

容易使用,让产品的部署变得容易和scalable(

if a piece of computer hardwareor software is scalable, it continues to work well even if it is made bigger or connected to a larger number of other pieces of equipment

)即使程序逐步变大仍然运行良好。

它支持多种编程语言,Ruby, Python, Node。

它也能同时服务多个程序。

技术分享图片

https://www.phusionpassenger.com/advantages (图文简介,很有趣,把自己比做航天器,功能强大,让passengers轻松使用)

Fundamental concepts

关于Ruby的。

Passenger and "rails server"

ROR框架提供一个内建的服务器工具, 让可以使用rails server命令。但"rails server"本身不是一个服务器程序,而是一个小的wrapper,在一个应付程序服务内,发射你的app。

这就是人们不使用"rails server"在production的原因。他们使用一个应用程序服务an application server,比如Passenger,直接地。

"rails server" usesPumaby default as of Rails 5.

如果你增加Passenger到你的Gemfile(点击看step by step), “rails server”会发射Passenger替代Puma。当然也可以直接选择launch Passenger 。

How Passenger fits in the stack

当不是web app到production, 有各种类型的组件be involved(参与)

你可能听说过Unicorn, Puma, Nginx, Apache and Capistrano.

Passenger当和其他组件合作时,会取代一些组件。Passenger replaces some components, while collaborating with other components.

In a typical production stack, one would use Nginx or Apache as the web server, Passenger as application server, and Capistrano as release automation tool. Passenger integrates with Nginx or Apache and manages the application and its resources.

在一个典型的产品堆,一个将使用Nginx/Apache作为web服务器, Passenger作为app服务器,Capistrano作为版本释放的自动化工具。Passenger集成了Nginx/Apache并管理app和它的resources.

技术分享图片

需要联合使用Nginx or Apache的原因:(2个)

web servers. 提供HTTP transaction 处理和服务静态的文件。

1.但是,它们不是Ruby app服务器,不能直接的跑Ruby app.

所以需要联合一个app 服务器,例如Passenger.

Application servers make it possible for Ruby apps to speak HTTP.

app服务器可以让Ruby apps来说HTTP。Ruby apps(如Rails)它们自身做不到这点。

2.另一方面,app server明显不能像Nginx/Apache那样高效的处理HTTP请求。

魔鬼在细节里:

Nginx/Apache更善于处理I/O安全, HTTP并发管理, 超时连接等等!!!

因此,在产品环境内,程序服务器app server和Nginx/Apache联合起来被使用。

Capistrano

一个应用程序 release automation tool! (释放版本的自动化工具)。

当释放一个你的web application的新版本时,会有actions需要被执行performed, 如uploading你的程序代码到服务器, 运行一条命令来安装你的gem bundle,重启进程等等。Capistrano会自动化这些actions.

Capistrano不能取代一个server来提供HTTP transaction handling, 所以它联合app servers和web servers。

Unicorn and Puma

可选的app servers。被Passenger代替了。

因为,Passenger让使用更方便,和其他组件集成,自动管理和问题诊断diagnosis.

Passenger简介

评论关闭