unicorn

Rails Performance Tuning for Production?

♀尐吖头ヾ 提交于 2019-12-03 00:55:15
问题 I'm getting close to deploying an application built on Rails 3.1.x and started running some performance tests. After fiddling with ab for a bit, I'm seeing some very discouraging results yielding around 15 requests / second on Heroku. When testing locally I see similar results that really demonstrates that it's an app issue more than anything. I'm running Unicorn, which is about 40% faster than Thin on Celadon Cedar. Further, I'm using the PGSQL shared db. I'm hopeful that someone could share

Too many redirects error while trying to configure rails application as SSL using nginx and unicorn

最后都变了- 提交于 2019-12-02 23:02:57
I am trying to configure a Rails application with SSL, using Nginx and Unicorn. I am trying to set it up locally. For that I first created a self-signed certificate using OpenSSL for Nginx. I followed the document for creating self-signed certificates. After that I configured my nginx.conf as below, inside the http block: upstream unicorn_myapp { # This is the socket we configured in unicorn.rb server unix:root_path/tmp/sockets/unicorn.sock fail_timeout=0; } server { listen 80; server_name dev.myapp.com; rewrite ^/(.*) http://dev.myapp.com/$1 permanent; } server { listen 80; listen 443 ssl;

Unicorn restart issue with capistrano

自闭症网瘾萝莉.ら 提交于 2019-12-02 20:55:16
We're deploying with cap and using a script that send USR2 to the unicorn process to reload and it usually works but every once in a while it will fail. When that happens looking in the unicorn log reveals that it's looking for a Gemfile in an old release directory that no longer exists. Exception : /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:14:in `build': /var/www/railsapps/inventory/releases/20111128233407/Gemfile not found (Bundler::GemfileNotFound) To clarify that's not the current release but an older one that's since been removed. When it works it does

Unicorn unable to write pid file

可紊 提交于 2019-12-02 20:42:39
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 back and ArgumentError indicating that the path to the pid file is not writeable. cap unicorn:start

Restarting Unicorn with USR2 doesn't seem to reload production.rb settings

瘦欲@ 提交于 2019-12-02 20:18:24
I'm running unicorn and am trying to get zero downtime restarts working. So far it is all awesome sauce, the master process forks and starts 4 new workers, then kills the old one, everyone is happy. Our scripts send the following command to restart unicorn: kill -s USR2 `cat /www/app/shared/pids/unicorn.pid` On the surface everything looks great, but it turns out unicorn isn't reloading production.rb. (Each time we deploy we change the config.action_controller.asset_host value to a new CDN container endpoint with our pre-compiled assets in it). After restarting unicorn in this way the asset

Is my understanding of Unicorn, Sidekiq and DB Pool size correct?

送分小仙女□ 提交于 2019-12-02 19:17:58
I have Unicorn, Sidekiq and Postgres setup. I am trying to understand the right configuration to set up so that I don't hit the maximum db connection limit. In Opsworks, the m1.small Postgres RDS instance can have a max of 121 connections. I have a db pool size of 5. Consider this. Sidekiq and Unicorn are its own process. So the db pool size for each process is 5. Correct me if my understanding here is wrong. If I have 5 unicorn process', that means 5*5=25 database connections Now this is the part where I am slightly confused, since Sidekiq is multithreaded. If Sidekiq has a concurrency of 5.

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

◇◆丶佛笑我妖孽 提交于 2019-12-02 17:01:16
I've recently found that some people prefer using unicorn_rails instead of the default WEBrick as a web server for developing Rails applications. I understand that if I wanted to use unicorn in production, it could make kind of sense to try it out in development, but since the configuration is different in production, is it even relevant? Is there any real, tangible advantage that I would get from using thin or unicorn instead of WEBrick for developing a Rails application, such as speed or some additional features? Or is this just a matter of personal preference? It is important to develop as

Should I use thin or unicorn on Heroku Cedar

这一生的挚爱 提交于 2019-12-02 15:24:44
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? Thanks! Jonathan 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-new-celadon-cedar-stack/ I know every app is different, and that you should build a

Capistrano+Nginx+Unicorn 自动部署Rails

落爺英雄遲暮 提交于 2019-12-02 14:29:23
配置你的服务器 你需要在你的服务器上安装Ruby的环境,你可以使用RVM或者是rbenv. 上传到github 这步需要将你的应用上传到github,在你的github上创建新的 repository,然后在你本机代码位置执行下面的命令,初始化git仓库。 git init git add . git commit -m"<message>" git remote add origin git@github.com:<username>/<git repo>.git git push origin master 安装Capistrano 在你的Gemfile里添加下面的一行。 ? 1 gem'capistrano' 然后执行 ? 1 bundle 在你的项目目录里执行 ? 1 capify . 执行结果 ? 1 2 3 4 examination-paper ➤ capify . git:master* [add] writing'./Capfile' [add] writing'./config/deploy.rb' [done] capified! 创建了两个文件,你的Rails应用的配置文件写在config/deploy.rb里。下面是一个示例。 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Rails Performance Tuning for Production?

ぐ巨炮叔叔 提交于 2019-12-02 14:19:04
I'm getting close to deploying an application built on Rails 3.1.x and started running some performance tests. After fiddling with ab for a bit, I'm seeing some very discouraging results yielding around 15 requests / second on Heroku. When testing locally I see similar results that really demonstrates that it's an app issue more than anything. I'm running Unicorn, which is about 40% faster than Thin on Celadon Cedar. Further, I'm using the PGSQL shared db. I'm hopeful that someone could share a laundry list or essentially a launch checklist that I should move through when prepping an app for