unicorn

Rufus scheduler running multiple times with unicorn, fixed with :lockfile, but how to eliminate the error msg?

对着背影说爱祢 提交于 2019-12-22 04:25:06
问题 scheduler = Rufus::Scheduler.new :lockfile => ".rufus-scheduler.lock" scheduler.every("60") do ... end Environment: Ubuntu, rails 4, rufus, unicorn, nginx Unicorn has multiple workers, so the above 'every' task will be executed multiple times every 60 seconds. According to the answer for this one: rufus scheduler running twice each time , I added :lockfile option, and it works! However, from the log, it seems that the 'every' task still tries to be called, resulting in a lot of error messages

Unicorn vs Passenger Standalone behind nginx [closed]

蓝咒 提交于 2019-12-22 03:52:14
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm trying to decide between Unicorn and Phusion Passenger Standalone (formerly Phusion Passenger Lite). I want to host multiple apps

Rails shows IP as 127.0.0.1 when accessed from private NIC, but Nginx shows the correct IP. Public IP gets forwarded fine

旧城冷巷雨未停 提交于 2019-12-21 08:26:11
问题 We are running a Rails application on Unicorn + Nginx. The server has two NICs that we use. eth0 handles requests for the public internet, and eth2 handles requests from our private network. When a request comes through eth0 , the nginx logs show the public IP, and the Rails logs also show this IP. However, when a request comes through eth2 , the nginx logs show the private IP correctly (e.g. 192.168.5.134 ), but the Rails logs show 127.0.0.1 . So it seems like public requests on eth0 get

Start unicorn on OSX Startup

一笑奈何 提交于 2019-12-21 05:42:41
问题 i'm currently using rvm and unicorn for server management under osx lion. i also use a gemset. so for starting my server i do following: cd /xyz/project unicorn -c /xyz/project/config/unicorn.rb -E production now i want this server starting when my computer starts up. i read something about adding a plist file to ~/Library/LaunchAgents/ and activating it with launchctl but i have no idea what to write inside this plist file for starting my server. any ideas? also i think it's difficult,

Really need a db connection pool for unicorn rails?

爷,独闯天下 提交于 2019-12-21 04:35:15
问题 I can't find any document describing database connection pooling effect for unicorn. Unicorn forks several worker processes. I configured prefork and it's critical not to share database connections between workers, so I reset db connections after fork. My rails application has 8 workers per server, and the pool size in database.yml is 5, then I saw 45 connections to mysql. Each worker is single-threaded that handles 1 request at a time. SQL queries should be blocking. Seems the other 4

Rails 3.1, Unicorn and Apache: static files

余生颓废 提交于 2019-12-21 01:49:10
问题 I have Rails 3.1, Unicorn and Apache setup. My Apache settings are below and production.rb looks like this. I like using h264 streaming but since Rails is serving these video files, the Apache Mod won't work. DocumentRoot /blabla/current/public RewriteEngine On Options FollowSymLinks <Proxy balancer://unicornservers> BalancerMember http://127.0.0.1:4000 </Proxy> # Redirect all non-static requests to rails RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer:/

How to configure ActionCable with Nginx and Unicorn in production?

醉酒当歌 提交于 2019-12-20 10:58:13
问题 I've recently switched my rails project from Rails4 to 5.0.0.beta3 to use the awesome ActionCable. My ActionCable server is run inside unicorn. In development all works fine. In production I have Started GET "/cable" for xxx.xxx.xxx.xxx at 2016-03-28 18:06:38 +0300 Started GET "/cable/" [WebSocket] for xxx.xxx.xxx.xxx at 2016-03-28 18:06 Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket) Registered connection (189772ff-6229-48f1-ae7f

Unicorn unable to write pid file

左心房为你撑大大i 提交于 2019-12-20 10:11:50
问题 I am using deploying a Ruby on Rails app to a Linode VPS using Capistrano. I am using Unicorn as the application server and Nginx as the proxy. My problem is that I am not able to start Unicorn because of an apparent permissions issue, but I'm having a hard time tracking it down. Unicorn is started using this Capistrano task: task :start, :roles => :app, :except => { :no_release => true } do run <<-CMD cd #{current_path} && #{unicorn_bin} -c #{unicorn_config} -E #{rails_env} -D CMD end I get

Error R12 (Exit timeout) using Heroku's recommended Unicorn config

删除回忆录丶 提交于 2019-12-20 09:16:13
问题 My Unicorn config (copied from Heroku's docs): # config/unicorn.rb worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) timeout 30 preload_app true before_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn master intercepting TERM and sending myself QUIT instead' Process.kill 'QUIT', Process.pid end defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! end after_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn worker intercepting TERM and doing

Should I use thin or unicorn on Heroku Cedar

假如想象 提交于 2019-12-20 08:24:36
问题 I recently 'upgraded' my app to the cedar platform on Heroku. By default, I am using thin as a web server. But I have always been tempted to use unicorn for concurrency and having my dyno dollar go father. But I worry there are some gotchas in using something other than Thin. Does anyone have real-life experience with this decision? Notes: This was the article that got me excited about the idea: http://michaelvanrooijen.com/articles/2011/06/01-more-concurrency-on-a-single-heroku-dyno-with-the