ruby-on-rails - rails nginx passenger bundle How do these work together?
PHP中文网
PHP中文网 2017-05-16 17:30:23
0
2
826

I would like to ask how these people work and what parts they are responsible for

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
巴扎黑

Ngnix is ​​a proxy server. It sets the listening port (80), encoding method (gzip), where the error page is (402, 403, 404), and is responsible for assigning requests to workers
Passenger/Unicorn is the application server, sitting on the proxy server. Each proxy generally has several application servers as workers, which are responsible for accepting and sending requests to web applications (such as rails) at high speed. Generally, the application server can handle thousands of requests per second
Rails application runs inside passenger/unicorn.
From nginx to passenger to rails, a request cycle is completed

bundle is Ruby’s package manager. Just like python's easy_install, pypi. Each application can have a Gemfile, which can specify the version of the library you want, and then others can install the libraries required by this application by just bundle install

大家讲道理

Quoted from Luexiao.com Zhang Zhi’s answer: http://luexiao.com/questions/33136760...

Bundler is mainly used to handle the relationship between rails applications, while making the environment between each rails application independent of each other,
Before Bundler appeared, gemsets were mostly used to manage gem packages. After Bundler appeared, it was used by many rails developers because of its ease of use and convenience. Nowadays, the more common method is to use Bundler to manage gem packages and rvm to manage ruby ​​versions. .

Nginx ("engine

location /gridfs/ {
gridfs my_app field=filename type=string;
mongo 127.0.0.1:27017;
}
passenger is mainly used to manage Rails processes, but I don’t have much contact with passenger. I usually use Unicorn.

About process and collaboration:

Quoted from Github

nginx sends requests directly to the Unicorn worker pool over a Unix Domain Socket (or TCP, if you prefer). The Unicorn master manages the workers while the OS handles balancing, which we'll talk about in a second. The master itself never sees any requests.
For performance analysis of the two, please see Mongrel vs. Passenger vs. Unicorn

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template