SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Introducing 2go

• Instant   messenger for Java phones

• Send   messages to friends

• Share   photos and files

• Connect    with other IM networks

• Meet   others in chat rooms

• And   more...
Why it’s popular

• Cheaper     than SMS (1 cent/message)

• Fast    on slow networks

• Designed         for mobile phones

• It’s   social!
The Beginning

• Founded    by Alan Wolff, Ashley Peter

•6   months of coding, learning, not studying

• Clueless   about ‘scaling’

•1   desktop PC as server

• Launched    in March 2007
Registered Users
20

                         16



10




                        1Day
Registered Users
300
                                  254



150




      1 Day                      1 Week
Registered Users
1 500


                              1 159


 750




        1 Week               1 Month
Registered Users
150 000
                                124 500



 75 000




   1 Month                       1 Year
Registered Users
15 100 000
                         15 000 000+



 7 550 000




             1 Year             Today
2go Today

• Over   15 million users

• Users    in over 150 countries
 •   Mostly in Africa (Nigeria, South Africa, Kenya)

• Fastest
        rising Google search term in Nigeria and Kenya
 in 2010

• 200   million messages per day

• 20   million logins per day

• 45   thousand signups per day
Why we’re at ScaleConf

• Raise   awareness about scaling
 • Not   a common problem

 • Not   covered in formal education

• Learn    from others

• Share    our lessons with you
Scaling
What is ‘scaling’?


  Ability to accommodate
growing volumes of users on
       your network.
Why is scaling important?

 Consequences of not scaling:


   Slow service
            OR
     No service
Why is scaling important?


All high demand services will
    eventually face scaling
         challenges.
3 scaling techniques

1.Vertical scaling
 • Upgrade    hardware

2.Parallelism
 • Execute    in parallel

3.Horizontal scaling
 • Division
How does 2go scale?

1.Vertical scaling
 • Upgrade    hardware

     USE A
2.Parallelism
              LL TH
 • Execute         R
              in parallel   EE!
3.Horizontal scaling
 • Division
Data layer


Application layer


OS & network layer
Data layer


Application layer


OS & network layer
Traditional Websites Data




John        Server     John’s Data
Traditional Websites Data

• Users    interact with own data

• Users    expect RAM speeds
 • Easy   to keep ‘hot’ data in RAM

• Normally      1-2% of users are concurrent

• Website     grows, add more servers
Traditional Websites Data


                John’s                    Sam’s
John   Server            Sam     Server
                 Data                     Data




                Mary’s                    Elina’s
Mary   Server            Elina   Server
                Data                      Data
Social Networks Data
                         John’s Data

                         Sara’s Data

                         James’ Data
John          Server

                          Julie’s Data

                               ...

                         Chris’ Data
Social Networks Data
                       John’s Data
John        Server

                       Sara’s Data

Sara        Server
                       James’ Data

                       Anni’s Data
James       Server
                           ...

Anni        Server     Chris’ Data
Social Networks Data

• Users   have many (100+) friends

• Users   interact with friends’ data

• Data   access is geometric
Quick Example

• 600   users login per second

• Each   user has 100 friends = 600*100 = 60k

• Get   60k users’ data (name, status, image) = 60k * 3

•=   180k objects per second

• Not   possible on 1 or 2 servers

• Need   10+ DB servers!
Social Networks Data

• Users   have many (100+) friends

• Users   interact with friends’ data

• Data   access is geometric

• Accessing180k objects in 1 second means
 hitting many DB servers

• Difficult   to keep ‘hot’ data in RAM
How we store & retrieve data


               MySQL
          persistent, disk based



          Memcached
           volatile, RAM based
Why do we use MySQL?

• Reliable

 •   Never had data corruption

• Simple

• Free

• Good,    helpful community

• Widely    used, well understood
How do we scale MySQL?

• Vertical    Scaling:
 •   Disks, RAID

• Parallelism:

 •   Multiple connections to MySQL

 •   MyISAM (default) has table locking, use InnoDB for row
     locking

 •   Replication (scales reads)
MySQL Replication


      DB Master


     500 reads/s



     200 writes/s
MySQL Replication

DB Master         DB Master       DB Slave1


500 reads/s
                  250 reads/s    250 reads/s

