• Like
  • Save
Implementing High Performance Drupal Sites
Upcoming SlideShare
Loading in...5
×
 

Implementing High Performance Drupal Sites

on

  • 4,343 views

UniMity's substantial presence in Drupal Camp Deccan 11-11-11 in HYD. Audience were just applauding with gusto at the end of our presentation (How to build and maintain high performance websites)

UniMity's substantial presence in Drupal Camp Deccan 11-11-11 in HYD. Audience were just applauding with gusto at the end of our presentation (How to build and maintain high performance websites)

Statistics

Views

Total Views
4,343
Views on SlideShare
1,960
Embed Views
2,383

Actions

Likes
1
Downloads
23
Comments
0

39 Embeds 2,383

http://shyamala-drupal.blogspot.in 976
http://shyamala-drupal.blogspot.com 838
http://blog.betabasket.net 193
http://shyamala-drupal.blogspot.co.uk 65
http://shyamala-drupal.blogspot.fr 42
http://shyamala-drupal.blogspot.de 36
http://shyamala-drupal.blogspot.ca 25
http://shyamala-drupal.blogspot.com.es 23
http://shyamala-drupal.blogspot.ru 18
http://shyamala-drupal.blogspot.com.br 15
http://shyamala-drupal.blogspot.com.au 15
http://shyamala-drupal.blogspot.com.ar 13
http://shyamala-drupal.blogspot.it 10
http://shyamala-drupal.blogspot.be 10
http://shyamala-drupal.blogspot.mx 10
http://shyamala-drupal.blogspot.nl 9
http://shyamala-drupal.blogspot.ro 9
http://shyamala-drupal.blogspot.gr 9
http://shyamala-drupal.blogspot.se 6
http://shyamala-drupal.blogspot.co.il 6
http://shyamala-drupal.blogspot.ch 5
http://shyamala-drupal.blogspot.sg 5
http://shyamala-drupal.blogspot.jp 5
http://translate.googleusercontent.com 4
http://shyamala-drupal.blogspot.co.nz 4
http://shyamala-drupal.blogspot.dk 4
http://shyamala-drupal.blogspot.fi 4
http://shyamala-drupal.blogspot.ae 4
http://shyamala-drupal.blogspot.pt 3
http://webcache.googleusercontent.com 3
http://shyamala-drupal.blogspot.cz 3
http://shyamala-drupal.blogspot.kr 3
http://shyamala-drupal.blogspot.co.at 2
http://shyamala-drupal.blogspot.sk 1
http://shyamala-drupal.blogspot.no 1
http://shyamala-drupal.blogspot.ie 1
http://shyamala-drupal.blogspot.hu 1
http://www.new-easy-php.blogspot.nl 1
http://drupalseotraining.blogspot.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Performance of a website is the Speed at which the website can be accessed by the end user. - how fast the website can handle a single request. Scalability - how many requests your application can handle at the same time, or the amount of information it can store and process. - capability of a system to increase total throughput under an increased load when resources are added
  • Three Layers of performance are Users(Browser), Server side and Application (i.e Drupal) We will be concentrating on Application. Here I will brief you on User end. Size of page components plays a major part in perfromance - HTML Dom elements - Js files - CSS files - images To reduce the size of the components - Write simple code with good planning. - Minfy the js and CSS files - compress page components using GZIP of Apache No of request ( less no of request faster the page load ) To reduce the request compress many files into single files for js and css ( if you have many css or js files ) use sprite images for CSS background image Browser Cache Assign Expires header for long period, so that browser woouln’t request the page components for every page request Enable ETags which assist to load the files that is changed.
  • Drupal in Core has a dedicated page for configuring the cache and page compression In Settings page Drupal allow us to configure the cache by enabling and assigning the lifetime for the cache There a option to enable the block cache – which will be useful for authenticated users , as page cache won’t available for authenticated user, but one thing we have to keep in our mind is that block module won’t cache the block if the user access is defined. Enable the page compression Optimise the CSS files – which will compress many files to single file Optimise the Javascript file - which will compress many file to single file. Other than the Drupal core, the module we use frequently like views and panels will also provides us feature to manage the cache on there own. Views provide us two options to cache, i.e cache query and cache rendered html which is time based. For Logging Error’s Drupal provides two option one is Dblog and Syslog, Dblog is used to log the activities in DB, whereas Syslog user file system to log. In high traffic sites it is recommended to use syslog and DBlog frequent writing will cause the mysql to slow. And if your db engine is Myisam it will be more slow as Myisam has table lock. Use Developer tools, to assist in fine tuning the performance for example use Devel module to analyse the SQL query executed while a page renders. - Check the repetition of SQL queries, if so try to reduce the duplication, if the same function getting called more than once and executing same query then use static variable to return the result set. - Check the execution time of the SQL query if it takes more than 3 ms then analyse the query with Explain command in mysql, with the help of this analyses try to index the columns of the table used in “where” condition. Makesure all tables using index. Use DB tuner a module suggest to fine the MYSQL database - it will suggest to index the some CCK table columns - it will suggest some changes to MYSQL configuration ( Get the help of the system Admin to implement this. Don’t go by all suggest, take decision on your own by analyzing other parameters )
  • Always it is recommended to follow the Coding standards defined in Drupal.org Split the module file as possible if the line of code goes more than 300 Get the clue from other drupal contributed module, it is familiar to see theme.inc, admin.inc, pages.inc in the module folder Resuse Drupal functions – before writing a function make sure, Drupal doesn’t have the same. Use Static Variables to cache the content inside a function, you can refer the node_load for example , node_load will store the node objects in the static variable and it will render the a node object singe time, next time it will return the object from the cache. This cache will be retained for single page render. Query VS use of views Views always use left Join which will have some impact on execution time. View is heavy compare to Query as we have freedom to construct the query as we required. views allow us to build a block or page with minimal efforts. So if we use views don’t think that all queries wrote by views are optimized, Analyse each query and make required changes to the views query using appropriate hook’s hook_views_query_alter(&$view, &$query) { If required you may also write your own cache using cache api CACHE_SET, CACHE_GET
  • Advacned Caching systems are available instead of Drupal’s DB cache. Like, BOOST, MEMCache, Varnish. Boost is the module which saves all pages as static html files and serve static files to the anonymous user. MemCache is the module which uses the memcache to store the caches in the memory instead of DB Varnish is also a like memcache which caches the pages in memory.
  • The Event Based Caching is one of powerfull way of handling our cache in drupal, We must have a through cache management, usually the cache is managed time based. But this time based cache is having downside that is if the time expires, though the content changed or not it will re-generate cache content, as this is as unneccesary load to server and So cache the content for long life term and clear cache only required region or block every event triggered. This will help us to reduce the load to server and serve the content more from cache.
  • This is the template used to manage cache for time based.
  • This is the template used to manage cache for event based.
  • Less SQL Path round trips Maintains a list of white listed paths that need url Alias, eg user/ doesnot use path alias, then no query sent to path table Per page cache of Pathalias On Cache miss only a particular tables caches get rebuilt and on Cache hit with just a couple of queries the pages are built. The down side is the storage need per page & how this increases with no of pages in a site - memcache. entity load vs node load functions - array of entities at a time, the concept of multiple load Per CCK storage no longer there -> could be a load, write storage backends raw Drupal 7 is still bad then Drupal 6, but can easily plugin external caching systems & storage engines to improve perforamcne.
  • Question ?

Implementing High Performance Drupal Sites Implementing High Performance Drupal Sites Presentation Transcript

  • Presentation Title w w w . u n i m i t y . c o m DEC 2010 Implementing High Performance Drupal Sites Unimity Solutions. 3, 5th Floor, "Kasi Arcade" 116, Thyagaraya Road, T.Nagar, Chennai 600017 India, Phone: (91- 44) 43923800 www.unimity.com By Kamalakanan & Shyamala
  • Presentation Path
    • What is “Performance”?
    • Different Layers of Performance
    • How to configure Drupal for Performance
    • Writing Drupal Modules for High Performance
    • Some Advanced Techniques & Caching Systems
    • Event Based Caching
    • Drupal 6 vs Drupal 7
    • Performance in Drupal 8
  • What is “Performance”?
    • The performance of a website is the speed at which the website can be accessed by the end user.
    Response Time Availability Scalability
  • Different Layers of Performance
    • User end
      • Size of Page
      • No of request
      • Browser Cache
    • Server side
      • PHP
      • MySql
      • Apache
    • Application End
      • Drupal
  • How to configure Drupal for Performance
    • Using Drupal Cache
      • CSS JS Aggregation
      • Page Cache
      • Views, Block, Menu, Panel, Form Cache
    • Number of Modules
    • Sys Log vs DB log
    • Developer Tools
      • Devel
      • DB tuner
  • Writing Drupal Modules for High Performance
    • Coding Standards
    • Size of files
    • Appropriate use of inc files
    • Reuse Drupal functions as much as possible
    • Use of Static Variables
    • Efficient code
    • Query vs use of Views
    • Writing Custom Cache
  • Some Advanced Techniques & Caching Systems
    • Event Based Caching
    • Boost
    • MemCache
    • Varnish
  • Event Based Caching
  • Event Based Caching vs Time Based Caching twice a day (Separate cron ) No Tag cloud   All  Once a Day (Separate cron) No Birthday Wishes   Home Once a day (separate cron) No Active members   Home   yes Display Name--> Did You Know Home Home   yes Display Name --> Spotlight Home Home   yes Display Name --> Home Slide Home Home           Time Based - update Frequency Event based Display Name View Name Page
  • Importance of planning for Cache Sheet   yes Display Name --> Announcement news_page Announcements             yes Display Name -->Buzz Zone       yes Display Name --> Recent topics,       No Display Name -->Popular in corporate zone,       yes Display Name --> Corporate Zone, rightside_blocks               yes Display Name --> News news_page           News Time Based - update Frequency Event based Display Name View Name Content Type
  • Performance in Drupal 6 vs Drupal 7
      • Less SQL
      • Path round trips
      • Entity Load vs Node Load
      • CCK Storage vs Entities
  • Performance in Drupal 8
    • Performance Gates
      • SQL queries
      • Memory usage
      • CPU
      • System calls
      • Front end
  • Expert Knowledge Groups – Groups.Drupal.Org
    • Thank You!