Your SlideShare is downloading. ×
Timyang新浪微博设计谈
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Timyang新浪微博设计谈

1,482
views

Published on

Published in: Technology

0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,482
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
61
Comments
0
Likes
6
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. cache @TimYang
  • 2. Agenda • Feed • Cache •
  • 3. • • , status feed • •
  • 4. Feed • feed • Push( ) • Pull( ) •
  • 5. Push • feed • Inbox: • Outbox: • inbox( ) • Inbox( ) • Offline computation
  • 6. Push • • •
  • 7. Pull • outbox( ) • Inbox( ) • Online computation
  • 8. Pull • •
  • 9. • • •
  • 10. Cache memory is the new disk, and disk is the new tape. for "real-time" web applications, and systems that require massive scalability - Jim Gray
  • 11. Cache
  • 12. cache Weibo cache arch Inbox hot cache Outbox Vector cache Archive cache Social Following Followers users Graph Content Hot cache Total
  • 13. Inbox • “ ” • cache id list • (hot cache) • get set • redis list/set
  • 14. Outbox • • id list(e.g. 100) • id LRU
  • 15. Social Graph cache • Following ids • Followers • • • delete all • followers list
  • 16. Content cache • cache • • • • Open API xml, json...
  • 17. Cache • •
  • 18. Update Workflow Update status Content cache Hot Inbox Vector Outbox vector Content cache replication
  • 19. • outbox hot vector • followers list • inbox
  • 20. feed Home timeline Workflow home_timeline aggregator Content hot Inbox cache Outbox Vector cache Inbox archive Inbox archive Content cache
  • 21. feed • inbox cache • • , following • id list feed
  • 22. cache • • hot keys • • mutex
  • 23. • Content cache • multi get n feed(n = items/ , e.g. 50) • cache = n * (feed + , e.g. 2k) • 1,000 / • = 50 * 2k * 1,000 / sec = 100MB
  • 24. • 1,000 800Mbps •1 8Gbps
  • 25. • 1G 300~400Mbps • • local cache • •
  • 26. hot keys • content cache of • create local cache 1. get user_yaochen_local 2. get user_yaochen 1. set user_yaochen_local:value 3. delete all
  • 27. cache • key memcache • • LRU cache, • Memory storage •
  • 28. mutex • content item cache • db • db • key_mutex key • mutex • mutex
  • 29. • • • less is more •
  • 30. • • code review •
  • 31. • Q&A • weihua2@staff.sina.com.cn

×