SlideShare a Scribd company logo
1 of 57
Download to read offline
Best Practices to create High Load Websites!




                            Beolink.org!
Agenda                                     Beolink.org!

         §  Introduction!

         §  Design and Optimizations!
            §    Generic Optimizations!
            §    Presentation Layer!
            §    Application Layer!
            §    Data Layer!

         §  Example!

         §  Service Operation!
            §    Monitoring!
            §    Emergency Operations!

                      2!
                                                9/5/11!
Introduction: The value of an IT
Service
                                                   Beolink.org!

 From an ITIL perspective, the value is composed by two
 components: utility (fitness for purpose) and warranty
 (fitness for use.)!
 !
 Utility is a "[f]unctionality offered by a product or service to
 meet a particular need. Utility is often summarized as 'what
 it does'."!
 !
 Warranty as "[a] promise or guarantee that a product or
 service will meet its agreed requirements" and as "derived
 from the positive effect of being available when needed, in
 sufficient capacity, and dependably in terms of continuity
 and security."!

                                 3!
                                                            9/5/11!
Introduction                Beolink.org!

Do you have the new Amazon web
              site ?!
                 !
      4.3 million pages/day !
  = 50 pages/s, I don’t think so !!
                 !
1000 pages/s = 86 mil pages/day!
      Interesting figure…!
                 4!
                                 9/5/11!
Introduction         Beolink.org!




       How fast is fast
         enough? !

               5!
                          9/5/11!
Introduction: user perception                                          Beolink.org!

  80% of the end-user response time is spent on the front-end. !
  !
  Most of this time is tied up in downloading all the components in the page:
  images, stylesheets, scripts, Flash, etc. Reducing the number of components
  in turn reduces the number of HTTP requests required to render the page!
  (see Netflix case studies)!




     Request!                        Render!
                                   css loading, asset loading, javascript loading!




                      Response!


      Time!
                                       6!
                                                                                     9/5/11!
Introduction        Beolink.org!




   Do you know your
Application Architecture ? !


               7!
                         9/5/11!
Introduction: Architecture [ˈɑːkɪˌtɛktʃə]                                   Beolink.org!
 A software architecture is an abstraction of the run-time
 elements of a software system during some phases of its
 operation. A system may be composed of many levels of
 abstraction and many phases of operation, each with its own
 software architecture.!
 !
 A software architecture is defined by a configuration of
 architectural elements--components, connectors, and data--
 constrained in their relationships in order to achieve a desired set
 of architectural properties.!
 !
 A component is an abstract unit of software instructions and
 internal state that provide a transformation of data via its interface.!
 !
 A connector is an abstract mechanism that mediates
 communication, coordination, or cooperation among components.!
 !
 Datum is an element of information that is transferred from a
 component, or received by a component, via a connector.!
 !
 [1] Roy Filding theis!




                                                       8!
                                                                                 9/5/11!
Introduction: Web Architecture                         Beolink.org!
 Presentation Layer supports a client, the
 system needs to have a presentation layer through      Presentation!
 which the user can submit operations and obtain a
 result.!
 !
                                                        Middleware!
 Middleware Layer is just a level of indirection
 between presentation and other layers of the
 system. It introduces an additional layer of
 business logic encompassing all underlying             Application!
 systems. !
 !
 Application layer establishes what operations
 can be performed over the system and how they           Resource!
 take place. It takes care of enforcing the business
 rules and establishing the business processes. !
 !
 Resource (Datum) deals with the organization
 (storage, indexing, and retrieval) of the data
 necessary to support the application logic. !
                                          9!
                                                               9/5/11!
Beolink.org!




Design!


   10!
               9/5/11!
Design: Numbers                    Beolink.org!


q Request per second!
!
q Page composition!

q Content type/Dimension!

q Number of users!

q Peaks!




                             11!
                                        9/5/11!
Introduction: Architectural Properties                                             Beolink.org!

                                                             Simplicity!                   Customizability!


            Network
            Efficiency!                       Scalability!



                          User-perceived
                           Performance!


             Network
           Performance!                                                    Modifiability!



                           Evolvability!                                                    Extensibility!



                                           Configurability!




                                                                           Reusability!




                                                 12!
                                                                                                    9/5/11!
Design: Matrix                          Beolink.org!

 Properties!             Value!
 Network Performance !
 User-perceived
 Performance!
 Network Efficiency!
 Scalability!
 Simplicity!
 Modifiability!
 Evolvability!
 Extensibility!
 Customizability!
 Configurability!
 Reusability!

                                  13!
                                             9/5/11!
Beolink.org!




Layers!


   14!
               9/5/11!
Design: Layer 0                    Beolink.org!

 q Split the system in pieces!
 !
 q I/O!

 q TCP/IP!
    !!
 q Filesystem!
     !!
 !
     !!




                             15!
                                        9/5/11!
Design: I/O                                          Application!



                                                     Resource!
                                                                    Beolink.org!

 q I/O!
     !Ethernet: bonding!
     !Disks: SAS/SSD/infinibend!
     !!
 q Filesystem!
     !Avoid NFS!
     !Different FS (for operation type)!    ls: cannot access nfsdir: Stale NFS file handle!
     !Specific Options (noatime)!
     !Block size!
     !Journaling!
 !
 q Logging!
     !Dedicated sites!
     ! AMQP!                                                          760,000msg/sec
                                                                      ingress on an 8 way
                                                                      box or 6,000,000msg/
                                                                      sec OPRA messages.!
                                      16!
                                                                                9/5/11!
Design: TCP/IP                                                     Application!



                                                                       Resource!
                                                                                      Beolink.org!

     q TCP/IP!                                           500 req/sec*900 = 450.000 sockets !
                                                          !
         !net.ipv4.tcp_tw_reuse=1!                        !
         !net.ipv4.tcp_tw_recycle=1!                      !
         !net.ipv4.tcp_fin_timeout=30!                     !
         !net.ipv4.tcp_keepalive_time=300!
         !/proc/sys/net/ipv4/ip_local_port_range!
         ! fs.file-max=128000!
         !net.core.somaxconn=250000!
         !net.ipv4.tcp_max_syn_backlog=2500!
         !net.core.netdev_max_backlog=2500!
         !ulimit -n 10240!
