how to get zeus to boot passenger standalone by default instead of webrick? - passenger

Upon starting zeus & running zeus s, rails server boots with the default WEBrick web server. How can zeus be customized so that it boots passenger standalone by default.
(I have passenger standalone working in development environment, i can boot it with 'bundle exec passenger start' from the command line or with a hack to script bin/rails which defaults rails s to start with passenger.)

The closest thing to achieving this is to use guard, guard-passenger in combination with zeus.
guard-passenger gem is available at https://github.com/guard/guard-passenger
start zeus first and then start guard which will now automatically boot a rails server using passenger standalone configured in the app.

Related

Phusion Passenger Standalone: How to pass a command line flag to ruby?

As part of a performance analysis, I'd like to run my rails app with several different rubies. All of them have the gem passenger (v5) installed and are able to run passenger start.
The question: How can I pass a flag (like --1.8) to my ruby interpreter? I'm using the version manager rbenv, but when I'm running
ruby --1.8 -S passenger start
using the interpreter jruby-1.7.27, the flag is non-persistant i.e. jruby does not run in the 1.8 compatibility mode.
I found that you can set an environment variable, which also applies to the instantiated passenger server:
env JRUBY_OPTS=--1.8 ruby -S passenger start
works like a charm.
See the JRuby FAQ for further details.

How can I run dashing with ruby web server puma?

Dashing uses thin ruby web server as default.
I'm trying to used puma as my ruby web server since I got issue with memory consumption with the default web server.
I have read in some github forums that the rufus-scheduler which is used to schedule jobs might be the cause of memory issue.
I set up gem 'puma' in mg GemFile & bundled it.
But every time I run my application, it uses thin web server again.
dashing start
Thin web server (v1.6.4 codename Gob Bluth)
Maximum connections set to 1024
Listening on 0.0.0.0:3030, CTRL+C to stop
Please help on how to properly use puma web server on dashing.
Run your server using puma:
puma config.ru
Or run your server with rackup and specify puma as the server:
bundle exec rackup -s puma -p 3030
Explanation:
When you run dashing start, you're using the dashing CLI tool. The reason you can't run dashing with puma using the dashing CLI tool is because the use of thin is hard-coded. See the dashing CLI code.

Using Sidekiq and Passenger in same Heroku Dyno

I have a simple web app on heroku running on Passenger and I am trying to make the emails asynchronous. I set it all up with Sidekiq in my dev environment and then I realized I have to start a new dyno on Heroku to run the Sidekiq worker and have to pay $34/m. I am trying to see if I can run Sidekiq on the web dyno with Passenger and save the $34/m cost for now till its worth that investment.
I found a post here that explains how to do this with Unicorn. I am wondering if I can do the same thing with Passenger.
If that doesn't work I will look at using sucker_punch or use unicorn instead but will be good if I can Sidekiq working on the same dyno with Passenger.
I am on rails 3.1, sidekiq 3.1.4 and passenger 4.0.5 - can upgrade here if I have to.
Thanks for your thoughts.
-S
You can. There's no difference between Passenger and Unicorn when it comes to achieving this goal. Instead of specifying web: bundle exec unicorn ... in your Procfile, you just set web: bundle exec passenger in your Procfile. Instead of setting a Unicorn config file, you set equivalent Passenger command line arguments or configuration.

Which HTTP web server can I use to debug ruby code using Rubymine 3.0.1?

I've being using Mongrel with Rails 2.3.X and Ruby 1.8.7 without problems, but when I switch to Ruby 1.9.2 and Rails 3, I'm having problems with mongrel to debug.
Webrick is just slow, so, do you know any alternatives?
Do you know how to fix mongrel to successfully debug rails app using rubymine 3.0.1?
RubyMine 3.1 is out now and supports a number of different servers. Under the "Run" menu, select "Edit Configurations" then go to "Defaults->Rails". There you can choose between:
WEBrick
lighttpd
mongrel
thin
trinidad
unicorn
glassfish
I couldn't get Defaults->Rails changes to affect my different configs that were set to 'Default', but I did have success changing the discrete config ('development') directly. Note: For Mongrel you need to have this in your gemfile:
gem 'mongrel', '1.2.0.pre2'
I'm using RM 3.1.1, Rails 3.0.9 and Ruby 1.9.2.

Running Sinatra app with Mongrel on Windows

I'd like to start a Sinatra app from Mongrel on Windows, rather than Sinatra starting Mongrel in the background.
Is there a simple way to use Mongrel for Sinatra? It's looking for a rails app by default.
Edit: Suggested solution is to simply run a VMWare or SunBox with real Linux and deal with the corporate issues that way.
Check out http://sinatra-book.gittr.com/.
FastCGI is the chapter you're looking for within the page, because that's what mongrel is
if you have a rake config, like config.ru
then install thin gem
then
thin -p 3000 -r config.ru
I think.
-r

Resources