Using Sidekiq and Passenger in same Heroku Dyno - heroku

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.

Related

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.

Why is my middleman heroku app ignoring the Procfile?

I've been struggling trying to launch my middleman repo to heroku. I've followed a tutorial http://randomerrata.com/post/56163474367/middleman-on-heroku, but have had continued issues. Although installing the puma gem, for some reason the procfile is being ignored and the heroku app keeps pointing to
web bundle exec sudo unicorn_rails -c ./config/unicorn.rb -p $PORT -D --env production
Any idea how to get this thing to stop pointing to the unicorn rails and use puma?
Perhaps it would be worth checking out middleman-heroku as a different route to take. Alternatively I would check that your Gemfile.lock is up to date and committed.
I would try tailing the logs with heroku logs -t to see if you can see what's happening.
Is your Procfile called Procfile with a capital P?
What does it look like, can you post it here?
My Procfile has web: bundle exec puma -p $PORT. Is Puma listed in your Gemfile?

Ruby rainbows/unicorn start faye and rails

Is there a way i can start both faye and rails apps together in rainbows/unicorn.
Right now i'm using rainbows to start faye/private_pub app but would like to start rails also with it
Do you know Foreman?
With foreman you can set the commands to start your app on a single file, like this
web: bundle exec start_app_command
faye: bundle exec start_faye_command
and then, just run bundle exec foreman start and foreman will run both rails and faye

Starting Sidekiq with rails server in development environment

I am using Sidekiq for some of my background processes.
Currently what I do is:
start bundle exec rails s on one terminal and then start bundle exec sidekiq on a different terminal so that the sidekiq starts itself and look for jobs to process.
What I want is:
As soon as i start bundle exec rails s it should also start the sidekiq bundle exec sidekiq. How can i integrate it in just Development environment ??
For apps like yours which require a number of services to be running consider using foreman and a Procfile to define those processes. Then you can use foreman start to run all of them in a single terminal.

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