200 writes/s      200 writes/s   200 writes/s
MySQL Replication

DB Master       DB Slave1      DB Slave2     DB Slave3
2 reads/s       2 reads/s      2 reads/s     2 reads/s



698 writes/s   698 writes/s   698 writes/s   698 writes/s




     Write saturation
How do we scale MySQL?

• Parallelism:

 •   Multiple connections to MySQL

 •   MyISAM (default) has table locking, user InnoDB for row locking

 •   Replication (scales reads)

• Horizontal      Scaling:
 •   Split data onto multiple masters. ‘sharding’. (scales writes)

 •   Bye bye relational DB. Joining data moves to application level
MySQL

      The biggest issue:


MySQL stores data on disk.
Users expect RAM speeds.

  We have a problem...
Enter Memcached...
What is Memcached?

• Developed    by Brad Fitzpatrick at
 LiveJournal

• In-memory     LRU distributed hash table

• ‘Hot’   data stored in the cache

• Manually    managed cache
Why do we use Memcached?

• It’s   fast
  •   Really.

• Alleviates    DB load

• Distributed

• Low     latency

• Also,    it’s fast
Issues with Memcache:
•   Manually managed
    •   Stale cache is bad
    •   Manage with caution

•   Race conditions
•   Serialise data
    •   Storing strings is inefficient
    •   Use binary protocol

•   New connection overhead
    •   Use connection pools or UDP

•   Multiget
Data Overview
query = SELECT name from Users WHERE userId
= 1234;

result = getFromMemcache(user_name_1234);

// Return cached result (FAST!)
if (result != null) return result;

// Get from DB (slow...)
result = getFromDB(query);

// Add to cache (fast next time!)
putInMemcache(user_name_1234, result);

return result;
Data layer


Application layer


OS & Network layer
Application Layer

• We   use Java
 •   Works well

 •   Learn to tune JVM

• Different    backend services
 •   Some services have multiple instances

• Services    communicate with messaging protocol
How do we scale applications?

• Vertical    Scaling:
 •   Multicore CPUs, faster cores, more RAM

• Parallelism:
 •   Multithreaded applications
 •   Connection pools

• Horizontal      Scaling:
 •   Different services, split by functionality
 •   Some services have multiple instances
 •   Load balancing to instances via LVS
Data layer


Application layer


OS & network layer
OS & network layers

• We   use Linux
 •   Follow kernel developments

 •   Apply relevant patches

• Puppet

• Tune    Linux and shell to handle many connections
 •   C10K problem

• Experiment      with virtualization
Data layer


Application layer


OS & Network layer
General scaling tips

• Start   simple, don’t over engineer

• Scaling   is problem solving
Scaling cycle

              Problem!




Apply fix                   Isolate cause




             Understand
               cause
More scaling tips

• Understand       and consider the entire stack
 •   Hardware (CPU, RAM, Disks, NIC)

 •   OS (Paging, memory allocation, kernel)

 •   Application layer (DB, language)

• Step   back

• Look    forward
 •   Fix tomorrow’s problems before they become today’s
Q&A
Wrapping up

• It’s   been an interesting journey

• We’re    opening in Cape Town
 • ...we’re   recruiting!

• We’d    love to hear feedback
Thanks



ashley@2go.im

www.2go.im

Weitere ähnliche Inhalte

Andere mochten auch

20 yrs marketing plans silubrico
20 yrs marketing plans silubrico20 yrs marketing plans silubrico
20 yrs marketing plans silubricosue_silubrico
 
Cebu pacific airline international seat sale jul - dec 2011
Cebu pacific airline international seat sale   jul - dec 2011Cebu pacific airline international seat sale   jul - dec 2011
Cebu pacific airline international seat sale jul - dec 2011joeychee
 
V47 10 step marketing plan batisan ronaldo
V47 10 step marketing plan batisan ronaldoV47 10 step marketing plan batisan ronaldo
V47 10 step marketing plan batisan ronaldorsbatisan
 
QMD - 2GO PLANS & PROGRAMS 2014
QMD - 2GO PLANS & PROGRAMS 2014QMD - 2GO PLANS & PROGRAMS 2014
QMD - 2GO PLANS & PROGRAMS 2014Daniel Slakmon
 
