我不確定問題的確切位置,但Capistrano需要大約5分鐘才能部署一個幾乎空的項目。卡皮斯特拉諾很慢
你能告訴我如果我做錯了什麼或是平時的事情嗎?
我使用:
- Capistrano的2.9.0
- 的Rails 3.1.3
- Github上庫
- 不是太慢服務器(4個核心,1個GB內存)
- ngix,乘客
這裏是我得到的輸出: https://gist.github.com/1632009
Capfile
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
deploy.rb
# -*- encoding : utf-8 -*-
require "bundler/capistrano"
set :user, 'rubys'
set :domain, 'example.com'
set :application, 'EXAMPLE'
# adjust if you are using RVM, remove if you are not
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_ruby_string, '1.9.2'
#set :rvm_type, :user
# file paths
set :repository, "[email protected]:GITHUBREPO/ashop.git"
set :deploy_to, "/apps/#{application}"
# using a local git repository on the server you are deploying to.
set :deploy_via, :remote_cache
set :copy_exclude, [ '.git' ]
# distribute your applications across servers (the instructions below put them
# all on the same server, defined above as 'domain', adjust as necessary)
role :app, domain
role :web, domain
role :db, domain, :primary => true
set :deploy_via, :remote_cache
set :scm, 'git'
set :branch, 'master'
set :scm_verbose, false
set :use_sudo, false
set :rails_env, :production
namespace :deploy do
desc "cause Passenger to initiate a restart"
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end
編輯
- Networkspeed職場: http://www.speedtest.net/result/1714391142.png
- 速度Github上 - 服務器:〜300KiB
是網絡速度慢? – 2012-01-18 08:42:11
5Mbit理論上傳/下載http://www.speedtest.net/result/1714391142.png – Mark 2012-01-18 08:43:45
服務器可能<=> github很慢 – 2012-01-18 08:45:05