SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Architecture:
                             Surviving the High Load
                         .




пятница, 6 мая 2011 г.
Who we are ?
                         Alexander Chinaryov
                         Lead Platform Developer
                         Since 2007




                         Alexander Hristoforov
                         Lead Platform Developer
                         Since 2009


                         Oleg Anastasyev
                         Lead Platform Developer
                         Since 2007




пятница, 6 мая 2011 г.
Load : some facts
                            2,8M users online
                         150k pages/s, 50ms avg
                              32Gbit/s out

     •    4000 Messages/s (> # twits)
     •    160k Photo downloads/s
     •    500 Comments/s
     •    90 000 notifications/s
     •    1500/s feed posts, 30k/s gets


пятница, 6 мая 2011 г.
Load: handled by
     • 3 Datacenters
     • 2400 servers & storages (and counting)

     • 1.5M SLOC (99.9% java, 0.1%C)
     • 60 modules

     • 40 devs + 8 testers
     • 20 admins

пятница, 6 мая 2011 г.
Arch: layers
     • 150+50 webs
     • 120 app srvs
     • 25 kinds
       business services
     • 6 SSO
     • >100 caches
     • 230 SQLs
     • >400 noSQL




пятница, 6 мая 2011 г.
Load: Balance
     • LVS
     • One-cluster
           – Weighted RR
           – Pluggable Failure detectors
           – Integrated with one-remote-service
           – Locality groups




пятница, 6 мая 2011 г.
Arch: Presentation
     • Apache Tomcat 6
     • RDK framework:
           – GUI components
           – Independant portlets
           – AJAX update → no full page
           – No javascript required
     • Google Web Toolkit for Dynamics
           – Toolbar, Photo pins, gifts
     • Flash (Apps, players, ads)
пятница, 6 мая 2011 г.
Arch: Business Logic
     • Odnoklassniki-ejb
           – JBoss 4.2
           – JTA, Stateless, Entity beans (BMP)
           – Business Op handling & orchestration
           – Event/handler pattern
           – Component logic
           – Data partitioning
           – Spring (DI)



пятница, 6 мая 2011 г.
Arch: Business Srvcs
     • IM, discussions, feeds
           – JBoss Remoting 2.2
           – One remote service
           – 100k+ req/sec on recent 8 core CPU
            /**
             * Ex. of Remote server
             */
            public interface Server extends RemoteService
            {
                @RemoteMethod
                IListChunk<Friend> getFreshMyFriends(@PartitionSource long userId, IChunkProperties cp);

                @RemoteMethod(invokeAll=true,split=true,reduceStrategy=ListReduceStrategy.class)
                List<?> mapReduceMethod(@PartitionSource long userId, ... );

                @RemoteMethod(invokeAll=true,asyncMaxDelay=1000L,asyncMaxBatch=100)
                void asyncNotify(@PartitionSource long userId, ... );
            }




пятница, 6 мая 2011 г.
Arch: Caches
     • one-graph
           – Social graph storage
           – 30Gb, 17K ops/server 7%CPU …
     • Odnoklassniki-cache
           – users, groups, photos,sessions...
           – Smart
           – Off heap (Unsafe) → no FGC
     • Near cache


пятница, 6 мая 2011 г.
Arch: Persistance
     • MS SQL 2005
           – High Consistency
           – Flexible queries
     • NoSQL: one-db
           – Berkley 4.5 C edition +
           – JBoss remoting based server +
           – Simple querying =
           – noSQL storage server
     • … and others are in research
пятница, 6 мая 2011 г.
Concept: DB Partitioning
     •    DB scaling is hard & expensive
     •    Vertical
     •    Horizontal
     •    ID:
           – long ID = uid << 8 + domain
           – Domain = 0..255
           – Domain → servers map



пятница, 6 мая 2011 г.
Perf : SQL DB
     •    XA → local TA only
     •    Dirty reads
     •    DB JOIN → app server memory
     •    FK, SP, Triggers
     •    DELETE :
           – No delete/insert workflow → update
           – Async batch process, retry
     • Indexes, clustered indexes

пятница, 6 мая 2011 г.
Perf: general
     • Seq Access speed:
           – RAM 10x > SSD 1.5x > 1Gbit eth comm 2x > disk

     • Random Access speed:
           – RAM 20000x (~50ns) > SSD 5-10x > disk (~5ms)
           – Net roundtrip ~ 0.5 ms

     • So:
           – Near data/cache – fastest solution ( cache coherence problem )
           – Partitioned network cache
           – Database access is the slowest thing

     • Still you have to sacrifice consistency


пятница, 6 мая 2011 г.
Surviving : GC
     • Young GC → high CPU load
           – Too much garbage (autoboxing, overlooked log.debug,...)
           – FIX: find and fix code → can take weeks

     • Old GC → pauses → carousel
           – 2-4Gb is limit for ParallelGC ( 1-4 secs )
           – 8-10 Gb is limit for CMS
                 • and it still can stop the world!
           – FIX: use Unsafe (offheap memory) or partition

     • Perm GC → pauses → carousel again
           – Too much .classes
           – FIX: +CMSClassUnloadingEnable




пятница, 6 мая 2011 г.
Surviving: failures
     • SQL partition failure
           – FIX: fault tolerance: read incomplete, write
             fail
     • One-db
           – Non stable replication → no fix :-(
           – Data corruption → separate ids storage
           – Random disk access → SSD, tmpfs




пятница, 6 мая 2011 г.
Surviving: carousel
     • Reasons:
           – Net problems
           – Unusual activity, spammers
           – Full GCs
           – Cold caches
           – Unexpected slowdowns, bugs
           – Activity growth

     • Fixes:
           – Timeout = 3s
           – Client side automatic fail detectors, server cutout
           – Gatekeepers




пятница, 6 мая 2011 г.
Surviving: gatekeepers
     • Fine grain func switches
     • Used for:
           – Fighting with carousel
           – Smooth new functions launch
           – Experiments

     • Can:
           – Turn on/off specific func, individual 3rd party games
           – On per server basis
           – On per user domain




пятница, 6 мая 2011 г.
Surviving: measure!
     • One-log statistics




пятница, 6 мая 2011 г.
Thank you



                         Questions ?


                            We are hiring
                          jobs@forticom.com



пятница, 6 мая 2011 г.
Test yourself ;-)
     • PhotoMarks table
            PhotoId:long   UserId:long   Mark:byte   timestamp

           – 32p x (500M rows, 42 Gb data + 25 Gb index)
           – Load (photoId, userId): 14kops, create: 1500kpos
           – Most load calls are check for row absence

     • Rejected apriori
           – Add more SQL nodes – too expensive
           – Place all marks to cache – 2600Gb RAM is not cheap as well




пятница, 6 мая 2011 г.

Weitere ähnliche Inhalte

Was ist angesagt?

MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012
Sean Laurent
 

Was ist angesagt? (20)

Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016
 
Distributions from the view a package
Distributions from the view a packageDistributions from the view a package
Distributions from the view a package
 
mogpres
mogpresmogpres
mogpres
 
Cool MariaDB Plugins
Cool MariaDB Plugins Cool MariaDB Plugins
Cool MariaDB Plugins
 
From Lucene to Solr 4 Trunk
From Lucene to Solr 4 TrunkFrom Lucene to Solr 4 Trunk
From Lucene to Solr 4 Trunk
 
69-kauri
69-kauri69-kauri
69-kauri
 
69-kauri
69-kauri69-kauri
69-kauri
 
69-kauri
69-kauri69-kauri
69-kauri
 
69-kauri
69-kauri69-kauri
69-kauri
 
Introduction to Java 7 (Devoxx Nov/2011)
Introduction to Java 7 (Devoxx Nov/2011)Introduction to Java 7 (Devoxx Nov/2011)
Introduction to Java 7 (Devoxx Nov/2011)
 
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP Perspective
 
The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016
 
Better encryption & security with MariaDB 10.1 & MySQL 5.7
Better encryption & security with MariaDB 10.1 & MySQL 5.7Better encryption & security with MariaDB 10.1 & MySQL 5.7
Better encryption & security with MariaDB 10.1 & MySQL 5.7
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
 
Capacity planning for your data stores
Capacity planning for your data storesCapacity planning for your data stores
Capacity planning for your data stores
 
MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012
 
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + ThymeleafDSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
 
Percona FT / TokuDB
Percona FT / TokuDBPercona FT / TokuDB
Percona FT / TokuDB
 
MyRocks in MariaDB
MyRocks in MariaDBMyRocks in MariaDB
MyRocks in MariaDB
 
Vba Macros Interoperability
Vba Macros InteroperabilityVba Macros Interoperability
Vba Macros Interoperability
 

Andere mochten auch

Apache Cassandra. Ещё одно NoSQL хранилище (Владимир Климонтович)
Apache Cassandra. Ещё одно NoSQL хранилище (Владимир Климонтович)Apache Cassandra. Ещё одно NoSQL хранилище (Владимир Климонтович)
Apache Cassandra. Ещё одно NoSQL хранилище (Владимир Климонтович)
Ontico
 
Алексей Чумаков. Apache Cassandra на реальном проекте
Алексей Чумаков. Apache Cassandra на реальном проектеАлексей Чумаков. Apache Cassandra на реальном проекте
Алексей Чумаков. Apache Cassandra на реальном проекте
Volha Banadyseva
 

Andere mochten auch (8)

Apache Cassandra. Ещё одно NoSQL хранилище (Владимир Климонтович)
Apache Cassandra. Ещё одно NoSQL хранилище (Владимир Климонтович)Apache Cassandra. Ещё одно NoSQL хранилище (Владимир Климонтович)
Apache Cassandra. Ещё одно NoSQL хранилище (Владимир Климонтович)
 
Класс!ная Cassandra
Класс!ная CassandraКласс!ная Cassandra
Класс!ная Cassandra
 
Обзор протокола OAuth 2.0. Способы внедрения в различные типы приложений
Обзор протокола OAuth 2.0. Способы внедрения в различные типы приложенийОбзор протокола OAuth 2.0. Способы внедрения в различные типы приложений
Обзор протокола OAuth 2.0. Способы внедрения в различные типы приложений
 
Getting started with Cassandra 2.1
Getting started with Cassandra 2.1Getting started with Cassandra 2.1
Getting started with Cassandra 2.1
 
Cassandra11
Cassandra11Cassandra11
Cassandra11
 
Алексей Чумаков. Apache Cassandra на реальном проекте
Алексей Чумаков. Apache Cassandra на реальном проектеАлексей Чумаков. Apache Cassandra на реальном проекте
Алексей Чумаков. Apache Cassandra на реальном проекте
 
Введение в Apache Cassandra
Введение в Apache CassandraВведение в Apache Cassandra
Введение в Apache Cassandra
 
Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)
 