!
     q IP Contract!                                      ip_conntrack: table full, dropping packet.!
                                                          !
         !net.ipv4.netfilter.ip_conntrack_max!             !
                                                          !
     !
     !
     q Firewall!
                                                          ‐‐limit rate!
         !Request / rate!                                 ‐‐limit‐burst number!
         !IP ACL!                                         !
                                                          !
         !Dynamic ACL (phrel)!                            !
     !                                              17!
                                                                                             9/5/11!
         !!
Design: Presentation                  Application!



                                      Resource!
                                                        Beolink.org!

 q Yahoo Rules!

 q Load Distribution!

 q Proxy/Caching!                                Application!


 q Web Server!
                                                     Resource!

 q Content Delivery
    Network !

 q Split access on different
    Domains!
 !
                                18!
                                                                 9/5/11!
Design:: Yahoo! Rules                                                                       Beolink.org!

 The Exceptional Performance team (Yahoo!) has identified a number of
 best practices to make web pages fast. The list includes 35 best
 practices divided into 7 categories.!
 !




                25 % without modifying infrastructure!


     Content!        Server!          Cookie!           CSS!           Javascript!          Images!          Mobile!

 • Make Fewer    • Use get for    • Reduce        • Put              • Put scripts at   • Make           • Keep
  HTTP Req!       Ajax Req!        Cookie Size!    Stylesheets        Botton!            favicon.ico      components
 • Make Ajax     • Flush Buffer   • Use Cookie-    at Top!           • Make              small and        under 25 kb!
  Cacheable!      Early!           Gree           • Avoid CSS         javascript and     Cacheable!      • Pack
 • Reduce the    • …!              Domains!        exp!               CSS ext!          • Optimize!       components
  number of                       • …!            • Avoid Filters!   • Minify!          • Do not Scale    into a
  DOM!                                            • …!               • …!                Image in         multipart
 • …!                                                                                    HTML!            document!
                                                                                        • …!




                                                       19!
                                                                                                         9/5/11!
Design:: Yahoo! Rules         Beolink.org!
 Example!




                        20!
                                   9/5/11!
Design: Load Distribution                  Application!



                                           Resource!
                                                          Beolink.org!
q  DNS!
     -  Low TTL!
     -  GEO IP!
     -  Round Robin!
     -  More than one IP!
     -  Response base on system load!
     -  Split Components across
        Domains!

q  Load Balancer!
     -  TCP/IP!
     -  Layer 7!
     -  SSL!

q  Anycast!
     -  Up to 32 systems per IP!
     -  High availability on WAN !
                                     21!
                                                               9/5/11!
Design: Proxy/Caching                                           Application!



                                                                Resource!
                                                                                        Beolink.org!
                                        120,000"

                                        100,000"
 q  Configure ETags!
                                         80,000"




                          Throughput)
 q  Add expiration or                   60,000"

                                         40,000"
     Cache-control
     Header!                             20,000"

                                              0"
                                                   ATS"2.1.9"                      Nginx"0.8.53"   Varnish"2.1.5"
 q  Extension modules!                                                        Req"/"sec"


 q  Reverse Proxy base
     on url or domains!

 q  Redirect on
     business logic
     (Middleware)!


                               22!
                                                                                                     9/5/11!
Design: WebServer                                          Application!



                                                           Resource!
                                                                          Beolink.org!

q  VirtualHost with dedicated IP!

q  Compress content !

q  Process Model!
     q  Number of Process!
     q  Number of clients!                   Apache optimization!
                                              !
     q  Spare..!                             Remove unneeded modules!
                                              Set AllowOverride to None!
                                              Avoid FollowSymLinks and SymLinksIfOwnerMatch!
                                              Avoid content negotiation (Multiview)!
                                              MaxClients =(Total Memory - Operating System
q  KeepAlive and KeepAliveTimeout!           Memory ) / Size Per Apache process.!
                                              !
    The KeepAlive directive allows            MinSpareServers, MaxSpareServers, and StartServers:!
    multiple requests to be sent over the     Apache can spawn a maximum of 32 child processes per
                                              second!
    same TCP connection. It changes
    model from Request to User!


                                        23!
                                                                                    9/5/11!
Design: Content Delivery Network         Application!



                                         Resource!
                                                        Beolink.org!

A content delivery network or
content distribution network
(CDN) is a system of computers
containing copies of data placed
at various nodes of a network.!
!
    !
    !




 q Preload!
 q Access Control !
                                   24!
                                                             9/5/11!
Design: Modular Application Logic        Beolink.org!

q Distribution!
!                                   Presentation!
q Accelerator!

q Session and Cookies!

q More instance on same             Resource!
   system!
!
   !




                           25!
                                                    9/5/11!
Design: Distribution                       Beolink.org!

 !
 q Shared!
 All components have all the
 functions (round robin)!

 q Function/resource!
 Components are grouped by
 function/resource!

 q User!
 Components are divided by cluster
 of users!




                                     26!
                                                9/5/11!
Design: Accelerator                                                                  Beolink.org!

q PHP!
Accelerator !
!           !PHP
            !
                      !with APC
                      !
                                  !%
                                  !
                                             !with eA
                                             !!
                                                         !%            !

! Tot sec   !175.62   !33.21      !528.83%   !29.18      !601.85%!
  Req/sec   !5.69     !30.11      !529.17%   !34.26      !602.11%!
!ms per req !175.62   !33.21      !528.83%   !29.19      !601.71%!
!
HIPHOP!
!
!                                                                    q Python!
                                                                     !
!                                                                    Framework !Transaction rate [1/sec]!
                                                                     Go http    !            !2063           !!
!                                                                    Twister    !            !2020           !!
!                                                                    Web.go     !            !1753           !!
                                                                     Tornado    !            !1662           !!
        !                                                            Tornado+nginx           !1364           !!
                                                                     Web.py+gevent           !888            !!
                                                                     Web.py+gunicorn         !538            !!
                                                                     Web.py+CheryPy          !304            !!
                                                                     Web.py+flup+nginx        !211            !!


                                                   27!
                                                                                                   9/5/11!
Design: Modular Application Logic             Beolink.org!

q Cookies!
        Size!
        Encryption (key rotation)!
    !
!
!
!
!
q Session!
        !Sticky session->table in memory!
        !Round Robin->memcached!
        !Two levels (NUMA)!
!
!

                                        28!
                                                   9/5/11!
Design: More instance                     Beolink.org!

