根據網上公開資料整理的Twitter架構,主要是cache方面,加了作者自己的補充,跟實際的架構未必完全一致。  一些數據: - Cache分Page cache, fragment cache, row cache, vector Cache, cache命中率見圖。
- Fragment cache存放了API各種請求格式的數據,包括XML, JSON, RSS, ATOM。
- 發表Tweets是先放入Kestrel, 再異步處理,Kestrel用的也是memcached協議。
- API requests: 550 r/s。
- POST tweets: 峰值:平時 80tweets/s, 奧巴馬就任時達到 350tweets/s。
- Aggregator模塊需要訪問memcached multi get 數百個/s。
- Ruby on Rails前面還用了Varnish作前端反向代理。
參考資料:
|