@zhangjinzhu 理解 我 QQ 你的网站客服 聊吧
@zhangjinzhu 回复很快;-)要不要早点开源,多些人来完善?我也有兴趣加入这个项目来贡献一些时间
可以考虑开源 呵呵
Uploader 可以改成用 carrierwave 来处理更稳定,扩展性也好些
redis 不是也可以做缓存吗?为什么还要使用 memcached 呢?
和 linode 相对,套餐内流量有点偏少了,超额流量单价也贵了 30%,不过给配的内存就比 linode 的多了一倍,各有千秋
在登录页面输入网店域名 + 邮箱 + 密码后,依然会弹出第二次登录窗口,需要输入邮箱和密码才能登录 这是设计好这样的流程还是出错了呢?
今天试用了一下,发现注册时停留在“正在创建您的商店”就没有反应了,等了很久也是这样子
聚会之后报道一下吧
非常不错 很开心的教程
挂了,nginx 还在用 0.7.65 版本老了点 估计是 0804 版本的 ubuntu 服务器
@night_song 我之前也是学习了这个方法搞定的 这个比较简便
谢谢各位 我最后用的是 @fsword 的 File.readlines(fname).uniq 是 ok 的
恩,谢谢反馈,我自己也是这么想的,如果没有更好的方法就用这种
搞定了,谢谢
换了 1.9.2 也出错。。。
/var/www9/shopqi$ sudo bundle install
/opt/ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/dsl.rb:7:in `instance_eval': /var/www9/shopqi/Gemfile:23: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' (SyntaxError)
gem 'carrierwave'
^
from /opt/ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/dsl.rb:7:in `evaluate'
from /opt/ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/definition.rb:17:in `build'
from /opt/ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler.rb:136:in `definition'
from /opt/ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install'
from /opt/ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run'
from /opt/ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /opt/ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /opt/ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start'
from /opt/ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/bin/bundle:13:in `<top (required)>'
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19:in `<main>'
sudo bundle install
/var/www0/shopqi/Gemfile:22:in `evaluate': compile error (SyntaxError)
/var/www0/shopqi/Gemfile:22: syntax error, unexpected ':', expecting $end
gem 'rack-cache', require: 'rack/cache‘
git clone 了 github 上面的代码后,提示 gemfile 不对
我也报名
已经入了一个 mac pro
是一个 android 手机端通过 json 格式和 redis 服务器交互数据的 case,有点 sns 的味道,类似于 japan life 这种休闲游戏, 想 uid 递增这种东西,其实应该是有一个公共的基类来做,还有普通字段的 get 和 set 也通过这个基类来和 redis 交互,对哈希表类型的支持等等
#8 楼 @huacnlee 请教 huacnlee , nouse 不知道你们建议的方法应该如何写?我的写法反而查询次数多了 model 里面 first_preview 方法定义:
has_many :first_preview, :class_name => 'Preview', :limit => 1
新写法如下
@themes = Theme.includes(:first_preview)......m
修改前执行结果:
Theme Load (0.2ms) SELECT `themes`.* FROM `themes` ORDER BY remseq, updated_at DESC
Preview Load (4.5ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id IN (69,107,106,98,96,61,62))
修改后执行结果:
Theme Load (2.6ms) SELECT `themes`.* FROM `themes` ORDER BY remseq, updated_at DESC
Preview Load (4.2ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id IN (69,107,98,61,62))
Preview Load (0.1ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 80) LIMIT 1
CACHE (0.0ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 80) LIMIT 1
Preview Load (0.1ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 97) LIMIT 1
CACHE (0.0ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 97) LIMIT 1
Preview Load (0.1ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 66) LIMIT 1
CACHE (0.0ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 66) LIMIT 1
Preview Load (0.1ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 12) LIMIT 1
CACHE (0.0ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 12) LIMIT 1
Preview Load (0.1ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 72) LIMIT 1
CACHE (0.0ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 72) LIMIT 1
Preview Load (0.1ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 65) LIMIT 1
CACHE (0.0ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 65) LIMIT 1
Preview Load (0.1ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 91) LIMIT 1
CACHE (0.0ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 91) LIMIT 1
Preview Load (0.1ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 71) LIMIT 1
CACHE (0.0ms) SELECT `previews`.* FROM `previews` WHERE (`previews`.theme_id = 71) LIMIT 1
优化前 N+1 条查询在 view 里面: Completed 200 OK in 137ms (Views: 108.5ms | ActiveRecord: 1.7ms) 优化后,2 条查询: Completed 200 OK in 165ms (Views: 18.1ms | ActiveRecord: 5.2ms) 查询总时间增加了,view 里面没有查询之后 快了很多
谢谢,已经建立了索引了 eager loading 可以解决这个问题
是的,我就是想请教这种情况如何优化