Ähnlich wie Odnoklassniki.ru Architecture

Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Guillaume Laforge
 
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
 

Ähnlich wie Odnoklassniki.ru Architecture (20)

Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby Conference
 
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
 
App Engine Meetup
App Engine MeetupApp Engine Meetup
App Engine Meetup
 
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?
 
OSDC 2017 | Lessons from database failures by Colin Charles
OSDC 2017 | Lessons from database failures by Colin CharlesOSDC 2017 | Lessons from database failures by Colin Charles
OSDC 2017 | Lessons from database failures by Colin Charles
 
Why we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL DatabaseWhy we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL Database
 
RunDeck
RunDeckRunDeck
RunDeck
 
Scaling with mongo db (with notes)
Scaling with mongo db (with notes)Scaling with mongo db (with notes)
Scaling with mongo db (with notes)
 
MesosCon EU 2017 - Criteo - Operating Mesos-based Infrastructures
MesosCon EU 2017 - Criteo - Operating Mesos-based InfrastructuresMesosCon EU 2017 - Criteo - Operating Mesos-based Infrastructures
MesosCon EU 2017 - Criteo - Operating Mesos-based Infrastructures
 
Scalability
ScalabilityScalability
Scalability
 
Railsconf 2010
Railsconf 2010Railsconf 2010
Railsconf 2010
 
