SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
cache



   1
Agenda

• Feed
•        Cache

•

                 2
•
•   ,       status feed

•


•
        3
Feed

•                 feed

    • Push(       )

    • Pull(   )

    •

                         4
Push
•     feed

    • Inbox:
    • Outbox:
•                    inbox(   )

•                Inbox( )

• Offline computation
                   5
Push

•
•


•
     6
Pull


•                 outbox( )

•                       Inbox(   )

• Online computation

                   7
Pull


•
•


     8
•



•
    9
Pull cache arch

  Inbox      Page cache




Outbox       Vector cache   Archive data




 Social       Following      Followers     users
 Graph



Content       Hot cache        Total




                              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
Memcache




       12
terminology


• content cache:
• vector cache: feed id list


                      13
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
1.

• 1,000         800Mbps

•1             8Gbps

 • facebook Memcache: 60GB ~ 120GB/s

                  16
1.

•   1G              300~400Mbps

•                  local cache

•
•

              17
2.

• gzip
• quicklz
• lzo
•            , zhangwei



                 18
3.
•1             100

•        100              memcache   10


• memcache udp
• Throughput/Latency/connections
• todo:         , zhangwei

                     19
4.
•                           key
      memcache

    •
    • LRU cache,
    • Memory storage
    •
                       20
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
6. mutex
•       content item    cache

    •           db

    •                           db

• key_mutex                      key

• mutex
•                mutex

                   22
6. mutex

•   2:           cache

•
•

            23
7. value list
• vector cache,              100

• {1,2,3,4...98,99.100}
•
• append/prepend
•                 get              set

                        24
8. memcache proxy

•        proxy

• pros
• cons

          25

Contenu connexe

Tendances

MongoDB Shell Tips & Tricks
MongoDB Shell Tips & TricksMongoDB Shell Tips & Tricks
MongoDB Shell Tips & Tricks
MongoDB
 
Shell Tips & Tricks
Shell Tips & TricksShell Tips & Tricks
Shell Tips & Tricks
MongoDB
 
C# Development (Sam Corder)
C# Development (Sam Corder)C# Development (Sam Corder)
C# Development (Sam Corder)
MongoSF
 
微博cache设计谈
微博cache设计谈微博cache设计谈
微博cache设计谈
Tim Y
 

Tendances (20)

Redis data modeling examples
Redis data modeling examplesRedis data modeling examples
Redis data modeling examples
 
Getting Started with MongoDB
Getting Started with MongoDBGetting Started with MongoDB
Getting Started with MongoDB
 
Introduction to MongoDB with PHP
Introduction to MongoDB with PHPIntroduction to MongoDB with PHP
Introduction to MongoDB with PHP
 
MongoDB Shell Tips & Tricks
MongoDB Shell Tips & TricksMongoDB Shell Tips & Tricks
MongoDB Shell Tips & Tricks
 
Message Decrypt
Message DecryptMessage Decrypt
Message Decrypt
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
 
Shell Tips & Tricks
Shell Tips & TricksShell Tips & Tricks
Shell Tips & Tricks
 
C# Development (Sam Corder)
C# Development (Sam Corder)C# Development (Sam Corder)
C# Development (Sam Corder)
 
Nodejs - A-quick-tour-v3
Nodejs - A-quick-tour-v3Nodejs - A-quick-tour-v3
Nodejs - A-quick-tour-v3
 
微博cache设计谈
微博cache设计谈微博cache设计谈
微博cache设计谈
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?
 
Guava
GuavaGuava
Guava
 
Nginx-lua
Nginx-luaNginx-lua
Nginx-lua
 
Node.js - A Quick Tour II
Node.js - A Quick Tour IINode.js - A Quick Tour II
Node.js - A Quick Tour II
 
Guava Overview Part 2 Bucharest JUG #2
Guava Overview Part 2 Bucharest JUG #2 Guava Overview Part 2 Bucharest JUG #2
Guava Overview Part 2 Bucharest JUG #2
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queue
 
Unqlite
UnqliteUnqlite
Unqlite
 
How do i Meet MongoDB
How do i Meet MongoDBHow do i Meet MongoDB
How do i Meet MongoDB
 

En vedette (9)

Mapaconceptualgerenciadeproyectos pedrobeltrán
Mapaconceptualgerenciadeproyectos pedrobeltránMapaconceptualgerenciadeproyectos pedrobeltrán
Mapaconceptualgerenciadeproyectos pedrobeltrán
 
Nnf march 9 re amp
Nnf march 9 re ampNnf march 9 re amp
Nnf march 9 re amp
 
Redis学习笔记
Redis学习笔记Redis学习笔记
Redis学习笔记
 
Evaluating networks slides_final_monitor3.8.11
Evaluating networks slides_final_monitor3.8.11Evaluating networks slides_final_monitor3.8.11
Evaluating networks slides_final_monitor3.8.11
 
Tup2王鹏云:实时搜索架构分析
Tup2王鹏云:实时搜索架构分析Tup2王鹏云:实时搜索架构分析
Tup2王鹏云:实时搜索架构分析
 
