cURL cannot connect to localhost but browser can
This is a curl bug (a strange one), where curl fails to fall back to IPv4 if there’s an IPv6 entry in /etc/hosts that doesn’t respond. You can force it to use IPv4 via the -4 option.
This is a curl bug (a strange one), where curl fails to fall back to IPv4 if there’s an IPv6 entry in /etc/hosts that doesn’t respond. You can force it to use IPv4 via the -4 option.
Thin is easy to configure – not optimal, but it just works in the Heroku environment. Unicorn can be more efficient, but it needs to be configured: How many workers? Preload App? What do you pick? I have released Unicorn Heroku apps with workers set to 3, 5 and 8 – just based on how … Read more
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
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
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
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
Update — 3 months later. I have been using unicorn in production for 3 months, and I have been very pleased. I use 4 unicorn workers per dyno. One thing you do need to keep an eye out for is memory consumption and leakage. In effect instead of having 512MB of memory per dyno — … Read more
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
I think the proxy_set_header directive could help: location / { proxy_pass http://my_app_upstream; proxy_set_header Host $host; # … }
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