The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)
 
AppEngine Performance Tuning
AppEngine Performance TuningAppEngine Performance Tuning
AppEngine Performance Tuning
 
CERNBox: Site Report
CERNBox: Site ReportCERNBox: Site Report
CERNBox: Site Report
 
Webinar - DreamObjects/Ceph Case Study
Webinar - DreamObjects/Ceph Case StudyWebinar - DreamObjects/Ceph Case Study
Webinar - DreamObjects/Ceph Case Study
 
PGDAY FR 2014 : presentation de Postgresql chez leboncoin.fr
PGDAY FR 2014 : presentation de Postgresql chez leboncoin.frPGDAY FR 2014 : presentation de Postgresql chez leboncoin.fr
PGDAY FR 2014 : presentation de Postgresql chez leboncoin.fr
 
JavaOne_2010
JavaOne_2010JavaOne_2010
JavaOne_2010
 
PostgreSQL News
PostgreSQL NewsPostgreSQL News
PostgreSQL News
 
Mongo db admin_20110329
Mongo db admin_20110329Mongo db admin_20110329
Mongo db admin_20110329
 

Mehr von Dmitry Buzdin

Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
Dmitry Buzdin
 
Архитектура Ленты на Одноклассниках
Архитектура Ленты на ОдноклассникахАрхитектура Ленты на Одноклассниках
Архитектура Ленты на Одноклассниках
Dmitry Buzdin
 
