Phusion white papers Phusion overview

Phusion Passenger 3.0.0 public beta 1 is out!

By Hongli Lai on September 15th, 2010

Phusion Passenger is software with which one can deploy Ruby web applications on the Apache or Nginx web server. Now, with the release of version 3.0.0 beta 1, it also comes with a standalone version that does not require an external web server. Please read http://www.modrails.com/ for details.

In the past period we’ve blogged extensively about the progress of Phusion Passenger 3. Many exciting changes have been introduced. It’s been a long ride, but today we are happy to announce the first Phusion Passenger 3 public beta! We’ve already tested Phusion Passenger 3 extensively in private, and now we’re giving the community a chance to test it as well in order to make the final release rock-solid.

We’ve received a lot of emails from people who are excited about Phusion Passenger 3. Thank you all for your support!

To recap, we’ve described Phusion Passenger 3 extensively in our past Technology Preview articles:

Except for mass deployment, all features described in the technology previews are available as open source in Phusion Passenger 3. A few more changes have been made since the last Technology Preview:

The ‘PassengerPreStart’ option
In Technology Preview 4 we described PassengerMinInstances. That option ensures that, at least x instances will be kept around once they’ve been spawned, but it does not ensure that instances are immediately spawned up during web server start. Instead we have a separate configuration option for that, called PassengerPreStart. PassengerPreStart and PassengerMinInstances and the reason why they’re separate configuration options are described extensively in the manual.
RVM support
RVM is becoming more and more popular. Previous versions of Phusion Passenger work fine with RVM, but one has to follow special installation instructions for it to work properly. We’ve noticed that many users are not aware of this and as a result couldn’t get Phusion Passenger working properly with RVM. In Phusion Passenger 3 we’ve collaborated with Wayne E. Seguin and added special support for RVM so that everything should work out-of-the-box, without special installation instructions.

Other minor changes

For completeness, here are a list of minor changes that have not been described in the Technology Previews so far:

  • Nginx is now compiled with SSL support by default.
  • Nginx can now be compiled on a noexec /tmp filesystem. Fixes bug #380.
  • Support for Nginx 0.8.
  • Dropped support for Nginx 0.6.
  • Much better Ruby 1.9.2 support. Our unit test suite has been refactored; Ruby 1.9.2 passes our unit test suite 100%.
  • The PassengerFriendlyErrorPages option has been added. This allows you to turn off the friendly error pages that Phusion Passenger normally displays in the event of an error, so that only a standard 500 error page is shown. This is documented in the manual.
  • The PassengerDebugLogFile option has been added. This is documented in the manual.
  • User switching support has been made more flexible through the PassengerUser, PassengerGroup, PassengerDefaultUser and PassengerDefaultGroup options. These are documented in the manual.
  • RailsSpawnMethod has been renamed to PassengerSpawnMethod because we now support smart spawning for Rack apps as well.
  • passenger-install-apache2-module and passenger-install-nginx-module can now be run concurrently without the one deleting files compiled by the other.
  • #at_exit blocks are now called during application process shutdown.
  • passenger-install-apache2-module now supports a –snippet option. When this option is given, the command outputs the Apache configuration snippet that should be pasted, but doesn’t do anything else.
  • Temporary files that Phusion Passenger places in /tmp are touched every 6 hours. This prevents /tmp cleaner daemons that are present on many systems from deleting these temp files that are essential for Phusion Passenger’s functioning. Bug #365.

Install

Installation is almost the same as Phusion Passenger 2. Type:

gem install passenger --pre

If you want to install the Apache or Nginx version, then run the installer as you’re used to:

passenger-install-apache2-module
passenger-install-nginx-module

Or you can download the tarball.

If you want to run Phusion Passenger Standalone, then run:

cd /path-to-your-app
passenger start

The documentation

Users guide for Apache
Users guide for Nginx
Users guide for Standalone

Things to come

