How to set Thin as default in Rails 3

I sent a pull request on the Github repository of rack and it was accepted: https://github.com/rack/rack/commit/b487f02b13f42c5933aa42193ed4e1c0b90382d7 In a near future, we will be able to use Thin just by adding gem ‘thin’ to our Gemfile and starting app with rails s. Note that this may be a temporary measure, however. I chose Thin because Mongrel … Read more

Can nginx be used as a reverse proxy for a backend websocket server?

You can’t use nginx for this currently[it’s not true anymore], but I would suggest looking at HAProxy. I have used it for exactly this purpose. The trick is to set long timeouts so that the socket connections are not closed. Something like: timeout client 86400000 # In the frontend timeout server 86400000 # In the … Read more

Rack concurrency – rack.multithread, async.callback, or both?

Note: I use Thin as synonym for all web servers implementing the async Rack extension (i.e. Rainbows!, Ebb, future versions of Puma, …) Q1. Correct. It will wrap the response generation (aka call) in EventMachine.defer { … }, which will cause EventMachine to push it onto its built-in thread pool. Q2. Using async.callback in conjunction … 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

Cannot install thin on windows

Installing from the git or rubygems repositories no longer works (currently) under 1.9.2 or 1.9.3 (confirmed still broken on 2012-June-22). Instead, you need to simply: gem install eventmachine –pre gem install thin Note that on 2012-June-18 the current prerelease was renamed to 1.0.0.rc.1, so there is a possibility that ‘soon’ the version that works with … Read more

Thin web server: `start_tcp_server’: no acceptor (RuntimeError) after git branch checkout

This works for me. Find (zombie?) server (can happen when quitting terminal with server running): $ ps ax | grep rails If it returns something like: 33467 s002 S+ 0:00.00 grep rails 33240 s003 S+ 0:15.05 /Users/Arta/.rbenv/versions/1.9.2-p290/bin/ruby script/rails s -p 3000 kill it, and run anew: $ kill -9 33240 $ rails s