Riding Redis @ask.fm
Riding Redis @ask.fmRiding Redis @ask.fm
Riding Redis @ask.fm
Dmitry Buzdin
 
Rubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part IIRubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part II
Dmitry Buzdin
 
Rubylight Pattern-Matching Solutions
Rubylight Pattern-Matching SolutionsRubylight Pattern-Matching Solutions
Rubylight Pattern-Matching Solutions
Dmitry Buzdin
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
Dmitry Buzdin
 
Rubylight programming contest
Rubylight programming contestRubylight programming contest
Rubylight programming contest
Dmitry Buzdin
 
Continuous Delivery
Continuous Delivery Continuous Delivery
Continuous Delivery
Dmitry Buzdin
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
Dmitry Buzdin
 
Thread Dump Analysis
Thread Dump AnalysisThread Dump Analysis
Thread Dump Analysis
Dmitry Buzdin
 

Mehr von Dmitry Buzdin (20)

How Payment Cards Really Work?
How Payment Cards Really Work?How Payment Cards Really Work?
How Payment Cards Really Work?
 
Как построить свой фреймворк для автотестов?
Как построить свой фреймворк для автотестов?Как построить свой фреймворк для автотестов?
Как построить свой фреймворк для автотестов?
 
How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?
 
Delivery Pipeline for Windows Machines
Delivery Pipeline for Windows MachinesDelivery Pipeline for Windows Machines
Delivery Pipeline for Windows Machines
 
Big Data Processing Using Hadoop Infrastructure
Big Data Processing Using Hadoop InfrastructureBig Data Processing Using Hadoop Infrastructure
Big Data Processing Using Hadoop Infrastructure
 
JOOQ and Flyway
JOOQ and FlywayJOOQ and Flyway
JOOQ and Flyway
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
 
Whats New in Java 8
Whats New in Java 8Whats New in Java 8
Whats New in Java 8
 
Архитектура Ленты на Одноклассниках
Архитектура Ленты на ОдноклассникахАрхитектура Ленты на Одноклассниках
Архитектура Ленты на Одноклассниках
 
Dart Workshop
Dart WorkshopDart Workshop
Dart Workshop
 
Riding Redis @ask.fm
Riding Redis @ask.fmRiding Redis @ask.fm
Riding Redis @ask.fm
 
Rubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part IIRubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part II
 
Rubylight Pattern-Matching Solutions
Rubylight Pattern-Matching SolutionsRubylight Pattern-Matching Solutions
Rubylight Pattern-Matching Solutions
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
 
Rubylight programming contest
Rubylight programming contestRubylight programming contest
Rubylight programming contest
 
Continuous Delivery
Continuous Delivery Continuous Delivery
Continuous Delivery
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
Thread Dump Analysis
Thread Dump AnalysisThread Dump Analysis
Thread Dump Analysis
 

Kürzlich hochgeladen

+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...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
 
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
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - 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
 
+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...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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 - 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 ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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
 
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
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
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
 
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
 