Top 10 step marketing plan
Top 10 step marketing planTop 10 step marketing plan
Top 10 step marketing plansue_silubrico
 
10 step marketing plan for globe tattoo
10 step marketing plan for globe tattoo10 step marketing plan for globe tattoo
10 step marketing plan for globe tattooiyeen
 
Cebu Pacific Principles of Manangement and Organization
Cebu Pacific Principles of Manangement and OrganizationCebu Pacific Principles of Manangement and Organization
Cebu Pacific Principles of Manangement and OrganizationAi Lun Wu
 
V53 cha cha mordeno 10 step marketing plan
V53 cha cha mordeno 10 step marketing planV53 cha cha mordeno 10 step marketing plan
V53 cha cha mordeno 10 step marketing planMaria Charriza Mordeno
 
Beyond The Election: the three main political parties' plans for local govern...
Beyond The Election: the three main political parties' plans for local govern...Beyond The Election: the three main political parties' plans for local govern...
Beyond The Election: the three main political parties' plans for local govern...BDO
 
Product Marketing Plan for Sun Cellular
Product Marketing Plan for Sun CellularProduct Marketing Plan for Sun Cellular
Product Marketing Plan for Sun Cellularmendozamaryrose
 
Greenwich Presentation
Greenwich PresentationGreenwich Presentation
Greenwich PresentationRandee Bato
 
10 Step Marketing Plan for Cebu Pacific Air
10 Step Marketing Plan for Cebu Pacific Air10 Step Marketing Plan for Cebu Pacific Air
10 Step Marketing Plan for Cebu Pacific AirSheilanor Turingan
 
10 Step Marketing Plan Cebu Pacific
10 Step Marketing Plan Cebu Pacific10 Step Marketing Plan Cebu Pacific
10 Step Marketing Plan Cebu PacificLouie Mark Quizon
 
Cebu Pacific Air SPACE Matrix, BCG Matrix, Product Positioning Map
Cebu Pacific Air SPACE Matrix, BCG Matrix, Product Positioning MapCebu Pacific Air SPACE Matrix, BCG Matrix, Product Positioning Map
Cebu Pacific Air SPACE Matrix, BCG Matrix, Product Positioning MapMita Angela M. Dimalanta
 
10 step marketing plan for Mang Inasal
10 step marketing plan for Mang Inasal10 step marketing plan for Mang Inasal
10 step marketing plan for Mang Inasalriaabendan
 
7-p’s-of-telecom-industry
7-p’s-of-telecom-industry7-p’s-of-telecom-industry
7-p’s-of-telecom-industryKunal Kore
 
7 Ps of Coca Cola
7 Ps of Coca Cola7 Ps of Coca Cola
7 Ps of Coca ColaRavi Rai
 

Andere mochten auch (20)

20 yrs marketing plans silubrico
20 yrs marketing plans silubrico20 yrs marketing plans silubrico
20 yrs marketing plans silubrico
 
7ps of a travel blog
7ps of a travel blog7ps of a travel blog
7ps of a travel blog
 
Cebu pacific airline international seat sale jul - dec 2011
Cebu pacific airline international seat sale   jul - dec 2011Cebu pacific airline international seat sale   jul - dec 2011
Cebu pacific airline international seat sale jul - dec 2011
 
V47 10 step marketing plan batisan ronaldo
V47 10 step marketing plan batisan ronaldoV47 10 step marketing plan batisan ronaldo
V47 10 step marketing plan batisan ronaldo
 
QMD - 2GO PLANS & PROGRAMS 2014
QMD - 2GO PLANS & PROGRAMS 2014QMD - 2GO PLANS & PROGRAMS 2014
QMD - 2GO PLANS & PROGRAMS 2014
 
Top 10 step marketing plan
Top 10 step marketing planTop 10 step marketing plan
Top 10 step marketing plan
 
10 step marketing plan for globe tattoo
10 step marketing plan for globe tattoo10 step marketing plan for globe tattoo
10 step marketing plan for globe tattoo
 
Cebu Pacific Principles of Manangement and Organization
Cebu Pacific Principles of Manangement and OrganizationCebu Pacific Principles of Manangement and Organization
Cebu Pacific Principles of Manangement and Organization
 
