Scaling drupal with confidence - Tweentribune Casestudy


Published on

The presentation is about how to scale drupal website. It presents a case study of how Ebizon scaled a drupal website to 3 million page views with handling capacity of 24,00 page views in one hour

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Scaling drupal with confidence - Tweentribune Casestudy

  1. 1. <ul><li>SCALING DRUPAL WITH CONFIDENCE </li></ul><ul><li>TWEENTRIBUNE CASE STUDY </li></ul><ul><li>By:-Priyanka Jhamnani </li></ul><ul><li>Ebizon Net Info </li></ul><ul><li>M: 5126294253 : </li></ul><ul><li>E: </li></ul>
  2. 2. About <ul><li>Tween Tribune is the world’s first Online Newspaper for Kids between the ages of 8 and 14 encouraging Kids to seek out News on a daily basis. </li></ul><ul><li>Stories chosen for Tweentribune are selected by teachers working closely with professional journalists. </li></ul><ul><li>Tweens can submit links to stories they'd like to share, submit their own stories and photos, and comment on the stories they read. </li></ul>
  3. 3. Tween Tribune Statistics <ul><li>Tweentribune is a success story that has been featured in LAtimes , , KillerStartups , WeMedia , GoodHouseKeeping and getting more than 3 million page views a month. </li></ul><ul><li>The page views have increased drastically from 40,000 in August to 3 million in March. </li></ul><ul><li>Around 1000 comments are posted per day by school kids as a part of their homework with around 23000 page views per hour. </li></ul>
  4. 4. TweenTribune Hardware <ul><li>One with apache webserver and memcache has following configuration: </li></ul><ul><ul><ul><li>Quad Socket Quad Core Intel Xeon E7440 2.4GHz </li></ul></ul></ul><ul><ul><ul><li>128 GB Memory </li></ul></ul></ul><ul><ul><ul><li>Operating System: Red Hat Enterprise Linux 5 - 64 bit </li></ul></ul></ul><ul><li>Database server has following configuration: </li></ul><ul><ul><ul><li>RAID 5 </li></ul></ul></ul><ul><ul><ul><li>12 GB DELL RAM </li></ul></ul></ul><ul><ul><ul><li>Single Socket Quad Core Intel Xeon L5520 2.26GHz </li></ul></ul></ul>
  5. 5. <ul><li>About Ebizon NetInfo </li></ul><ul><li>Ebizon is one stop solution for 3 D’s </li></ul><ul><li>Design </li></ul><ul><li>Drupal </li></ul><ul><li>Development </li></ul><ul><li>Our clientele includes Tweentribune, Intel, DSM Nutritional Foods, Tata Nano, Benzinga and many more. </li></ul>
  6. 6. <ul><li>About Ebizon NetInfo </li></ul><ul><li>Drupal Module Contributions </li></ul><ul><ul><li>   (Drupal 5 port) </li></ul></ul><ul><ul><li>Drupal Theme Contributions </li></ul></ul><ul><ul><li> </li></ul></ul>
  7. 7. <ul><li>What we mean by scaling? </li></ul><ul><li>It’s about Capacity and not How Fast </li></ul><ul><li>Bottlenecks/Steps to Maximize Capacity: </li></ul><ul><ul><li>Drupal/Custom Code </li></ul></ul><ul><ul><li>Mysql </li></ul></ul><ul><ul><li>Server/Apache </li></ul></ul><ul><ul><li>Caching </li></ul></ul>
  8. 8. <ul><li>Code/Module Optimization </li></ul><ul><li>This is constant effort: </li></ul><ul><ul><li>What is optimum today, becomes bottleneck tomorrow </li></ul></ul><ul><ul><li>Here optimization is done at 2 levels </li></ul></ul><ul><ul><ul><li>Code performance </li></ul></ul></ul><ul><ul><ul><li>Query optimization </li></ul></ul></ul>
  9. 9. <ul><li>Code/Module Optimization </li></ul><ul><li>Example:- </li></ul><ul><li>Taxonomy Menu module used to </li></ul><ul><li>load all States, cities, schools & classroom </li></ul><ul><li>Ajax Menu implementation reduces </li></ul><ul><li>page load </li></ul><ul><li>Menu restructuring set only once during </li></ul><ul><li>the day </li></ul>
  10. 10. <ul><li>Code/Module Optimization </li></ul><ul><li>Access logs and statistics disabled </li></ul><ul><li>It keeps track on every node view and therefore gets heavy on server </li></ul><ul><li>Views simplified </li></ul>
  11. 11. <ul><li>Mysql Configurations </li></ul><ul><li>Separation between Mysql and Apache </li></ul><ul><li>MyISAM to InnoDB </li></ul><ul><li>Number of Mysql Connections </li></ul><ul><li>Optimum Mysql Timeout </li></ul><ul><li>Views simplification </li></ul>
  12. 12. <ul><li>Apache Configuration </li></ul><ul><li>Using Lighttpd lightweight webserver as a static file server </li></ul><ul><li>Serves static files from a different web server than one that executes PHP </li></ul><ul><li>Static files include js/css/images </li></ul><ul><li>Static file server &dynamic web server shared a document root with routing request set in the code. </li></ul>
  13. 13. <ul><li>Apache Configuration </li></ul><ul><li>Enabled mod_deflate for Apache 2 for compression of html content. </li></ul><ul><li>Moved Drupal’s .htaccess to Apache’s httpd.conf. </li></ul><ul><li>Minimum number of Apache modules that are required to run Drupal. </li></ul>
  14. 14. <ul><li>Apache Configurations-2 </li></ul><ul><li>Turn Off Keep-Alive in main web server’s configuration so that connection is non persistent </li></ul><ul><li>Maximum expiry to 2 years. </li></ul>
  15. 15. <ul><li>Squid/Caching Reverse Proxy </li></ul><ul><li>Squid acts as a front end to web server receiving requests from it and serving them to users while keeping copies on its own cache for future request. </li></ul>
  16. 16. <ul><li>Squid/Caching Reverse Proxy </li></ul><ul><li>Squid Eases the burden on a web server that provides both static and dynamic content. The static content can be cached on the reverse proxy while the web server will be freed up to better handle the dynamic content. </li></ul><ul><li>Squid caches css/js/image files. </li></ul>
  17. 17. <ul><li>Caching </li></ul><ul><li>Built-in caching: Enabled </li></ul><ul><li>CSS Aggregation: Enabled </li></ul><ul><li>JS Aggregation: Enabled </li></ul><ul><li>Block Cache: Enabled. Static blocks were cached. </li></ul><ul><li>Boost: Turned off. Had problems at lot of steps. </li></ul><ul><li>Memcache using Cacherouter </li></ul>
  18. 18. <ul><li>Memcache </li></ul><ul><li>All cache tables except for cache_form stored in Memcache </li></ul><ul><li>6 instances running on each port for each cache table: cache, cache_content, cache_page, cache_views. </li></ul><ul><li>Sessions stored in memcache </li></ul><ul><li>Cache_form cached using filecache </li></ul><ul><li>Cacherouter module used </li></ul><ul><li>Memcache module to store session </li></ul>
  19. 19. <ul><li>Memcache-2 </li></ul><ul><li>Following “difficult” tried-and-testing configuration on settings.php: </li></ul><ul><li>$conf = array(   'cache_inc' => './sites/all/modules/cacherouter/', 'session_inc' => './sites/all/modules/memcache/',   'memcache_servers' => array(     'localhost:11212' => 'cluster2',   ),   'memcache_bins' => array(     'session' => 'cluster2'   ), </li></ul>
  20. 20. <ul><li>Memcache-2 </li></ul><ul><li>'cacherouter' => array( 'cache_page' => array( 'engine' => 'memcache', 'servers'=> array('localhost:11211'), 'shared'=>FALSE, 'prefix'=>'', ), 'cache' => array( 'engine' => 'memcache', 'servers'=> array('localhost:11213'), 'shared'=>FALSE, 'prefix'=>'', ), 'cache_menu' => array( 'engine' => 'memcache', 'servers'=> array('localhost:11214'), 'shared'=>FALSE, 'prefix'=>'', ), </li></ul>
  21. 21. <ul><li>'cache_filter' => array( 'engine' => 'memcache', 'servers'=> array('localhost:11215'), 'shared'=>FALSE, 'prefix'=>'', ), 'cache_block' => array( 'engine' => 'memcache', 'servers'=> array('localhost:11216'), 'shared'=>FALSE, 'prefix'=>'', ), 'cache_content' => array( 'engine' => 'memcache', 'servers'=> array('localhost:11217'), 'shared'=>FALSE, 'prefix'=>'', ), </li></ul><ul><li>'default' => array(     'engine' => 'file',    'servers' => array(),     'shared' => TRUE,     'prefix' => '',     'path' => 'sites/default/files/filecache',     'static' => FALSE,     'fast_cache' => TRUE,   ), ), ); </li></ul>
  22. 22. <ul><li>Special Thanks to </li></ul><ul><li>Mr. Alan Jacobson </li></ul><ul><li>Founder of Tweentribune </li></ul><ul><li>for his ongoing support, patience and confidence in us! </li></ul>
  23. 23. <ul><li>References </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul>
  24. 24. Contact Us <ul><li>US office </li></ul><ul><li>1 Autumn Ct. </li></ul><ul><li>East Windsor, CT 06088 </li></ul><ul><li>USA </li></ul><ul><li>M:- (203) 550 4089 </li></ul><ul><li>(510) 629 4253 </li></ul><ul><li>India office </li></ul><ul><li>E-160, Sector 63 </li></ul><ul><li>Noida – 201301 </li></ul><ul><li>India </li></ul><ul><li>P:- +91120 4209635 </li></ul><ul><li>W: </li></ul><ul><li>E : [email_address] </li></ul>
  25. 25. <ul><li>Thanks! </li></ul>