Odnoklassniki.ru Architecture

  • 1. Architecture: Surviving the High Load . пятница, 6 мая 2011 г.
  • 2. Who we are ? Alexander Chinaryov Lead Platform Developer Since 2007 Alexander Hristoforov Lead Platform Developer Since 2009 Oleg Anastasyev Lead Platform Developer Since 2007 пятница, 6 мая 2011 г.
  • 3. Load : some facts 2,8M users online 150k pages/s, 50ms avg 32Gbit/s out • 4000 Messages/s (> # twits) • 160k Photo downloads/s • 500 Comments/s • 90 000 notifications/s • 1500/s feed posts, 30k/s gets пятница, 6 мая 2011 г.
  • 4. Load: handled by • 3 Datacenters • 2400 servers & storages (and counting) • 1.5M SLOC (99.9% java, 0.1%C) • 60 modules • 40 devs + 8 testers • 20 admins пятница, 6 мая 2011 г.
  • 5. Arch: layers • 150+50 webs • 120 app srvs • 25 kinds business services • 6 SSO • >100 caches • 230 SQLs • >400 noSQL пятница, 6 мая 2011 г.
  • 6. Load: Balance • LVS • One-cluster – Weighted RR – Pluggable Failure detectors – Integrated with one-remote-service – Locality groups пятница, 6 мая 2011 г.
  • 7. Arch: Presentation • Apache Tomcat 6 • RDK framework: – GUI components – Independant portlets – AJAX update → no full page – No javascript required • Google Web Toolkit for Dynamics – Toolbar, Photo pins, gifts • Flash (Apps, players, ads) пятница, 6 мая 2011 г.
  • 8. Arch: Business Logic • Odnoklassniki-ejb – JBoss 4.2 – JTA, Stateless, Entity beans (BMP) – Business Op handling & orchestration – Event/handler pattern – Component logic – Data partitioning – Spring (DI) пятница, 6 мая 2011 г.
  • 9. Arch: Business Srvcs • IM, discussions, feeds – JBoss Remoting 2.2 – One remote service – 100k+ req/sec on recent 8 core CPU /** * Ex. of Remote server */ public interface Server extends RemoteService { @RemoteMethod IListChunk<Friend> getFreshMyFriends(@PartitionSource long userId, IChunkProperties cp); @RemoteMethod(invokeAll=true,split=true,reduceStrategy=ListReduceStrategy.class) List<?> mapReduceMethod(@PartitionSource long userId, ... ); @RemoteMethod(invokeAll=true,asyncMaxDelay=1000L,asyncMaxBatch=100) void asyncNotify(@PartitionSource long userId, ... ); } пятница, 6 мая 2011 г.
  • 10. Arch: Caches • one-graph – Social graph storage – 30Gb, 17K ops/server 7%CPU … • Odnoklassniki-cache – users, groups, photos,sessions... – Smart – Off heap (Unsafe) → no FGC • Near cache пятница, 6 мая 2011 г.
  • 11. Arch: Persistance • MS SQL 2005 – High Consistency – Flexible queries • NoSQL: one-db – Berkley 4.5 C edition + – JBoss remoting based server + – Simple querying = – noSQL storage server • … and others are in research пятница, 6 мая 2011 г.
  • 12. Concept: DB Partitioning • DB scaling is hard & expensive • Vertical • Horizontal • ID: – long ID = uid << 8 + domain – Domain = 0..255 – Domain → servers map пятница, 6 мая 2011 г.
  • 13. Perf : SQL DB • XA → local TA only • Dirty reads • DB JOIN → app server memory • FK, SP, Triggers • DELETE : – No delete/insert workflow → update – Async batch process, retry • Indexes, clustered indexes пятница, 6 мая 2011 г.
  • 14. Perf: general • Seq Access speed: – RAM 10x > SSD 1.5x > 1Gbit eth comm 2x > disk • Random Access speed: – RAM 20000x (~50ns) > SSD 5-10x > disk (~5ms) – Net roundtrip ~ 0.5 ms • So: – Near data/cache – fastest solution ( cache coherence problem ) – Partitioned network cache – Database access is the slowest thing • Still you have to sacrifice consistency пятница, 6 мая 2011 г.
  • 15. Surviving : GC • Young GC → high CPU load – Too much garbage (autoboxing, overlooked log.debug,...) – FIX: find and fix code → can take weeks • Old GC → pauses → carousel – 2-4Gb is limit for ParallelGC ( 1-4 secs ) – 8-10 Gb is limit for CMS • and it still can stop the world! – FIX: use Unsafe (offheap memory) or partition • Perm GC → pauses → carousel again – Too much .classes – FIX: +CMSClassUnloadingEnable пятница, 6 мая 2011 г.
  • 16. Surviving: failures • SQL partition failure – FIX: fault tolerance: read incomplete, write fail • One-db – Non stable replication → no fix :-( – Data corruption → separate ids storage – Random disk access → SSD, tmpfs пятница, 6 мая 2011 г.
  • 17. Surviving: carousel • Reasons: – Net problems – Unusual activity, spammers – Full GCs – Cold caches – Unexpected slowdowns, bugs – Activity growth • Fixes: – Timeout = 3s – Client side automatic fail detectors, server cutout – Gatekeepers пятница, 6 мая 2011 г.
  • 18. Surviving: gatekeepers • Fine grain func switches • Used for: – Fighting with carousel – Smooth new functions launch – Experiments • Can: – Turn on/off specific func, individual 3rd party games – On per server basis – On per user domain пятница, 6 мая 2011 г.
  • 19. Surviving: measure! • One-log statistics пятница, 6 мая 2011 г.
  • 20. Thank you Questions ? We are hiring jobs@forticom.com пятница, 6 мая 2011 г.
  • 21. Test yourself ;-) • PhotoMarks table PhotoId:long UserId:long Mark:byte timestamp – 32p x (500M rows, 42 Gb data + 25 Gb index) – Load (photoId, userId): 14kops, create: 1500kpos – Most load calls are check for row absence • Rejected apriori – Add more SQL nodes – too expensive – Place all marks to cache – 2600Gb RAM is not cheap as well пятница, 6 мая 2011 г.