V53 cha cha mordeno 10 step marketing plan
V53 cha cha mordeno 10 step marketing planV53 cha cha mordeno 10 step marketing plan
V53 cha cha mordeno 10 step marketing plan
 
Beyond The Election: the three main political parties' plans for local govern...
Beyond The Election: the three main political parties' plans for local govern...Beyond The Election: the three main political parties' plans for local govern...
Beyond The Election: the three main political parties' plans for local govern...
 
Product Marketing Plan for Sun Cellular
Product Marketing Plan for Sun CellularProduct Marketing Plan for Sun Cellular
Product Marketing Plan for Sun Cellular
 
Greenwich Presentation
Greenwich PresentationGreenwich Presentation
Greenwich Presentation
 
10 Step Marketing Plan for Cebu Pacific Air
10 Step Marketing Plan for Cebu Pacific Air10 Step Marketing Plan for Cebu Pacific Air
10 Step Marketing Plan for Cebu Pacific Air
 
10 Step Marketing Plan Cebu Pacific
10 Step Marketing Plan Cebu Pacific10 Step Marketing Plan Cebu Pacific
10 Step Marketing Plan Cebu Pacific
 
Cebu Pacific Air SPACE Matrix, BCG Matrix, Product Positioning Map
Cebu Pacific Air SPACE Matrix, BCG Matrix, Product Positioning MapCebu Pacific Air SPACE Matrix, BCG Matrix, Product Positioning Map
Cebu Pacific Air SPACE Matrix, BCG Matrix, Product Positioning Map
 
10 step marketing plan for Mang Inasal
10 step marketing plan for Mang Inasal10 step marketing plan for Mang Inasal
10 step marketing plan for Mang Inasal
 
7ps of Mcdonald's
7ps of Mcdonald's7ps of Mcdonald's
7ps of Mcdonald's
 
7 Ps Of Fed Ex
7 Ps Of Fed Ex7 Ps Of Fed Ex
7 Ps Of Fed Ex
 
7-p’s-of-telecom-industry
7-p’s-of-telecom-industry7-p’s-of-telecom-industry
7-p’s-of-telecom-industry
 
7 Ps of Coca Cola
7 Ps of Coca Cola7 Ps of Coca Cola
7 Ps of Coca Cola
 

Ähnlich wie 2go ScaleConf 2012

Why would I store my data in more than one database?
Why would I store my data in more than one database?Why would I store my data in more than one database?
Why would I store my data in more than one database?Kurtosys Systems
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's ArchitectureTony Tam
 
Add Redis to Postgres to Make Your Microservices Go Boom!
Add Redis to Postgres to Make Your Microservices Go Boom!Add Redis to Postgres to Make Your Microservices Go Boom!
Add Redis to Postgres to Make Your Microservices Go Boom!Dave Nielsen
 
AWS re:Invent 2016| GAM302 | Sony PlayStation: Breaking the Bandwidth Barrier...
AWS re:Invent 2016| GAM302 | Sony PlayStation: Breaking the Bandwidth Barrier...AWS re:Invent 2016| GAM302 | Sony PlayStation: Breaking the Bandwidth Barrier...
AWS re:Invent 2016| GAM302 | Sony PlayStation: Breaking the Bandwidth Barrier...Amazon Web Services
 
PlayStation and Lucene - Indexing 1M documents per second: Presented by Alexa...
PlayStation and Lucene - Indexing 1M documents per second: Presented by Alexa...PlayStation and Lucene - Indexing 1M documents per second: Presented by Alexa...
PlayStation and Lucene - Indexing 1M documents per second: Presented by Alexa...Lucidworks
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systemselliando dias
 
Running MongoDB in the Cloud
Running MongoDB in the CloudRunning MongoDB in the Cloud
Running MongoDB in the CloudTony Tam
 
What Drove Wordnik Non-Relational?
What Drove Wordnik Non-Relational?What Drove Wordnik Non-Relational?
What Drove Wordnik Non-Relational?DATAVERSITY
 
SFU Identity Management Overview
SFU Identity Management OverviewSFU Identity Management Overview
SFU Identity Management OverviewJeremy Rosenberg
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?DATAVERSITY
 
