Gem 求教 geminabox 的列表速度优化

wuwx · 2013年04月02日 · 最后由 wuwx 回复于 2013年04月02日 · 2964 次阅读

mirror 了 280k+ 个 gem 包 目前占了 74G 的空间 运行 geminabox 后打开首页好慢好慢 服务器 CPU 100% 浏览器 CPU 也是 100%

实在没有办法只好在 public 下弄了一个 index.html

请问 ruby.taobao.org 的那个首页也是 index.html 么…… 还是别的什么优化方法?

Nginx 设置 *.gem 的某些文件指向到特定的目录就对了,压根不需要 geminabox

server {
  location ~* ^(/gems|/quick|/latest_specs.4.8|/latest_specs.4.8.gz|/Marshal.4.8|/Marshal.4.8.Z|/prerelease_specs.4.8|/prerelease_specs.4.8.gz|/specs.4
    root /your/rubygems/path;
  }
}

好像会有一些额外的请求呢:

[02/Apr/2013:18:18:23 +0800] "GET /api/v1/dependencies?gems=rails,sqlite3,sass-rails,coffee-rails,therubyracer,uglifier,bootstrap-sass,bootstrap-boxes,bootstrap-wysihtml5-rails,better_errors,binding_of_caller,factory_girl_rails,jquery-rails,devise,inherited_resources,bootstrap_helper,simple_form,acts_as_tree,omniauth,omniauth-cas,omniauth-openid,doorkeeper,public_activity,rmagick,carrierwave,acts_as_category,bundler,rake HTTP/1.1" 200 4 "-" "Ruby"
需要 登录 后方可回复, 如果你还没有账号请 注册新账号