q Better CPU Usage!
   Many applications do not
   support parallelization, then
   it is not possible to
   implement a scale up
   approach (deploying the
   applications on larger
   servers)!
!
!
q Better Memory Usage!
   Many applications still use 32
   bits or have fixed internal
   data structure!

                                    29!
                                               9/5/11!
Design: Modular Application Logic!        Beolink.org!

q Choose the correct
   algorithms and data
   structures!
   dqueue vs list, hash vs trees, locks
   vs read/write locks, bloom filter!


q Memory allocation!
   Reuse memory, stack vs heap,
   tcmalloc!


q Make fewer system calls!
   Larger writes and reads!
Design: Data Layer                      Beolink.org!

q Filesystem!
   q  Distributed!              Presentation!
   q  Replication!

q Database!                     Application!
   q  Partitioning!
   q  Replication!
   q  NoSQL!

q Hierarchical Storage!
   q  Directory Server!
   q  JSR-170/230!
   !


                           31!
                                                 9/5/11!
Design: Filesystem               Beolink.org!

q Distributed
   Filesystem!
    !- Local copy/cache!
    !- Parallel!
!
!
q Replication!
    !- rsync+inotify!
    !- DRDB!
    !!
!

Do not use file system as a !
COMMUNICATION PROTOCOL !!
                           32!
                                      9/5/11!
Design: Database                                Beolink.org!

q Partitioning!
    Small table!
    Many systems!
!
q Replication!
    Separation btw Read and Write!
    Different Index on different system!   Tungsten Replicator!
    !
q NoSQL!
    Key=value!
    No schema!
    !
    !


                                     33!
                                                        9/5/11!
Design: Hierarchical Storage          Beolink.org!

 q Directory Server!
     Split in domain!
     Multi Master!
     Right Index !
     Avoid COS!
 !
 !
 q JSR!
     Distribution!
     !
 !
 !
 !
Do not use Directory Servers as a !
 !

A STANDARD DATABASE !!
                        34!
                                           9/5/11!
Design: Profiling                                            Beolink.org!

The 20% of the code is responsible for 80% of the results (time)!


q  Find bottleneck before production!       Cmd line: top, htop, vmstat, dstat,
                                             strace!
                                             Statistical: Oprofile, google profile!
q  Dynamic program analysis!                Instrumentiing: valgrind's callgrind,
                                             gprof!
q  Show frequency of called functions !     !



q  Show usage of lines in code!

q  Show duration of function calls!




                                       35!
                                                                         9/5/11!
Design: Capacity                                  Beolink.org!
              Small TLD Zone performance evaluation
                         240,419 records




q Find relation btw
   application tasks and
   resources usage!
!
q Find max Load !




                                           36!
                                                           9/5/11!
Design: Matrix                                        Beolink.org!

Properties!        Replication!     Load Balancing!   …!
Network            o!
Performance !
User-perceived     +!
Performance!
Network Efficiency! -!
Scalability!       ++!
Simplicity!        -!
Modifiability!      o!
Evolvability!      o!
Extensibility!     o!
Customizability!   o!
Configurability!    -!
Reusability!       +!
                                  37!
                                                           9/5/11!
Beolink.org!




Example!




   38!
Design: CMS                                                             Beolink.org!
                                                 Max 4000 req/sec!
                                                 Avg 2500 req/seq!
2 VirtualHost!
Accelerator APC!
Typo3 plugin Static cache!
                                      Load Balancer!
Separate Logging!
KeepAlive!



                       HTTP!     HTTP!              HTTP!               HTTP!




                   Brick1!       Brick2!           Brick3!             Brick4!

 Separated site with
 Authoring!


         HTTP!                 content!            media!
                                                                     2 database !
                                                                     2 Typo3 instances!



                                           39!
                                                                                      9/5/11!
Example: Something goes wrong ?                                                                Beolink.org!

 load averages: 534.93 281.26 1.26!