Although Phusion Passenger 3.0 brings many exciting improvements, it is only the beginning. In parallel to Phusion Passenger 3, we have been working on some interesting things which we plan to reveal to the world shortly after the release of Phusion Passenger 3.0. Please stay tuned for future developments.

  • http://www.site5.com Justin Mazzi

    Hey,

    The documentation linked in this post is 404 not found.

  • http://railsgeek.com mikhailov

    you are rock, guys!

  • http://www.maach.eu Rachid Al Maach

    Great news!

  • http://qmx.me qmx

    Awesome

    (btw, the documentation links are broken here)

  • http://unfiniti.com Remear

    Thanks a bunch!

    Will 3.0 allow for different rubies for apps on the same server?

  • Felipe Coury

    Awesome guys! Do you have any plans for Env vars, ala Apache’s SetEnv? I read on the mailing list it was planned for Passenger 3…

  • http://www.eet.nu/ Tom-Eric

    This is awesome.

    A question about the rvm support: I assume this only works for gemsets, and not different ruby versions, am I correct in this assumption?

  • http://readness.com/ Lee Mallabone

    This is great news! Just tried passenger standalone on my mac and it works great.

    I’ve found a small buglet: passenger standalone doesn’t echo any STDERR output to the console. My app uses a StdErrOutputter from log4r that helps me see the log output in development mode without having to explicitly tail the logs.

    But STDERR seems to be ignored when running under passenger standalone.

    Great work all around on passenger, can’t wait for the 3.0 stable release!

    Regards,
    Lee.

  • http://26am.com Josh

    Been staring at your RSS feed every morning waiting for this announcement. Thanks!

  • Paul Bowsher

    I was initially going to ask about rvm multi-ruby support, but I guess one way around this now is to use a passenger standalone and bind it to a socket, then use nginx normally to proxy onto the standalone instance. A LOT less nginx configuration as you can hand off the entire request to the standalone instance and not worry about different asset rules.

  • Mark Mulder

    Great stuff! However I can’t find PassengerDebugLogFile described in the manual anywhere…

  • http://tastyrails.com Josh Delsman

    Huzzah! Testing it out now on my less important Rails 3 apps ;)

  • Pingback: Phusion Passenger 3.0.0 public beta 1 is out! – Phusion Corporate Blog — News Tweets Gone Viral()

  • http://wilker-dev.com Wilker

    I can’t make the Mass Deploy feature to work, its already working on this preview? Someone else tried it and worked?

  • http://www.phusion.nl/ Ninh Bui

    @Wilker:
    “Except for mass deployment, all features described in the technology previews are available as open source in Phusion Passenger 3.”

  • http://www.phusion.nl/ Hongli Lai

    @Justin Mazzi: Race condition. We were uploading the docs back then and you were faster than our rsync. Should work now. :)

    @Felipe Coury: SetEnv on Apache should have worked since 2.2.

    @Lee Mallabone: STDERR should work. Please feel free to file a bug if it doesn’t work for you.

    @Tom-Eric: it locks into whatever RVM Ruby and gemset you were using during install time.

    @Remear: yes, see comment by Paul Bowsher. We do have plans to have it seamlessly integrated into the Apache and Nginx version as well for a future release.

    @Mark Mulder: It’s there. http://www.modrails.com/documentation/Users%20guide%20Apache%203.0.html#_passengerdebuglogfile_lt_filename_gt

  • http://webbynode.com Felipe Coury

    @Hongli I know :-), I was talking about general support for env vars per v-host, regardless of which webserver you’re using (nginx OR apache).

    I am talking about this thread:

    http://groups.google.com/group/phusion-passenger/browse_thread/thread/216040342e546e90/4112bc3f3e62fe25?lnk=gst&q=env+vars#4112bc3f3e62fe25

  • http://handsliced.com Jeff Poulton

    I’m so used to creating vhosts on my dev machine. It will be a breath of fresh air to simply start an app from Rails.root and know that I’m not snuggling with webrick ;-)

  • http://springenwerk.com Johannes Fahrenkrug

    Mr. Hernandez would be proud. Awesome work, guys, thank you very much! I’ll give it a spin on Solaris soon.

    – Johannes

  • adam

    Just exited to try it but I’m experiencing an installation problem under centos5.5 (http://groups.google.com/group/phusion-passenger/browse_thread/thread/163dff6d1fa50e90)

  • http://youngbloods.org Carl Youngblood

    Hongli, RE rvm, I assume you are talking about the RVM ruby and gemset that was active when _passenger_ was installed, right? Have you considered/it is possible to allow some kind of per-app setting for which RVM ruby/gemset to use?

  • http://www.phusion.nl/ Hongli Lai

    @Carl Youngblood: Yes when Passenger was installed, though only for Passenger-Apache and Passenger-Nginx. Passenger Standalone uses the RVM Ruby and gemset that’s currently active in the shell.

    Per-app setting is planned for the future. For now you can also do it by running multiple Passenger Standalone instances, each with its own Ruby interpreter.

  • http://www.herminiotorres.com Herminio Torres

    i’m using now passenger 3 in my project, when i’m using passenger start, put in my bash one error.

    Installing Phusion Passenger Standalone…
    [******************************* ] Compiling Phusion Passenger…
    *** ERROR: the following command failed:
    mkdir -p ‘ext/phusion_passenger/ruby-1.9.2-i686-linux’
    cd ‘ext/phusion_passenger/ruby-1.9.2-i686-linux’ && /home/herminio/.rvm/rubies/ruby-1.9.2-rc2/bin/ruby ‘/home/herminio/Área de Trabalho/rubylearning/rails_projects/sample_app/passenger-standalone/3.0.0.pre1-i686-ruby1.9.2-linux-gcc4.4.3-1002/support/ext/phusion_passenger/extconf.rb’
    checking for alloca.h… *** /home/herminio/Área de Trabalho/rubylearning/rails_projects/sample_app/passenger-standalone/3.0.0.pre1-i686-ruby1.9.2-linux-gcc4.4.3-1002/support/ext/phusion_passenger/extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers. Check the mkmf.log file for more
    details. You may need configuration options.

  • http://www.phusion.nl/ Hongli Lai

    @Herminio: Maybe it’s the space in your path. Try it in a path without spaces.

  • http://fixieconsulting.com Joe Van Dyk

    Your bug links for 365 and 380 are transposed.

  • John Bachir

    Wow, so great!

    (btw– you got the references to the two tickets mixed up)

  • http://www.herminiotorres.com Herminio Torres

    look

    Installing Phusion Passenger Standalone…
    [******************************** ] Preparing Nginx… \
    checking for OS
    + Linux 2.6.32-21-generic i686
    checking for C compiler … found but is not working

    ./configure: error: C compiler gcc is not found

    *** ERROR: command failed: sh ./configure ‘–prefix=/home/herminio/.passenger/standalone/3.0.0.pre1-i686-ruby1.9.2-linux-gcc4.4.3-1002/nginx-0.7.67′ –without-pcre –without-http_rewrite_module –without-http_fastcgi_module ‘–add-module=/home/herminio/.passenger/standalone/3.0.0.pre1-i686-ruby1.9.2-linux-gcc4.4.3-1002/support/ext/nginx’

  • Mark Mulder

    Is smart spawning also available for the standalone passenger start? When I touch tmp/restart.txt it still takes a while for a new request to get served.

  • rofh

    Hey, I have somewhat similar output as Hermino, but due to uname behaviour. You’re using uname -p as default, with failover to uname -m, but my uname -p outputs “Intel(R) Pentium(R) M processor 1400MHz” instead of something like i686, changed it to just use uname -m and it worked ok.

    Now I don’t really know uname behaviour under different unixes, but as I tried in Linux and FreeBSD, uname -m could be just fine as the default, what do you think? ( probably I’m wrong though ).

    Or you just could work on escaping, for it’s a thing people expect to just work ( my error was due to unescaped ‘(‘ ).

  • http://www.phusion.nl/ Hongli Lai

    @Mark Mulder: async spawning only works for subsequent spawns, not for the first one. Touching restart.txt essentially shuts down all existing processes.

  • http://www.herminiotorres.com Herminio Torres

    I copied my project to a folder in my home without spaces and still gives the same error!

  • http://www.phusion.nl/ Hongli Lai

    @Herminio Torres: In your case it looks like your gcc compiler is broken. Try reinstalling it.

  • http://www.phusion.nl/ Hongli Lai

    @rofh: Just fixed this in git.

  • Mark Mulder

    @Hongli Lai

    Ah I see, I was thinking it served another purpose, sorry about that.

    Are settings like PassengerPreStart and PassengerMinInstances coming to nginx as well? I can only see them in the Apache manual, I’ll excuse myself beforehand if this is in the nginx version already but just not updated in the docs just yet.

  • http://www.phusion.nl/ Hongli Lai

    @Mark Mulder: Nginx has them. Look for passenger_pre_start and passenger_min_instances instead.

  • http://www.herminiotorres.com Herminio Torres

    @Hongli Lai i’m reinstall my gcc and still the same problem.

    information from my linux: http://pastie.org/1161021

    erro when run passenger start: http://pastie.org/1161028

    the passenger chooses a default path to gcc? or passenger needs a version of gcc?

  • http://www.phusion.nl/ Hongli Lai

    It uses the default gcc. Then can you install Nginx separately and see whether that works?

  • http://www.herminiotorres.com Herminio Torres

    when I went to install only the ngix gave error.
    see:

    pasted on pastie the output of each command

    ./configure -> http://pastie.org/1161113

    make -> http://pastie.org/1161126

  • http://www.herminiotorres.com Herminio Torres

    the gem has a problem when going to use it in standalone.
    I downloaded the source code to ngix
    I got this:

    *** ERROR: command failed: sh ./configure ‘–prefix=/home/herminio/.passenger/standalone/3.0.0.pre1-i686-ruby1.9.2-linux-gcc4.4.3-1002/nginx-0.7.67′ –without-pcre –without-http_rewrite_module –without-http_fastcgi_module ‘–add-module=/home/herminio/.passenger/standalone/3.0.0.pre1-i686-ruby1.9.2-linux-gcc4.4.3-1002/support/ext/nginx’

    I went to the path of the source code to ngix
    run the same configure command from the error of passenger start
    and run the make and sudo make install.
    then went the way of my rails project
    and run passenger start e done

    =============== Phusion Passenger Standalone web server started ===============
    PID file: /home/herminio/rubylearning/test/sample_app/tmp/pids/passenger.3000.pid
    Log file: /home/herminio/rubylearning/test/sample_app/log/passenger.3000.log
    Environment: development
    Accessible via: http://0.0.0.0:3000/

    You can stop Phusion Passenger Standalone by pressing Ctrl-C.
    ===============================================================================

    is it no problem with the gem? because I did not install any lib in my linux

  • http://www.railsfactory.com Senthil Nayagam

    I am going to get it installed in our development servers and couple of EC2 instances.

    looking forward for passenger lite release for my mbp

  • http://www.phusion.nl/ Hongli Lai

    It needs some more investigation. At this time I don’t know why it fails for you.

  • http://www.herminiotorres.com Herminio Torres

    moved to another project of mine and I used the passenger start returns me this error:

    passenger start
    *** ERROR ***
    Could not start Passenger Nginx core:
    [alert]: could not open error log file: open()
    “/home/herminio/.passenger/standalone/3.0.0.pre1-i686-ruby1.9.2-linux-gcc4.4.3-1
    002/nginx-0.7.67/logs/error.log” failed (13: Permission denied)
    2010/09/15 16:26:46 [emerg] 17307#0: invalid log level “de” in
    /tmp/passenger-standalone.17294.conf:4
    Stopping web server… done

  • http://www.herminiotorres.com Herminio Torres

    the passenger has trouble booting when there paths like this:
    ~/Área de Trabalho

    why the passenger gave the above error

  • http://daviscabral.com.br Davis Zanetti Cabral

    Awesome guys! Great work again!

  • http://k776.tumblr.com Kieran P

    Passenger standalone fails when starting in a path containing spaces :-(

  • http://blog.mmediasys.com Luis Lavena

    Testing standalone mode under Snow Leopard with Rails 3 application.

    passenger beta is part of bundle.

    Application is a simple one, testing a simple “rails new testing” application.

    http://gist.github.com/581478

    Hitting the information page.

    Using RVM with 1.9.2-p0

    Either bundle exec passenger start or passenger start generates the same output.

  • http://wilker-dev.com Wilker

    the Mass Deploy will be a paid feature in future? or it’s just don’t launched on this version?

  • http://darwinweb.net/ Gabe da Silveira

    You guys do amazing amazing work.

    Gotta find some time to try this out soon.

  • http://www.phusion.nl/ Ninh Bui

    @Wilker: It will be one of the features we’re reserving for the premium version. More on this and the other awesome features that we’ve got in store for that version will be announced in the very near future. They’re nothing short than jawdropping we believe.

  • Pingback: Link dump for September 15th | The Queue Blog()

  • Rahul Chaudhari

    Great Guys!
    We are eagerly waiting for this.

    Thanks a lot!!

  • Stan

    Having same problem as @Luis

    simple rails new app, passenger gem installed fine, bundle check ok, using rvm 1.9.2 & gemset

    getting same error cf. http://gist.github.com/581478

  • Craig

    rvm with Ruby Enterprise Edition 2010.02 & gemset

    following error is apparent http://www.pastie.org/1162737

  • orgo

    I already installed new passenger in production ( 1 server ), rvm with ree at least with no problems! min-max instances is what i need

  • http://ryansobol.com Ryan Sobol

    Great work guys! Can’t wait to test it out my Sinatra apps!

  • Erik Johansson

    Tried on my development box, went from a solid 27mb/sec to 14mb/s, so pretty much half the performance from what I got with 2.2.14.
    Request/second is down from 2000 to 1200.
    Ruby 1.9.1

    Am I missing something here? I would expect it to at least be just as fast as the previous version.

  • http://www.phusion.nl/ Hongli Lai

    @Erik: Are you on Apache or Nginx? Does downgrading to 2.2.14 give you the speed back? How are you measuring performance? Did you take spawn times into account?

  • Erik Johansson

    Sorry, forgot some details there :)
    NGINX 0.8.50

    Downgrading gives my old speed.

    Measuring with ab (not a perfect tool I know, but it gives me a ball park at least). Running at least two warmup runs for spawning and then three tests to get an average.

  • http://www.phusion.nl/ Hongli Lai

    What OS are you on? Does it happen with every app or just your app? What if you benchmark hello world?

  • Erik Johansson

    Debian 5 (2.6.26 amd64)

    I’ve only tested my own application, which is a extremely basic Rack-app without any bells and whistles.

  • Pingback: Особое программирование » Post Topic » Вышел Phusion Passenger 3.0.0 public beta 1()

  • http://carlosantoniodasilva.wordpress.com Carlos Antonio

    Hello huys, great work going with Passenger 3 beta 1.

    I’m having the same issue @luis is having, using gemsets, when I run the application and go to localhost:3000 for the first time, it fires an error saying it does not find some gem. If I install the gem in the default env, not the gemset, it finds it and explodes in another missing gem. So it seems it’s not loading the current gemset.

    Thanks.

  • http://codegram.com Txus

    I’m trying to use passenger standalone with a Sinatra app, but it seems to ignore config.ru, and thus not recognize sinatra.

    Any ideas? Thank you!

  • Erik Johansson

    Here’s my new findings from a HelloWorld application, hopefully this is helpful in some way.

    Passenger 2.2.15 – 2600req/sec
    Passenger 3.0.0 – 1100req/sec
    Ruby 1.9.2

    Application code:
    “class HelloWorld
    def call(env)
    [200, {“Content-Type” => “text/plain”}, [“Hello world!”]]
    end
    end

    run HelloWorld.new”

    Any ideas what could be causing this?

  • Erik Johansson

    The benchmark

    ab -c 100 -n 25000 http://devdomain/

  • http://www.phusion.nl/ Hongli Lai

    @Erik: can you post the full ‘ab’ output? We use almost the same benchmark in our tests.

  • Erik Johansson

    The domain is ofc a devdomain :)

    Passenger 3

    ab -c 100 -n 25000 http://www.ruby2.se/
    This is ApacheBench, Version 2.3 
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    
    Benchmarking www.ruby2.se (be patient)
    Completed 2500 requests
    Completed 5000 requests
    Completed 7500 requests
    Completed 10000 requests
    Completed 12500 requests
    Completed 15000 requests
    Completed 17500 requests
    Completed 20000 requests
    Completed 22500 requests
    Completed 25000 requests
    Finished 25000 requests
    
    
    Server Software:        nginx/0.8.50
    Server Hostname:        www.ruby2.se
    Server Port:            80
    
    Document Path:          /
    Document Length:        12 bytes
    
    Concurrency Level:      100
    Time taken for tests:   22.562 seconds
    Complete requests:      25000
    Failed requests:        0
    Write errors:           0
    Total transferred:      6275000 bytes
    HTML transferred:       300000 bytes
    Requests per second:    1108.05 [#/sec] (mean)
    Time per request:       90.248 [ms] (mean)
    Time per request:       0.902 [ms] (mean, across all concurrent requests)
    Transfer rate:          271.60 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        0    0   0.4      0      14
    Processing:    22   90  33.1     81     616
    Waiting:       22   90  33.1     80     616
    Total:         24   90  33.1     81     616
    
    Percentage of the requests served within a certain time (ms)
      50%     81
      66%     89
      75%     96
      80%    102
      90%    127
      95%    156
      98%    196
      99%    225
     100%    616 (longest request)

    ——————————————————————-
    Passenger 2.2.15

    ab -c 100 -n 25000 http://www.ruby2.se/
    This is ApacheBench, Version 2.3 
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    
    Benchmarking www.ruby2.se (be patient)
    Completed 2500 requests
    Completed 5000 requests
    Completed 7500 requests
    Completed 10000 requests
    Completed 12500 requests
    Completed 15000 requests
    Completed 17500 requests
    Completed 20000 requests
    Completed 22500 requests
    Completed 25000 requests
    Finished 25000 requests
    
    
    Server Software:        nginx/0.8.50
    Server Hostname:        www.ruby2.se
    Server Port:            80
    
    Document Path:          /
    Document Length:        12 bytes
    
    Concurrency Level:      100
    Time taken for tests:   9.484 seconds
    Complete requests:      25000
    Failed requests:        0
    Write errors:           0
    Total transferred:      6075486 bytes
    HTML transferred:       300024 bytes
    Requests per second:    2636.15 [#/sec] (mean)
    Time per request:       37.934 [ms] (mean)
    Time per request:       0.379 [ms] (mean, across all concurrent requests)
    Transfer rate:          625.62 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        0    0   0.4      0       7
    Processing:    21   38   6.3     37      85
    Waiting:       20   32   5.1     31      76
    Total:         23   38   6.3     37      85
    
    Percentage of the requests served within a certain time (ms)
      50%     37
      66%     39
      75%     41
      80%     42
      90%     46
      95%     50
      98%     55
      99%     59
     100%     85 (longest request)
  • http://www.phusion.nl/ Hongli Lai

    @Erik: do you hang out on IRC? I think it’s faster if we can communicate directly. I’m FooBarWidget on irc.freenode.net #passenger

  • http://www.phusion.nl/ Hongli Lai

    The problem with Erik is solved. Turns out to be virtualization overhead in combination with some threading settings.

  • Pingback: Brightbox Blog - Ruby on Rails Hosting – Passenger 3.0.0 beta3 packages for Ubuntu Lucid and Hardy()