Tup2 人人网张铁安
Tup2 人人网张铁安Tup2 人人网张铁安
Tup2 人人网张铁安
 
שינויים ועדכונים בתקנים המקצועיים
שינויים ועדכונים בתקנים המקצועייםשינויים ועדכונים בתקנים המקצועיים
שינויים ועדכונים בתקנים המקצועיים
 
10 17-11 katherine-fulton_nw_presentation
10 17-11 katherine-fulton_nw_presentation10 17-11 katherine-fulton_nw_presentation
10 17-11 katherine-fulton_nw_presentation
 
אורות אדומים לתיאום מכרזים בישראל
אורות אדומים לתיאום מכרזים בישראלאורות אדומים לתיאום מכרזים בישראל
אורות אדומים לתיאום מכרזים בישראל
 

Similaire à Tup2 新浪杨卫华

S2weibocachearch 100726101949-phpapp02
S2weibocachearch 100726101949-phpapp02S2weibocachearch 100726101949-phpapp02
S2weibocachearch 100726101949-phpapp02
batistuta97
 
Timyang新浪微博设计谈
Timyang新浪微博设计谈Timyang新浪微博设计谈
Timyang新浪微博设计谈
Cevin Cheung
 
BuilHigh Performance Weibo Platform-Qcon2011
BuilHigh Performance Weibo Platform-Qcon2011BuilHigh Performance Weibo Platform-Qcon2011
BuilHigh Performance Weibo Platform-Qcon2011
Yiwei Ma
 
Intro to big data choco devday - 23-01-2014
Intro to big data   choco devday - 23-01-2014Intro to big data   choco devday - 23-01-2014
Intro to big data choco devday - 23-01-2014
Hassan Islamov
 
Why the Address Translation Scheme Matters?
Why the Address Translation Scheme Matters?Why the Address Translation Scheme Matters?
Why the Address Translation Scheme Matters?
Jiaqing Du
 

Similaire à Tup2 新浪杨卫华 (20)

S2weibocachearch 100726101949-phpapp02
S2weibocachearch 100726101949-phpapp02S2weibocachearch 100726101949-phpapp02
S2weibocachearch 100726101949-phpapp02
 
Timyang新浪微博设计谈
Timyang新浪微博设计谈Timyang新浪微博设计谈
Timyang新浪微博设计谈
 
High Performance Weibo QCon Beijing 2011
High Performance Weibo QCon Beijing 2011High Performance Weibo QCon Beijing 2011
High Performance Weibo QCon Beijing 2011
 
视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)
 
MongoDB开发应用实践
MongoDB开发应用实践MongoDB开发应用实践
MongoDB开发应用实践
 
Cache on Delivery
Cache on DeliveryCache on Delivery
Cache on Delivery
 
MongoDB使用技巧
MongoDB使用技巧MongoDB使用技巧
MongoDB使用技巧
 
BuilHigh Performance Weibo Platform-Qcon2011
BuilHigh Performance Weibo Platform-Qcon2011BuilHigh Performance Weibo Platform-Qcon2011
BuilHigh Performance Weibo Platform-Qcon2011
 
Cassandra 分散データベース
Cassandra 分散データベースCassandra 分散データベース
Cassandra 分散データベース
 
Kiosk / PHP
Kiosk / PHP Kiosk / PHP
Kiosk / PHP
 
Intro to big data choco devday - 23-01-2014
Intro to big data   choco devday - 23-01-2014Intro to big data   choco devday - 23-01-2014
Intro to big data choco devday - 23-01-2014
 
Memcached Code Camp 2009
Memcached Code Camp 2009Memcached Code Camp 2009
Memcached Code Camp 2009
 
下吧开发总结
下吧开发总结下吧开发总结
下吧开发总结
 
Preventing and Resolving MySQL Downtime
Preventing and Resolving MySQL DowntimePreventing and Resolving MySQL Downtime
Preventing and Resolving MySQL Downtime
 
Everything I Ever Learned About JVM Performance Tuning @Twitter
Everything I Ever Learned About JVM Performance Tuning @TwitterEverything I Ever Learned About JVM Performance Tuning @Twitter
Everything I Ever Learned About JVM Performance Tuning @Twitter
 
新浪微博开放平台Redis实战
新浪微博开放平台Redis实战新浪微博开放平台Redis实战
新浪微博开放平台Redis实战
 
Using Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.comUsing Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.com
 
Debugging Hive with Hadoop-in-the-Cloud by David Chaiken of Altiscale
Debugging Hive with Hadoop-in-the-Cloud by David Chaiken of AltiscaleDebugging Hive with Hadoop-in-the-Cloud by David Chaiken of Altiscale
Debugging Hive with Hadoop-in-the-Cloud by David Chaiken of Altiscale
 
Improving Hadoop Performance via Linux
Improving Hadoop Performance via LinuxImproving Hadoop Performance via Linux
Improving Hadoop Performance via Linux
 
Why the Address Translation Scheme Matters?
Why the Address Translation Scheme Matters?Why the Address Translation Scheme Matters?
Why the Address Translation Scheme Matters?
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Dernier (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Tup2 新浪杨卫华