Something goes wrong …
$loops = 150 $steps = 200 !
if (is_file($this->resource)) {
                                                            500 req/sec * 30 sec !
         $this->sysLog('Waiting for a different process to release the lock'); !           !
        $i = 0;

        while ($i<$this->loops) { !                                                        15000 Sockets!
                !$i++; usleep($this->step*1000); !                                         15000/req_per_proc
                !clearstatcache();

                !if (!is_file($this->resource)) { !                                         Processes!
                !               !// Lock became free, leave the loop
                      15000 DB connections !!!!
                !               !$this->sysLog('Different process released the lock'); !
                !               !$noWait = false; !
                                                                                           !
                !               !break; !                                                  ALL the processes are in !
                !} !
        $noWait = true; !
                                                                                           READY STATE!
         }!                                                                                !
        if (($this->filepointer = touch($this->resource)) == false) {!
                ! throw new Exception('Lock file could not be created'); !                  The content could be locked
        }!                                                                                 forever!
…!

                                                                    40!
Design: CMS                                 Beolink.org!


                Load Balancer!


       Cache!              Cache!           Cache!




                                                …!




                           Master/Author!

                     41!
                                                     9/5/11!
Design: Enterprise                                                             Beolink.org!
                                                                             DNS GEO IP!

                  Load Balancer!                     Load Balancer!               Load Balancer!


                                                                                Redirect to !
                                                                                Zone n!
   Auth!             cache!                               cache!
                                                                                      locators!
                  Apps Servers!                     Apps Servers!

                  Memcached!                        Memcached!
                                                                                     Meta Data!


 DS slaves!
                    DB      CR                        DB      CR
                  Slaves! Slaves!                   Slaves! Slaves!

                              Zone 1!   …!                         Zone n!



                                                                                  Replication to Region X!
     Ds Master!
                         DB Master!          CR Master!
                                                                                 Region 1!
                                              42!
                                                                                            9/5/11!
Service Operation         Beolink.org!




       Service Operation!




                    43!
SO: Monitoring                                                      Beolink.org!

                                     System!
q Internal!                         Requests stats (per second, per IP, …)!
   System!                           Concurrent Users!
                                     System load (cpu, memory,disk I/O,..)!
   Internal state!                   Number of Processes!
                                     !
   Traffic !
       !!                            APPS!
                                     Memory per instance!
q External!                         Number of elements in Data structure!
                                     Communication Timeout!
   User experience, time             !

   spent for each component          Database!
   (components time loading,         Connection!
                                     Query time!
   rendering, execution,…)!          Query per Table!
                                     Top query!
   !
                                     !
q Alarm!
   Define key performance
   Indicator on System
   Capacity !
   !
                               44!
                                                                               9/5/11!
SO: The red button                         Beolink.org!

q Improve capacity             !!
    Remove controls!
    Increase number of systems!
    Dynamic to Static !
    Increase TTL of cache!
    Async Operation!
    Operations Queue!
!
q Disconnection!
    Exclusion of Cluster of users!
    Exclusion IP list!
    Bandwidth reduction!
    Web site Sections closure!
    !


                                     45!
                                                9/5/11!
Lessons                  Beolink.org!




     7 Lessons Learned !
            (so far) !




               46!
                              9/5/11!
Lesson 1                            Beolink.org!




 Partitioning Algorithms !!
           (application driver) !




                   47!
                                         9/5/11!
Lesson 2                    Beolink.org!




Kill your Web Designer !!
           (one shot)   !

               48!
                                 9/5/11!
Lesson 3                        Beolink.org!




           Never repeat !!
                (caching)   !

                   49!
                                     9/5/11!
Lesson 4                             Beolink.org!




           Share nothing !!
               (local content)   !

                     50!
                                          9/5/11!
Lesson 5                    Beolink.org!




           Warm up!!
                 !
            (empty cache)




                 51!
                                 9/5/11!
Lesson 6                 Beolink.org!




           Asynchronous!
                   !
               (queue)




                 52!
                              9/5/11!
Lesson 7                        Beolink.org!




 Measure, Measure, Measure,
      Measure,   !!
             Measure, Measure




             53!
                                     9/5/11!
Cloud              Beolink.org!




        Cloud ?!




           54!
Cloud Stack                                           Beolink.org!

Things must change!!
!
q  Web UI for users, affiliates, marketing,
    operations!
q  Agile machine management is part of the API!
q  Scale up -and down!
q  Live upgrade of running system!
q  Persistence with key-value stores!
q  A Petabyte filesystem is part of the application!
q  MapReduce jobs close the loop!
q  Developers deploy to the cloud to test!


Original work:!
http://svn.apache.org/repos/asf/labs/clouds/
apache_cloud_computing_edition.pdf!

                                          55!
I look forward to meeting you…!                         Beolink.org!

            XVIII European AFS meeting 2011
                           HAMBURG – GERMANY
                               4-7 October


            Who should attend:
            §    Everyone interested in deploying a globally accessible
                  file system
            §    Everyone interested in learning more about real
                  world usage of Kerberos authentication in single
                  realm and federated single sign-on environments
            §    Everyone who wants to share their knowledge and
                  experience with other members of the AFS and
                  Kerberos communities
            §    Everyone who wants to find out the latest
                  developments affecting AFS and Kerberos

            More Info: http://www.openafs.org/
                                 56!
                                                                  9/5/11!
Thank you

    

    manfred@freemails.ch!



!
                            Beolink.org!

More Related Content

Viewers also liked

Архитектура хранения и отдачи фотографий в Badoo / Артем Денисов (Badoo)
Архитектура хранения и отдачи фотографий в Badoo / Артем Денисов (Badoo)Архитектура хранения и отдачи фотографий в Badoo / Артем Денисов (Badoo)
Архитектура хранения и отдачи фотографий в Badoo / Артем Денисов (Badoo)Ontico
 
Quick Introduction to F2P Mobile Game Analytics
Quick Introduction to F2P Mobile Game AnalyticsQuick Introduction to F2P Mobile Game Analytics
Quick Introduction to F2P Mobile Game AnalyticsKyle Campbell
 
F2P Game Balancing: Data Movies
F2P Game Balancing: Data MoviesF2P Game Balancing: Data Movies
F2P Game Balancing: Data MoviesThomas Hulvershorn
 
Facebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenFacebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenHARMAN Services
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web ApplicationsDavid Mitzenmacher
 
facebook architecture for 600M users
facebook architecture for 600M usersfacebook architecture for 600M users
facebook architecture for 600M usersJongyoon Choi
 
Killer Design Patterns for F2P Mobile/Tablet Games
Killer Design Patterns for F2P Mobile/Tablet GamesKiller Design Patterns for F2P Mobile/Tablet Games
Killer Design Patterns for F2P Mobile/Tablet GamesHenric Suuronen
 

Viewers also liked (7)

Архитектура хранения и отдачи фотографий в Badoo / Артем Денисов (Badoo)
Архитектура хранения и отдачи фотографий в Badoo / Артем Денисов (Badoo)Архитектура хранения и отдачи фотографий в Badoo / Артем Денисов (Badoo)
Архитектура хранения и отдачи фотографий в Badoo / Артем Денисов (Badoo)
 
Quick Introduction to F2P Mobile Game Analytics
Quick Introduction to F2P Mobile Game AnalyticsQuick Introduction to F2P Mobile Game Analytics
Quick Introduction to F2P Mobile Game Analytics
 
F2P Game Balancing: Data Movies
F2P Game Balancing: Data MoviesF2P Game Balancing: Data Movies
F2P Game Balancing: Data Movies
 
Facebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenFacebook Architecture - Breaking it Open
Facebook Architecture - Breaking it Open
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications
 
facebook architecture for 600M users
facebook architecture for 600M usersfacebook architecture for 600M users
facebook architecture for 600M users
 
Killer Design Patterns for F2P Mobile/Tablet Games
Killer Design Patterns for F2P Mobile/Tablet GamesKiller Design Patterns for F2P Mobile/Tablet Games
Killer Design Patterns for F2P Mobile/Tablet Games
 

Similar to Best Practices to create High Load Websites

RedLink GmbH (Introduction)
RedLink GmbH (Introduction)  RedLink GmbH (Introduction)
RedLink GmbH (Introduction) Andrea Volpini
 
Amplexor drupalcamp-gent-2012 - kinepolis platform
Amplexor drupalcamp-gent-2012 - kinepolis platformAmplexor drupalcamp-gent-2012 - kinepolis platform
Amplexor drupalcamp-gent-2012 - kinepolis platformAmplexor
 
Networking in the Cloud Age (LISA 2012 Tutorial)
Networking in the Cloud Age (LISA 2012 Tutorial)Networking in the Cloud Age (LISA 2012 Tutorial)
Networking in the Cloud Age (LISA 2012 Tutorial)Chiradeep Vittal
 
Losing the Document Battle? Alfresco, Drupal Combine for Solution
Losing the Document Battle? Alfresco, Drupal Combine for SolutionLosing the Document Battle? Alfresco, Drupal Combine for Solution
Losing the Document Battle? Alfresco, Drupal Combine for SolutionAcquia
 
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry)
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry) IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry)
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry) Animesh Singh
 
