我在EC2上运行了一个RorR应用程序(micro insntance,~590mb mem。) 当我使用capistrano部署应用程序时,当资产编译时,内存使用率会达到98.7%... 有没有办法减少这种用法?
这是我的deploy.rb
require "bundler/capistrano"
set :application, "name"
set :repository, "git@github.com:user/app.git"
set :scm, :git
role :web, "server.compute.amazonaws.com"
role :app, "server.compute.amazonaws.com"
role :db, "server.compute.amazonaws.com", :primary => true
set :user, "user"
set :use_sudo, false
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
ssh_options[:keys] = ["#{ENV['HOME']}/key.pem"]
# if you want to clean up old releases on each deploy uncomment this:
after "deploy:restart", "deploy:cleanup"
set :deploy_to, "/home/user"
set :deploy_via, :remote_cache
role :web, "server.compute.amazonaws.com" # Your HTTP server, Apache/etc
role :app, "server.compute.amazonaws.com" # This may be the same as your `Web` server
role :db, "server.compute.amazonaws.com", :primary => true # This is where Rails migrations will run
# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts
这是一种期待的行为吗?我应该增加记忆吗? 我在digitalocean.com上使用了256mb的VM,现在我使用EC2和590mb,而且消耗仍然几乎达到100%
答案 0 :(得分:0)
如果您运行的是Rails 3.1.1,那么您的问题可能与此问题有关:https://github.com/rails/rails/issues/3694。它已在rails 3.2中修复,因此升级可以解决您的问题。