Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Tup2 新浪杨卫华

917 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Tup2 新浪杨卫华

  1. 1. cache 1
  2. 2. Agenda• Feed• Cache• 2
  3. 3. •• , status feed•• 3
  4. 4. Feed• feed • Push( ) • Pull( ) • 4
  5. 5. Push• feed • Inbox: • Outbox:• inbox( )• Inbox( )• Offline computation 5
  6. 6. Push••• 6
  7. 7. Pull• outbox( )• Inbox( )• Online computation 7
  8. 8. Pull•• 8
  9. 9. •• 9
  10. 10. Pull cache arch Inbox Page cacheOutbox Vector cache Archive data Social Following Followers users GraphContent Hot cache Total 10
  11. 11. Cachememory is the new disk,and disk is the new tape.for "real-time" web applications,and systems that require massive scalability - Jim Gray 11
  12. 12. Memcache 12
  13. 13. terminology• content cache:• vector cache: feed id list 13
  14. 14. content cache• multi get n (n = items/page, e.g. 50)• size = n * length of feed + header (e.g. 2k)• concurrent requests / sec, e.g. 1,000• total = 50 * 2k * 1000 / sec• total = 100M * 8bit = 800Mbps 14
  15. 15. 15
  16. 16. 1.• 1,000 800Mbps•1 8Gbps • facebook Memcache: 60GB ~ 120GB/s 16
  17. 17. 1.• 1G 300~400Mbps• local cache•• 17
  18. 18. 2.• gzip• quicklz• lzo• , zhangwei 18
  19. 19. 3.•1 100• 100 memcache 10• memcache udp• Throughput/Latency/connections• todo: , zhangwei 19
  20. 20. 4.• key memcache • • LRU cache, • Memory storage • 20
  21. 21. 5. 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 21
  22. 22. 6. mutex• content item cache • db • db• key_mutex key• mutex• mutex 22
  23. 23. 6. mutex• 2: cache•• 23
  24. 24. 7. value list• vector cache, 100• {1,2,3,4...98,99.100}•• append/prepend• get set 24
  25. 25. 8. memcache proxy• proxy• pros• cons 25

×