Leverage web technology in a mobile world
Leverage web technology in a mobile worldLeverage web technology in a mobile world
Leverage web technology in a mobile worldDieter Blomme
 
[CocoaHeads Tricity] Do not reinvent the wheel
[CocoaHeads Tricity] Do not reinvent the wheel[CocoaHeads Tricity] Do not reinvent the wheel
[CocoaHeads Tricity] Do not reinvent the wheelMateusz Klimczak
 
The Twelve Factor Apps
The Twelve Factor AppsThe Twelve Factor Apps
The Twelve Factor Appstomi vanek
 
Optaros Surf Code Camp Introduction
Optaros Surf Code Camp IntroductionOptaros Surf Code Camp Introduction
Optaros Surf Code Camp IntroductionJeff Potts
 
CMIS and Interoperability - AIIM 2009
CMIS and Interoperability - AIIM 2009CMIS and Interoperability - AIIM 2009
CMIS and Interoperability - AIIM 2009johnnewton
 
Imola informatica - cloud computing and software development
Imola informatica - cloud computing and software developmentImola informatica - cloud computing and software development
Imola informatica - cloud computing and software developmentFilippo Bosi
 
Leaving the Ivory Tower: Research in the Real World
Leaving the Ivory Tower: Research in the Real WorldLeaving the Ivory Tower: Research in the Real World
Leaving the Ivory Tower: Research in the Real WorldC4Media
 
Workflows in the Virtual Observatory
Workflows in the Virtual ObservatoryWorkflows in the Virtual Observatory
Workflows in the Virtual ObservatoryJose Enrique Ruiz
 
Docker, Cloud Foundry, Bosh & Bluemix
Docker, Cloud Foundry, Bosh & BluemixDocker, Cloud Foundry, Bosh & Bluemix
Docker, Cloud Foundry, Bosh & BluemixIBM
 
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...Spark Summit
 
Web Frameworks of the Future
Web Frameworks of the FutureWeb Frameworks of the Future
Web Frameworks of the Futureelliando dias
 
Eye Os May 2011 V2.0
Eye Os May 2011 V2.0Eye Os May 2011 V2.0
Eye Os May 2011 V2.0ggorricm
 

Similar to Best Practices to create High Load Websites (20)

Link Samba to Cloud Storage
Link Samba to Cloud StorageLink Samba to Cloud Storage
Link Samba to Cloud Storage
 
RedLink GmbH (Introduction)
RedLink GmbH (Introduction)  RedLink GmbH (Introduction)
RedLink GmbH (Introduction)
 
Amplexor drupalcamp-gent-2012 - kinepolis platform
Amplexor drupalcamp-gent-2012 - kinepolis platformAmplexor drupalcamp-gent-2012 - kinepolis platform
Amplexor drupalcamp-gent-2012 - kinepolis platform
 
Service worker API
Service worker APIService worker API
Service worker API
 
Networking in the Cloud Age (LISA 2012 Tutorial)
Networking in the Cloud Age (LISA 2012 Tutorial)Networking in the Cloud Age (LISA 2012 Tutorial)
Networking in the Cloud Age (LISA 2012 Tutorial)
 
Losing the Document Battle? Alfresco, Drupal Combine for Solution
Losing the Document Battle? Alfresco, Drupal Combine for SolutionLosing the Document Battle? Alfresco, Drupal Combine for Solution
Losing the Document Battle? Alfresco, Drupal Combine for Solution
 
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry)
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry) IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry)
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry)
 
Leverage web technology in a mobile world
Leverage web technology in a mobile worldLeverage web technology in a mobile world
Leverage web technology in a mobile world
 
[CocoaHeads Tricity] Do not reinvent the wheel
[CocoaHeads Tricity] Do not reinvent the wheel[CocoaHeads Tricity] Do not reinvent the wheel
[CocoaHeads Tricity] Do not reinvent the wheel
 
The Twelve Factor Apps
The Twelve Factor AppsThe Twelve Factor Apps
The Twelve Factor Apps
 
Optaros Surf Code Camp Introduction
Optaros Surf Code Camp IntroductionOptaros Surf Code Camp Introduction
Optaros Surf Code Camp Introduction
 
CMIS and Interoperability - AIIM 2009
CMIS and Interoperability - AIIM 2009CMIS and Interoperability - AIIM 2009
CMIS and Interoperability - AIIM 2009
 
Imola informatica - cloud computing and software development
Imola informatica - cloud computing and software developmentImola informatica - cloud computing and software development
Imola informatica - cloud computing and software development
 
Leaving the Ivory Tower: Research in the Real World
Leaving the Ivory Tower: Research in the Real WorldLeaving the Ivory Tower: Research in the Real World
Leaving the Ivory Tower: Research in the Real World
 
Workflows in the Virtual Observatory
Workflows in the Virtual ObservatoryWorkflows in the Virtual Observatory
Workflows in the Virtual Observatory
 
Docker, Cloud Foundry, Bosh & Bluemix
Docker, Cloud Foundry, Bosh & BluemixDocker, Cloud Foundry, Bosh & Bluemix
Docker, Cloud Foundry, Bosh & Bluemix
 
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
 
Web Frameworks of the Future
Web Frameworks of the FutureWeb Frameworks of the Future
Web Frameworks of the Future
 
Eye Os May 2011 V2.0
Eye Os May 2011 V2.0Eye Os May 2011 V2.0
Eye Os May 2011 V2.0
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 

More from Manfred Furuholmen (18)

Pisa
PisaPisa
Pisa
 
Samba4 Introduction
Samba4 IntroductionSamba4 Introduction
Samba4 Introduction
 
Restfs internals
Restfs internalsRestfs internals
Restfs internals
 
Introduction to message_queue
Introduction to message_queueIntroduction to message_queue
Introduction to message_queue
 
Restfs
RestfsRestfs
Restfs
 
Winbind as Identity Management Connector
Winbind as Identity Management ConnectorWinbind as Identity Management Connector
Winbind as Identity Management Connector
 
