Rails, Mongoid & Unicorn config for Heroku

You dont actually need to do this, so for people coming to view this question see: http://mongoid.org/en/mongoid/docs/rails.html “Unicorn and Passenger When using Unicorn or Passenger, each time a child process is forked when using app preloading or smart spawning, Mongoid will automatically reconnect to the master database. If you are doing this in your application … Read more

How to improve memory sharing between unicorn processes with Ruby 2.0 on Linux

According to this answer, which you may have already seen, there is a line that reads: Note that a “share-able” page is counted as a private mapping until it is actually shared. i.e. if there is only one process currently using libfoo, that library’s text section will appear in the process’s private mappings. It will … Read more

Why would I want to use unicorn or thin instead of WEBrick for development purposes?

It is important to develop as closely as possible to the production environment. It helps ensure that an application will work as expected when deployed into production, instead of stumbling upon bugs at runtime. This issue is alleviated with the use of Continuous Testing on a Build server that replicates the production environment. Even though … Read more

Using God to monitor Unicorn – Start exited with non-zero code = 1

I haven’t used unicorn as an app server, but I’ve used god for monitoring before. If I remember rightly when you start god and give your config file, it automatically starts whatever you’ve told it to watch. Unicorn is probably already running, which is why it’s throwing the error. Check this by running god status … Read more

Nginx cannot find unix socket file with Unicorn (no such file or directory)

After many hours and a grand total of 3 beers, I’ve managed to figure out the problem. After hours of digging, I finally came across this Server Fault answer In layman terms, it appears that programs that create files in /tmp (or /var/tmp as I have discovered) are the only programs that are able to … Read more

How can I use unicorn as “rails s”?

It looks like the unicorn-rails gem that @Dogbert mentioned can actually be used to make Unicorn the rails server handler. Simply include gem “unicorn-rails” (and for Rails 4.2.4, gem “rack-handlers”) in your Gemfile, run bundle install to install the gem, then you can run: $ rails server unicorn Although once unicorn-rails is installed, Unicorn should … Read more

Unicorn exit timeout on Heroku after trapping TERM and sending QUIT

I think your custom signal handling is what’s causing the timeouts here. EDIT: I’m getting downvoted for disagreeing with Heroku’s documentation and I’d like to address this. Configuring your Unicorn application to catch and swallow the TERM signal is the most likely cause of your application hanging and not shutting down correctly. Heroku seems to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)