Alexei vladishev - Open Source Monitoring With Zabbix
Alexei vladishev - Open Source Monitoring With ZabbixAlexei vladishev - Open Source Monitoring With Zabbix
Alexei vladishev - Open Source Monitoring With ZabbixAndré Déo
 
Atmosphere Conference 2015: Service Operations Evolution at Spotify
Atmosphere Conference 2015: Service Operations Evolution at SpotifyAtmosphere Conference 2015: Service Operations Evolution at Spotify
Atmosphere Conference 2015: Service Operations Evolution at SpotifyPROIDEA
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterJohn Adams
 
Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that growGibraltar Software
 
DataEngConf SF16 - Scalable and Reliable Logging at Pinterest
DataEngConf SF16 - Scalable and Reliable Logging at PinterestDataEngConf SF16 - Scalable and Reliable Logging at Pinterest
DataEngConf SF16 - Scalable and Reliable Logging at PinterestHakka Labs
 
Scalable and Reliable Logging at Pinterest
Scalable and Reliable Logging at PinterestScalable and Reliable Logging at Pinterest
Scalable and Reliable Logging at PinterestKrishna Gade
 
Scaling Your Database in the Cloud
Scaling Your Database in the CloudScaling Your Database in the Cloud
Scaling Your Database in the CloudRightScale
 
Database Expert Q&A from 2600hz and Cloudant
Database Expert Q&A from 2600hz and CloudantDatabase Expert Q&A from 2600hz and Cloudant
Database Expert Q&A from 2600hz and CloudantJoshua Goldbard
 