Use Distributed Filesystem as a Storage Tier
Use Distributed Filesystem as a Storage TierUse Distributed Filesystem as a Storage Tier
Use Distributed Filesystem as a Storage Tier
 
Managing OpenAFS users with OpenIDM
Managing OpenAFS users with OpenIDMManaging OpenAFS users with OpenIDM
Managing OpenAFS users with OpenIDM
 
Afs manager
Afs managerAfs manager
Afs manager
 
Pt server ng
Pt server ngPt server ng
Pt server ng
 
Be lazy... make automation
Be lazy... make automationBe lazy... make automation
Be lazy... make automation
 
Disaster recovery
Disaster recoveryDisaster recovery
Disaster recovery
 
Domestic cloud
Domestic cloudDomestic cloud
Domestic cloud
 
Inexpensive storage
Inexpensive storageInexpensive storage
Inexpensive storage
 
Samba as a gateway to OpenAFS
Samba as a gateway to OpenAFSSamba as a gateway to OpenAFS
Samba as a gateway to OpenAFS
 
Samba distributed env
Samba distributed envSamba distributed env
Samba distributed env
 
AFS introduction
AFS introductionAFS introduction
AFS introduction
 
AFS case study
AFS case studyAFS case study
AFS case study
 

Recently uploaded

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Best Practices to create High Load Websites

  • 1. Best Practices to create High Load Websites! Beolink.org!
  • 2. Agenda Beolink.org! §  Introduction! §  Design and Optimizations! §  Generic Optimizations! §  Presentation Layer! §  Application Layer! §  Data Layer! §  Example! §  Service Operation! §  Monitoring! §  Emergency Operations! 2! 9/5/11!
  • 3. Introduction: The value of an IT Service Beolink.org! From an ITIL perspective, the value is composed by two components: utility (fitness for purpose) and warranty (fitness for use.)! ! Utility is a "[f]unctionality offered by a product or service to meet a particular need. Utility is often summarized as 'what it does'."! ! Warranty as "[a] promise or guarantee that a product or service will meet its agreed requirements" and as "derived from the positive effect of being available when needed, in sufficient capacity, and dependably in terms of continuity and security."! 3! 9/5/11!
  • 4. Introduction Beolink.org! Do you have the new Amazon web site ?! ! 4.3 million pages/day ! = 50 pages/s, I don’t think so !! ! 1000 pages/s = 86 mil pages/day! Interesting figure…! 4! 9/5/11!
  • 5. Introduction Beolink.org! How fast is fast enough? ! 5! 9/5/11!
  • 6. Introduction: user perception Beolink.org! 80% of the end-user response time is spent on the front-end. ! ! Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces the number of HTTP requests required to render the page! (see Netflix case studies)! Request! Render! css loading, asset loading, javascript loading! Response! Time! 6! 9/5/11!
  • 7. Introduction Beolink.org! Do you know your Application Architecture ? ! 7! 9/5/11!
  • 8. Introduction: Architecture [ˈɑːkɪˌtɛktʃə] Beolink.org! A software architecture is an abstraction of the run-time elements of a software system during some phases of its operation. A system may be composed of many levels of abstraction and many phases of operation, each with its own software architecture.! ! A software architecture is defined by a configuration of architectural elements--components, connectors, and data-- constrained in their relationships in order to achieve a desired set of architectural properties.! ! A component is an abstract unit of software instructions and internal state that provide a transformation of data via its interface.! ! A connector is an abstract mechanism that mediates communication, coordination, or cooperation among components.! ! Datum is an element of information that is transferred from a component, or received by a component, via a connector.! ! [1] Roy Filding theis! 8! 9/5/11!
  • 9. Introduction: Web Architecture Beolink.org! Presentation Layer supports a client, the system needs to have a presentation layer through Presentation! which the user can submit operations and obtain a result.! ! Middleware! Middleware Layer is just a level of indirection between presentation and other layers of the system. It introduces an additional layer of business logic encompassing all underlying Application! systems. ! ! Application layer establishes what operations can be performed over the system and how they Resource! take place. It takes care of enforcing the business rules and establishing the business processes. ! ! Resource (Datum) deals with the organization (storage, indexing, and retrieval) of the data necessary to support the application logic. ! 9! 9/5/11!
  • 10. Beolink.org! Design! 10! 9/5/11!
  • 11. Design: Numbers Beolink.org! q Request per second! ! q Page composition! q Content type/Dimension! q Number of users! q Peaks! 11! 9/5/11!
  • 12. Introduction: Architectural Properties Beolink.org! Simplicity! Customizability! Network Efficiency! Scalability! User-perceived Performance! Network Performance! Modifiability! Evolvability! Extensibility! Configurability! Reusability! 12! 9/5/11!
  • 13. Design: Matrix Beolink.org! Properties! Value! Network Performance ! User-perceived Performance! Network Efficiency! Scalability! Simplicity! Modifiability! Evolvability! Extensibility! Customizability! Configurability! Reusability! 13! 9/5/11!
  • 14. Beolink.org! Layers! 14! 9/5/11!
  • 15. Design: Layer 0 Beolink.org! q Split the system in pieces! ! q I/O! q TCP/IP! !! q Filesystem! !! ! !! 15! 9/5/11!
  • 16. Design: I/O Application! Resource! Beolink.org! q I/O! !Ethernet: bonding! !Disks: SAS/SSD/infinibend! !! q Filesystem! !Avoid NFS! !Different FS (for operation type)! ls: cannot access nfsdir: Stale NFS file handle! !Specific Options (noatime)! !Block size! !Journaling! ! q Logging! !Dedicated sites! ! AMQP! 760,000msg/sec ingress on an 8 way box or 6,000,000msg/ sec OPRA messages.! 16! 9/5/11!
  • 17. Design: TCP/IP Application! Resource! Beolink.org! q TCP/IP! 500 req/sec*900 = 450.000 sockets ! ! !net.ipv4.tcp_tw_reuse=1! ! !net.ipv4.tcp_tw_recycle=1! ! !net.ipv4.tcp_fin_timeout=30! ! !net.ipv4.tcp_keepalive_time=300! !/proc/sys/net/ipv4/ip_local_port_range! ! fs.file-max=128000! !net.core.somaxconn=250000! !net.ipv4.tcp_max_syn_backlog=2500! !net.core.netdev_max_backlog=2500! !ulimit -n 10240! ! q IP Contract! ip_conntrack: table full, dropping packet.! ! !net.ipv4.netfilter.ip_conntrack_max! ! ! ! ! q Firewall! ‐‐limit rate! !Request / rate! ‐‐limit‐burst number! !IP ACL! ! ! !Dynamic ACL (phrel)! ! ! 17! 9/5/11! !!
  • 18. Design: Presentation Application! Resource! Beolink.org! q Yahoo Rules! q Load Distribution! q Proxy/Caching! Application! q Web Server! Resource! q Content Delivery Network ! q Split access on different Domains! ! 18! 9/5/11!
  • 19. Design:: Yahoo! Rules Beolink.org! The Exceptional Performance team (Yahoo!) has identified a number of best practices to make web pages fast. The list includes 35 best practices divided into 7 categories.! ! 25 % without modifying infrastructure! Content! Server! Cookie! CSS! Javascript! Images! Mobile! • Make Fewer • Use get for • Reduce • Put • Put scripts at • Make • Keep HTTP Req! Ajax Req! Cookie Size! Stylesheets Botton! favicon.ico components • Make Ajax • Flush Buffer • Use Cookie- at Top! • Make small and under 25 kb! Cacheable! Early! Gree • Avoid CSS javascript and Cacheable! • Pack • Reduce the • …! Domains! exp! CSS ext! • Optimize! components number of • …! • Avoid Filters! • Minify! • Do not Scale into a DOM! • …! • …! Image in multipart • …! HTML! document! • …! 19! 9/5/11!
  • 20. Design:: Yahoo! Rules Beolink.org! Example! 20! 9/5/11!
  • 21. Design: Load Distribution Application! Resource! Beolink.org! q  DNS! -  Low TTL! -  GEO IP! -  Round Robin! -  More than one IP! -  Response base on system load! -  Split Components across Domains! q  Load Balancer! -  TCP/IP! -  Layer 7! -  SSL! q  Anycast! -  Up to 32 systems per IP! -  High availability on WAN ! 21! 9/5/11!
  • 22. Design: Proxy/Caching Application! Resource! Beolink.org! 120,000" 100,000" q  Configure ETags! 80,000" Throughput) q  Add expiration or 60,000" 40,000" Cache-control Header! 20,000" 0" ATS"2.1.9" Nginx"0.8.53" Varnish"2.1.5" q  Extension modules! Req"/"sec" q  Reverse Proxy base on url or domains! q  Redirect on business logic (Middleware)! 22! 9/5/11!
  • 23. Design: WebServer Application! Resource! Beolink.org! q  VirtualHost with dedicated IP! q  Compress content ! q  Process Model! q  Number of Process! q  Number of clients! Apache optimization! ! q  Spare..! Remove unneeded modules! Set AllowOverride to None! Avoid FollowSymLinks and SymLinksIfOwnerMatch! Avoid content negotiation (Multiview)! MaxClients =(Total Memory - Operating System q  KeepAlive and KeepAliveTimeout! Memory ) / Size Per Apache process.! ! The KeepAlive directive allows MinSpareServers, MaxSpareServers, and StartServers:! multiple requests to be sent over the Apache can spawn a maximum of 32 child processes per second! same TCP connection. It changes model from Request to User! 23! 9/5/11!
  • 24. Design: Content Delivery Network Application! Resource! Beolink.org! A content delivery network or content distribution network (CDN) is a system of computers containing copies of data placed at various nodes of a network.! ! ! ! q Preload! q Access Control ! 24! 9/5/11!
  • 25. Design: Modular Application Logic Beolink.org! q Distribution! ! Presentation! q Accelerator! q Session and Cookies! q More instance on same Resource! system! ! ! 25! 9/5/11!
  • 26. Design: Distribution Beolink.org! ! q Shared! All components have all the functions (round robin)! q Function/resource! Components are grouped by function/resource! q User! Components are divided by cluster of users! 26! 9/5/11!
  • 27. Design: Accelerator Beolink.org! q PHP! Accelerator ! ! !PHP ! !with APC ! !% ! !with eA !! !% ! ! Tot sec !175.62 !33.21 !528.83% !29.18 !601.85%! Req/sec !5.69 !30.11 !529.17% !34.26 !602.11%! !ms per req !175.62 !33.21 !528.83% !29.19 !601.71%! ! HIPHOP! ! ! q Python! ! ! Framework !Transaction rate [1/sec]! Go http ! !2063 !! ! Twister ! !2020 !! ! Web.go ! !1753 !! Tornado ! !1662 !! ! Tornado+nginx !1364 !! Web.py+gevent !888 !! Web.py+gunicorn !538 !! Web.py+CheryPy !304 !! Web.py+flup+nginx !211 !! 27! 9/5/11!
  • 28. Design: Modular Application Logic Beolink.org! q Cookies! Size! Encryption (key rotation)! ! ! ! ! ! q Session! !Sticky session->table in memory! !Round Robin->memcached! !Two levels (NUMA)! ! ! 28! 9/5/11!
  • 29. Design: More instance Beolink.org! q Better CPU Usage! Many applications do not support parallelization, then it is not possible to implement a scale up approach (deploying the applications on larger servers)! ! ! q Better Memory Usage! Many applications still use 32 bits or have fixed internal data structure! 29! 9/5/11!
  • 30. Design: Modular Application Logic! Beolink.org! q Choose the correct algorithms and data structures! dqueue vs list, hash vs trees, locks vs read/write locks, bloom filter! q Memory allocation! Reuse memory, stack vs heap, tcmalloc! q Make fewer system calls! Larger writes and reads!
  • 31. Design: Data Layer Beolink.org! q Filesystem! q  Distributed! Presentation! q  Replication! q Database! Application! q  Partitioning! q  Replication! q  NoSQL! q Hierarchical Storage! q  Directory Server! q  JSR-170/230! ! 31! 9/5/11!
  • 32. Design: Filesystem Beolink.org! q Distributed Filesystem! !- Local copy/cache! !- Parallel! ! ! q Replication! !- rsync+inotify! !- DRDB! !! ! Do not use file system as a ! COMMUNICATION PROTOCOL !! 32! 9/5/11!
  • 33. Design: Database Beolink.org! q Partitioning! Small table! Many systems! ! q Replication! Separation btw Read and Write! Different Index on different system! Tungsten Replicator! ! q NoSQL! Key=value! No schema! ! ! 33! 9/5/11!
  • 34. Design: Hierarchical Storage Beolink.org! q Directory Server! Split in domain! Multi Master! Right Index ! Avoid COS! ! ! q JSR! Distribution! ! ! ! ! Do not use Directory Servers as a ! ! A STANDARD DATABASE !! 34! 9/5/11!
  • 35. Design: Profiling Beolink.org! The 20% of the code is responsible for 80% of the results (time)! q  Find bottleneck before production! Cmd line: top, htop, vmstat, dstat, strace! Statistical: Oprofile, google profile! q  Dynamic program analysis! Instrumentiing: valgrind's callgrind, gprof! q  Show frequency of called functions ! ! q  Show usage of lines in code! q  Show duration of function calls! 35! 9/5/11!
  • 36. Design: Capacity Beolink.org! Small TLD Zone performance evaluation 240,419 records q Find relation btw application tasks and resources usage! ! q Find max Load ! 36! 9/5/11!
  • 37. Design: Matrix Beolink.org! Properties! Replication! Load Balancing! …! Network o! Performance ! User-perceived +! Performance! Network Efficiency! -! Scalability! ++! Simplicity! -! Modifiability! o! Evolvability! o! Extensibility! o! Customizability! o! Configurability! -! Reusability! +! 37! 9/5/11!
  • 39. Design: CMS Beolink.org! Max 4000 req/sec! Avg 2500 req/seq! 2 VirtualHost! Accelerator APC! Typo3 plugin Static cache! Load Balancer! Separate Logging! KeepAlive! HTTP! HTTP! HTTP! HTTP! Brick1! Brick2! Brick3! Brick4! Separated site with Authoring! HTTP! content! media! 2 database ! 2 Typo3 instances! 39! 9/5/11!
  • 40. Example: Something goes wrong ? Beolink.org! load averages: 534.93 281.26 1.26! Something goes wrong … $loops = 150 $steps = 200 ! if (is_file($this->resource)) {
 500 req/sec * 30 sec ! $this->sysLog('Waiting for a different process to release the lock'); ! ! $i = 0;
 while ($i<$this->loops) { ! 15000 Sockets! !$i++; usleep($this->step*1000); ! 15000/req_per_proc !clearstatcache();
 !if (!is_file($this->resource)) { ! Processes! ! !// Lock became free, leave the loop
 15000 DB connections !!!! ! !$this->sysLog('Different process released the lock'); ! ! !$noWait = false; ! ! ! !break; ! ALL the processes are in ! !} ! $noWait = true; ! READY STATE! }! ! if (($this->filepointer = touch($this->resource)) == false) {! ! throw new Exception('Lock file could not be created'); ! The content could be locked }! forever! …! 40!
  • 41. Design: CMS Beolink.org! Load Balancer! Cache! Cache! Cache! …! Master/Author! 41! 9/5/11!
  • 42. Design: Enterprise Beolink.org! DNS GEO IP! Load Balancer! Load Balancer! Load Balancer! Redirect to ! Zone n! Auth! cache! cache! locators! Apps Servers! Apps Servers! Memcached! Memcached! Meta Data! DS slaves! DB CR DB CR Slaves! Slaves! Slaves! Slaves! Zone 1! …! Zone n! Replication to Region X! Ds Master! DB Master! CR Master! Region 1! 42! 9/5/11!
  • 43. Service Operation Beolink.org! Service Operation! 43!
  • 44. SO: Monitoring Beolink.org! System! q Internal! Requests stats (per second, per IP, …)! System! Concurrent Users! System load (cpu, memory,disk I/O,..)! Internal state! Number of Processes! ! Traffic ! !! APPS! Memory per instance! q External! Number of elements in Data structure! Communication Timeout! User experience, time ! spent for each component Database! (components time loading, Connection! Query time! rendering, execution,…)! Query per Table! Top query! ! ! q Alarm! Define key performance Indicator on System Capacity ! ! 44! 9/5/11!
  • 45. SO: The red button Beolink.org! q Improve capacity !! Remove controls! Increase number of systems! Dynamic to Static ! Increase TTL of cache! Async Operation! Operations Queue! ! q Disconnection! Exclusion of Cluster of users! Exclusion IP list! Bandwidth reduction! Web site Sections closure! ! 45! 9/5/11!
  • 46. Lessons Beolink.org! 7 Lessons Learned ! (so far) ! 46! 9/5/11!
  • 47. Lesson 1 Beolink.org! Partitioning Algorithms !! (application driver) ! 47! 9/5/11!
  • 48. Lesson 2 Beolink.org! Kill your Web Designer !! (one shot) ! 48! 9/5/11!
  • 49. Lesson 3 Beolink.org! Never repeat !! (caching) ! 49! 9/5/11!
  • 50. Lesson 4 Beolink.org! Share nothing !! (local content) ! 50! 9/5/11!
  • 51. Lesson 5 Beolink.org! Warm up!! ! (empty cache) 51! 9/5/11!
  • 52. Lesson 6 Beolink.org! Asynchronous! ! (queue) 52! 9/5/11!
  • 53. Lesson 7 Beolink.org! Measure, Measure, Measure, Measure, !! Measure, Measure 53! 9/5/11!
  • 54. Cloud Beolink.org! Cloud ?! 54!
  • 55. Cloud Stack Beolink.org! Things must change!! ! q  Web UI for users, affiliates, marketing, operations! q  Agile machine management is part of the API! q  Scale up -and down! q  Live upgrade of running system! q  Persistence with key-value stores! q  A Petabyte filesystem is part of the application! q  MapReduce jobs close the loop! q  Developers deploy to the cloud to test! Original work:! http://svn.apache.org/repos/asf/labs/clouds/ apache_cloud_computing_edition.pdf! 55!
  • 56. I look forward to meeting you…! Beolink.org! XVIII European AFS meeting 2011 HAMBURG – GERMANY 4-7 October Who should attend: §  Everyone interested in deploying a globally accessible file system §  Everyone interested in learning more about real world usage of Kerberos authentication in single realm and federated single sign-on environments §  Everyone who wants to share their knowledge and experience with other members of the AFS and Kerberos communities §  Everyone who wants to find out the latest developments affecting AFS and Kerberos More Info: http://www.openafs.org/ 56! 9/5/11!
  • 57. Thank you
 
 manfred@freemails.ch! ! Beolink.org!