EngineYard Blog 10/13 發表的一篇文章:Rails in the Wild: 5 Client-Side Performance Observations
五個重點:
1.
rails 發表在 痞客邦 留言(0) 人氣(162)
在開發時,使用 partial 是相當簡潔以及迅速的做法。但這會帶來一個壞處。造成相當多的 db query 以及 render :partial 這個行為帶來的 slow down。
解法是,在 controller 下 find all 時,順便下 :include ,把相關的 model 都拉一拉回來。
至於 partial 這部份,就使用 fragment cache 的做法,把 html 丟進 memcache ..XD。時間到 expire 掉。
rails 發表在 痞客邦 留言(0) 人氣(268)
使用 Data Fabric 這個 gem。
這個 gem 的想法是建一個 proxy,先去問 mapping table,然後要資料時 reset db connection 去該負責的 db 拿資料。
rails 發表在 痞客邦 留言(0) 人氣(138)
Splitting up Rails Models to different databases
然後在 lib/tasks/dev.rake 裡寫 override db:create; db:drop 的 rake; 確保重建資料時一致
rails 發表在 痞客邦 留言(0) 人氣(77)
可指定 asset_host 為 http://asset%d.example.com
或
rails 發表在 痞客邦 留言(0) 人氣(61)
原文刊載於 EngineYard 。
1) Cache, cache, cache and more cache.
能 Cache 的盡量 cache,不論是 Client Caching 或者是 Server-side Caching。
rails 發表在 痞客邦 留言(0) 人氣(157)