PlayStation and Searchable Cassandra Without Solr (Dustin Pham & Alexander Fi...
PlayStation and Searchable Cassandra Without Solr (Dustin Pham & Alexander Fi...PlayStation and Searchable Cassandra Without Solr (Dustin Pham & Alexander Fi...
PlayStation and Searchable Cassandra Without Solr (Dustin Pham & Alexander Fi...DataStax
 
Development of concurrent services using In-Memory Data Grids
Development of concurrent services using In-Memory Data GridsDevelopment of concurrent services using In-Memory Data Grids
Development of concurrent services using In-Memory Data Gridsjlorenzocima
 

Ähnlich wie 2go ScaleConf 2012 (20)

Why would I store my data in more than one database?
Why would I store my data in more than one database?Why would I store my data in more than one database?
Why would I store my data in more than one database?
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
 
Add Redis to Postgres to Make Your Microservices Go Boom!
Add Redis to Postgres to Make Your Microservices Go Boom!Add Redis to Postgres to Make Your Microservices Go Boom!
Add Redis to Postgres to Make Your Microservices Go Boom!
 
AWS re:Invent 2016| GAM302 | Sony PlayStation: Breaking the Bandwidth Barrier...
AWS re:Invent 2016| GAM302 | Sony PlayStation: Breaking the Bandwidth Barrier...AWS re:Invent 2016| GAM302 | Sony PlayStation: Breaking the Bandwidth Barrier...
AWS re:Invent 2016| GAM302 | Sony PlayStation: Breaking the Bandwidth Barrier...
 
PlayStation and Lucene - Indexing 1M documents per second: Presented by Alexa...
PlayStation and Lucene - Indexing 1M documents per second: Presented by Alexa...PlayStation and Lucene - Indexing 1M documents per second: Presented by Alexa...
PlayStation and Lucene - Indexing 1M documents per second: Presented by Alexa...
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systems
 
Running MongoDB in the Cloud
Running MongoDB in the CloudRunning MongoDB in the Cloud
Running MongoDB in the Cloud
 
What Drove Wordnik Non-Relational?
What Drove Wordnik Non-Relational?What Drove Wordnik Non-Relational?
What Drove Wordnik Non-Relational?
 
SFU Identity Management Overview
SFU Identity Management OverviewSFU Identity Management Overview
SFU Identity Management Overview
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
 
Alexei vladishev - Open Source Monitoring With Zabbix
Alexei vladishev - Open Source Monitoring With ZabbixAlexei vladishev - Open Source Monitoring With Zabbix
Alexei vladishev - Open Source Monitoring With Zabbix
 
Atmosphere Conference 2015: Service Operations Evolution at Spotify
Atmosphere Conference 2015: Service Operations Evolution at SpotifyAtmosphere Conference 2015: Service Operations Evolution at Spotify
Atmosphere Conference 2015: Service Operations Evolution at Spotify
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling Twitter
 
Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that grow
 
DataEngConf SF16 - Scalable and Reliable Logging at Pinterest
DataEngConf SF16 - Scalable and Reliable Logging at PinterestDataEngConf SF16 - Scalable and Reliable Logging at Pinterest
DataEngConf SF16 - Scalable and Reliable Logging at Pinterest
 
Scalable and Reliable Logging at Pinterest
Scalable and Reliable Logging at PinterestScalable and Reliable Logging at Pinterest
Scalable and Reliable Logging at Pinterest
 
Scaling Your Database in the Cloud
Scaling Your Database in the CloudScaling Your Database in the Cloud
Scaling Your Database in the Cloud
 
Database Expert Q&A from 2600hz and Cloudant
Database Expert Q&A from 2600hz and CloudantDatabase Expert Q&A from 2600hz and Cloudant
Database Expert Q&A from 2600hz and Cloudant
 
PlayStation and Searchable Cassandra Without Solr (Dustin Pham & Alexander Fi...
PlayStation and Searchable Cassandra Without Solr (Dustin Pham & Alexander Fi...PlayStation and Searchable Cassandra Without Solr (Dustin Pham & Alexander Fi...
PlayStation and Searchable Cassandra Without Solr (Dustin Pham & Alexander Fi...
 
Development of concurrent services using In-Memory Data Grids
Development of concurrent services using In-Memory Data GridsDevelopment of concurrent services using In-Memory Data Grids
Development of concurrent services using In-Memory Data Grids
 

Kürzlich hochgeladen

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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 educationjfdjdjcjdnsjd
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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, ...apidays
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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, ...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

2go ScaleConf 2012

  • 1.
  • 2. Introducing 2go • Instant messenger for Java phones • Send messages to friends • Share photos and files • Connect with other IM networks • Meet others in chat rooms • And more...
  • 3. Why it’s popular • Cheaper than SMS (1 cent/message) • Fast on slow networks • Designed for mobile phones • It’s social!
  • 4. The Beginning • Founded by Alan Wolff, Ashley Peter •6 months of coding, learning, not studying • Clueless about ‘scaling’ •1 desktop PC as server • Launched in March 2007
  • 5. Registered Users 20 16 10 1Day
  • 6. Registered Users 300 254 150 1 Day 1 Week
  • 7. Registered Users 1 500 1 159 750 1 Week 1 Month
  • 8. Registered Users 150 000 124 500 75 000 1 Month 1 Year
  • 9. Registered Users 15 100 000 15 000 000+ 7 550 000 1 Year Today
  • 10. 2go Today • Over 15 million users • Users in over 150 countries • Mostly in Africa (Nigeria, South Africa, Kenya) • Fastest rising Google search term in Nigeria and Kenya in 2010 • 200 million messages per day • 20 million logins per day • 45 thousand signups per day
  • 11. Why we’re at ScaleConf • Raise awareness about scaling • Not a common problem • Not covered in formal education • Learn from others • Share our lessons with you
  • 13. What is ‘scaling’? Ability to accommodate growing volumes of users on your network.
  • 14. Why is scaling important? Consequences of not scaling: Slow service OR No service
  • 15. Why is scaling important? All high demand services will eventually face scaling challenges.
  • 16. 3 scaling techniques 1.Vertical scaling • Upgrade hardware 2.Parallelism • Execute in parallel 3.Horizontal scaling • Division
  • 17. How does 2go scale? 1.Vertical scaling • Upgrade hardware USE A 2.Parallelism LL TH • Execute R in parallel EE! 3.Horizontal scaling • Division
  • 20. Traditional Websites Data John Server John’s Data
  • 21. Traditional Websites Data • Users interact with own data • Users expect RAM speeds • Easy to keep ‘hot’ data in RAM • Normally 1-2% of users are concurrent • Website grows, add more servers
  • 22. Traditional Websites Data John’s Sam’s John Server Sam Server Data Data Mary’s Elina’s Mary Server Elina Server Data Data
  • 23. Social Networks Data John’s Data Sara’s Data James’ Data John Server Julie’s Data ... Chris’ Data
  • 24. Social Networks Data John’s Data John Server Sara’s Data Sara Server James’ Data Anni’s Data James Server ... Anni Server Chris’ Data
  • 25. Social Networks Data • Users have many (100+) friends • Users interact with friends’ data • Data access is geometric
  • 26. Quick Example • 600 users login per second • Each user has 100 friends = 600*100 = 60k • Get 60k users’ data (name, status, image) = 60k * 3 •= 180k objects per second • Not possible on 1 or 2 servers • Need 10+ DB servers!
  • 27. Social Networks Data • Users have many (100+) friends • Users interact with friends’ data • Data access is geometric • Accessing180k objects in 1 second means hitting many DB servers • Difficult to keep ‘hot’ data in RAM
  • 28. How we store & retrieve data MySQL persistent, disk based Memcached volatile, RAM based
  • 29. Why do we use MySQL? • Reliable • Never had data corruption • Simple • Free • Good, helpful community • Widely used, well understood
  • 30. How do we scale MySQL? • Vertical Scaling: • Disks, RAID • Parallelism: • Multiple connections to MySQL • MyISAM (default) has table locking, use InnoDB for row locking • Replication (scales reads)
  • 31. MySQL Replication DB Master 500 reads/s 200 writes/s
  • 32. MySQL Replication DB Master DB Master DB Slave1 500 reads/s 250 reads/s 250 reads/s 200 writes/s 200 writes/s 200 writes/s
  • 33. MySQL Replication DB Master DB Slave1 DB Slave2 DB Slave3 2 reads/s 2 reads/s 2 reads/s 2 reads/s 698 writes/s 698 writes/s 698 writes/s 698 writes/s Write saturation
  • 34. How do we scale MySQL? • Parallelism: • Multiple connections to MySQL • MyISAM (default) has table locking, user InnoDB for row locking • Replication (scales reads) • Horizontal Scaling: • Split data onto multiple masters. ‘sharding’. (scales writes) • Bye bye relational DB. Joining data moves to application level
  • 35. MySQL The biggest issue: MySQL stores data on disk. Users expect RAM speeds. We have a problem...
  • 37. What is Memcached? • Developed by Brad Fitzpatrick at LiveJournal • In-memory LRU distributed hash table • ‘Hot’ data stored in the cache • Manually managed cache
  • 38. Why do we use Memcached? • It’s fast • Really. • Alleviates DB load • Distributed • Low latency • Also, it’s fast
  • 39. Issues with Memcache: • Manually managed • Stale cache is bad • Manage with caution • Race conditions • Serialise data • Storing strings is inefficient • Use binary protocol • New connection overhead • Use connection pools or UDP • Multiget
  • 40. Data Overview query = SELECT name from Users WHERE userId = 1234; result = getFromMemcache(user_name_1234); // Return cached result (FAST!) if (result != null) return result; // Get from DB (slow...) result = getFromDB(query); // Add to cache (fast next time!) putInMemcache(user_name_1234, result); return result;
  • 42. Application Layer • We use Java • Works well • Learn to tune JVM • Different backend services • Some services have multiple instances • Services communicate with messaging protocol
  • 43. How do we scale applications? • Vertical Scaling: • Multicore CPUs, faster cores, more RAM • Parallelism: • Multithreaded applications • Connection pools • Horizontal Scaling: • Different services, split by functionality • Some services have multiple instances • Load balancing to instances via LVS
  • 45. OS & network layers • We use Linux • Follow kernel developments • Apply relevant patches • Puppet • Tune Linux and shell to handle many connections • C10K problem • Experiment with virtualization
  • 47. General scaling tips • Start simple, don’t over engineer • Scaling is problem solving
  • 48. Scaling cycle Problem! Apply fix Isolate cause Understand cause
  • 49. More scaling tips • Understand and consider the entire stack • Hardware (CPU, RAM, Disks, NIC) • OS (Paging, memory allocation, kernel) • Application layer (DB, language) • Step back • Look forward • Fix tomorrow’s problems before they become today’s
  • 50. Q&A
  • 51. Wrapping up • It’s been an interesting journey • We’re opening in Cape Town • ...we’re recruiting! • We’d love to hear feedback