unicorn

Rails, Heroku, Unicorn & Resque - how to choose the amount of web workers / resque workers?

ぃ、小莉子 提交于 2019-12-08 04:16:23
问题 I've just switched to using Unicorn on Heroku. I'm also going to switch to resque from delayed_job and use the setup described at http://bugsplat.info/2011-11-27-concurrency-on-heroku-cedar.html What I don't understand from this is how config/unicorn.rb: worker_processes 3 timeout 30 @resque_pid = nil before_fork do |server, worker| @resque_pid ||= spawn("bundle exec rake " + \ "resque:work QUEUES=scrape,geocode,distance,mailer") end translates into: "This will actually result in six

Sidekiq UI is not loading assets - 404 not found

前提是你 提交于 2019-12-08 04:09:21
问题 I am having rails 4.1 application running with sidekiq on production. I have deployed it using nginx + unicorn. Also I have mounted sidekiq UI as follows, mount Sidekiq::Web => '/sidekiq' but since last few days when ever I try to access sidekiq UI, all assets of sidekiq returning 404, not found. But it was working previously fine. But not able to find what leads 404. Here is my settings nginx+unicorn settings for my app upstream sample_app { server unix:/tmp/sample_app.sock fail_timeout=0; }

ERROR — : reaped #<Process::Status: pid 4335 exit 1> worker=0

若如初见. 提交于 2019-12-07 11:27:27
I am trying since 2 days to deploy on my vps (Ubuntu 12.04 Server (64 bits)) using : ruby (1.9.3-rc1), rails, capistrano, nginx and unicorn. I also follow railscast tutorial from Ryan Bates showing how to deploy on VPS from scratch. Actualy the cap deploy:cold command seems to work fine (as all the others) but when i try to go on my url i fall on "We're sorry but something went wront" => The default error page from Rails. In my production logs i get : Migrating to CreateQuestionAnswers (20130317152603) Migrating to CreateRegions (20130502212531) Migrating to AddRegionIdToSection

sidekiq does not process jobs, jobs stuck in enqueue

孤者浪人 提交于 2019-12-07 11:07:07
问题 I have a simple application that works with the twitter stream api, sidekiq, unicorn and sinatra. All works well, instead of... the job are not being processed at all. They are stuck in Enqueued (And I know that from the sidekiq web UI). This is my code: Procfile: sidekiq: bundle exec sidekiq -C config/sidekiq.yml -e development -r ./lib/tweet_streamer.rb unicorn: bundle exec unicorn -c config/unicorn.rb redis: redis-stable/src/redis-server config/unicorn.rb: listen 5000, :tcp_nopush => true

Websocket-rails doesn't work on production evironment with Nginx and Unicorn

隐身守侯 提交于 2019-12-07 02:07:30
问题 I have Rails 3.2 application with gem websocket-rails 0.7. On development machine, all work fine On production enviroment, I use Nginx/1.6 as proxy server and Unicorn as http server. Thin is used on standalone mode (following https://github.com/websocket-rails/websocket-rails/wiki/Standalone-Server-Mode). nginx config: location /websocket { proxy_pass http://localhost:3001/websocket; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } On

SSH and -bash: fork: Cannot allocate memory VPS Ubuntu

大兔子大兔子 提交于 2019-12-07 02:06:10
问题 I am hosting my Rails app on Ubuntu 12.04 VPS, Nginx + Unicorn, after deployment everything is fine, but few hours later, when I ssh to the VPS I get this message -bash: fork: Cannot allocate memory -bash: wait_for: No record of process 4201 -bash: wait_for: No record of process 4201 If I run any command, it would just return -bash: fork: Cannot allocate memory. 回答1: Seems you have run out of memory. Many VPS servers are setup with no swap, so when you run out of memory, it will kill things

Error Messages Showing in Production - Ruby on Rails 3.1, Nginx, Unicorn

岁酱吖の 提交于 2019-12-06 14:55:31
I have a Rails 3.1 app running in production using Nginx and Unicorn. And for some reason, my custom 404 and 500 html error pages are not showing. Instead I'm getting the actual error message ("Routing Error", for example). In my production.rb file, I have config.consider_all_requests_local = false And on the same server with a nearly identical configuration, I have a 'staging' site that works just fine. The only difference, as far as I can tell, is that the production one has SSL while the staging does not. Here is the Nginx config for the production app: upstream unicorn_myapp_prod { server

how to make rails+unicorn logger thread safe?

血红的双手。 提交于 2019-12-06 14:11:01
We've been using unicorn to deploy our application. Everything went fine except for the production.log file, which turned out to be unreadable because the way unicorn was designed. Every instance of unicorn wrote to the same file, causing all the lines spaghetti'ed together. So is there a way to tell the logger to log independently across multiple unicorn instances? edit your unicorn.conf.rb , and change the after_fork block to something like: after_fork do |server, worker| filepath = "#{Rails.root}/log/#{Rails.env}.#{worker.nr}.log" Rails.logger = Logger.new(filepath, File::WRONLY | File:

rails deployment using nginx & unicorn: 403 forbidden error

二次信任 提交于 2019-12-06 13:53:44
问题 I have just setup a VPS (Centos 6.3) and deploy my app using capistrano. The VPS runs nginx & unicorn. I'm getting a 403 Forbidden error when visiting the server: this line appears in /var/log/nginx/error.log: *5 directory index of "/var/www/current/public/" is forbidden, client: xxxxx, server: xxx, request: "GET / HTTP/1.1", host: "xxxx" However, if I add the index.html to my rails app in ./public, everything works without problem. This makes me think that the routes aren't working. I have

What's the “official” way to support Unicorn on Heroku and not lose logging?

左心房为你撑大大i 提交于 2019-12-06 13:12:38
问题 We switched to Unicorn, but lost all app logging on Heroku. I googled around a bit and learned Heroku's Ruby buildpack installs a plugin "rails_log_stdout" which doesn't play nice with Unicorn. My guess would be this has something to do with the forking nature of Unicorn, but I didn't confirm that. Various workarounds like https://gist.github.com/jamiew/2227268 where suggested. These strike me as dis-satisfying because they won't use the log levels defined in the Rails app or any tags, or