25
SCALING DRUPAL WITH CONFIDENCE TWEENTRIBUNE CASE STUDY By:-Priyanka Jhamnani Ebizon Net Info M: 5126294253 : www.ebizontek.com E: [email protected]

Scaling drupal with confidence - Tweentribune Casestudy

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Scaling drupal with confidence - Tweentribune Casestudy

SCALING DRUPAL WITH CONFIDENCE

TWEENTRIBUNE CASE STUDY

By:-Priyanka Jhamnani

Ebizon Net Info M: 5126294253 : www.ebizontek.com

E: [email protected]

Page 2: Scaling drupal with confidence - Tweentribune Casestudy

About TweenTribune.com• 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.

• Stories chosen for Tweentribune are selected by teachers working closely with professional journalists.

• Tweens can submit links to stories they'd like to share, submit their own stories and photos, and comment on the stories they read.

Page 3: Scaling drupal with confidence - Tweentribune Casestudy

Tween Tribune Statistics• Tweentribune is a success story that has been featured in

LAtimes, YPulse.com, KillerStartups, WeMedia, GoodHouseKeeping and getting more than 3 million page views a month.

• The page views have increased drastically from 40,000 in August to 3 million in March.

• Around 1000 comments are posted per day by school kids as a part of their homework with around 23000 page views per hour.

Page 4: Scaling drupal with confidence - Tweentribune Casestudy

TweenTribune Hardware• One with apache webserver and memcache has following configuration:

Quad Socket Quad Core Intel Xeon E7440 2.4GHz

128 GB Memory

Operating System: Red Hat Enterprise Linux 5 - 64 bit

• Database server has following configuration:

RAID 5

12 GB DELL RAM

Single Socket Quad Core Intel Xeon L5520 2.26GHz

Page 5: Scaling drupal with confidence - Tweentribune Casestudy

About Ebizon NetInfo •Ebizon is one stop solution for 3 D’s

Design

Drupal

Development•Our clientele includes Tweentribune, Intel, DSM Nutritional Foods, Tata Nano, Benzinga and many more.

Page 6: Scaling drupal with confidence - Tweentribune Casestudy

About Ebizon NetInfo •Drupal Module Contributions

http://drupal.org/project/content_sliderhttp://drupal.org/project/admin_notifyhttp://drupal.org/project/localemailhttp://drupal.org/project/jquery_drag_drophttp://drupal.org/project/userloginbarhttp://drupal.org/project/soapclient  (Drupal 5 port)

•Drupal Theme Contributionshttp://drupal.org/project/ebizon_exotic_redhttp://drupal.org/project/ebizon_redfire

Page 7: Scaling drupal with confidence - Tweentribune Casestudy

What we mean by scaling?•It’s about Capacity and not How Fast

•Bottlenecks/Steps to Maximize Capacity:– Drupal/Custom Code– Mysql– Server/Apache– Caching

Page 8: Scaling drupal with confidence - Tweentribune Casestudy

Code/Module OptimizationThis is constant effort:

– What is optimum today, becomes bottleneck tomorrow

– Here optimization is done at 2 levels• Code performance

• Query optimization

Page 9: Scaling drupal with confidence - Tweentribune Casestudy

Code/Module OptimizationExample:- •Taxonomy Menu module used to

load all States, cities, schools & classroom•Ajax Menu implementation reduces

page load•Menu restructuring set only once during

the day

Page 10: Scaling drupal with confidence - Tweentribune Casestudy

Code/Module Optimization•Access logs and statistics disabled

It keeps track on every node view and therefore gets heavy on server

•Views simplified

Page 11: Scaling drupal with confidence - Tweentribune Casestudy

Mysql Configurations•Separation between Mysql and Apache

•MyISAM to InnoDB

•Number of Mysql Connections

•Optimum Mysql Timeout

•Views simplification

Page 12: Scaling drupal with confidence - Tweentribune Casestudy

Apache Configuration •Using Lighttpd lightweight webserver as a static file server

•Serves static files from a different web server than one that executes PHP

•Static files include js/css/images

•Static file server &dynamic web server shared a document root with routing request set in the code.

Page 13: Scaling drupal with confidence - Tweentribune Casestudy

Apache Configuration •Enabled mod_deflate for Apache 2 for compression of html content.

•Moved Drupal’s .htaccess to Apache’s httpd.conf.

•Minimum number of Apache modules that are required to run Drupal.

Page 14: Scaling drupal with confidence - Tweentribune Casestudy

Apache Configurations-2

•Turn Off Keep-Alive in main web server’s configuration so that connection is non persistent

•Maximum expiry to 2 years.

Page 15: Scaling drupal with confidence - Tweentribune Casestudy

Squid/Caching Reverse Proxy•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.

Page 16: Scaling drupal with confidence - Tweentribune Casestudy

Squid/Caching Reverse Proxy•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. •Squid caches css/js/image files.

Page 17: Scaling drupal with confidence - Tweentribune Casestudy

Caching•Built-in caching: Enabled•CSS Aggregation: Enabled•JS Aggregation: Enabled•Block Cache: Enabled. Static blocks were cached.•Boost: Turned off. Had problems at lot of steps.•Memcache using Cacherouter

Page 18: Scaling drupal with confidence - Tweentribune Casestudy

Memcache•All cache tables except for cache_form stored in Memcache•6 instances running on each port for each cache table: cache, cache_content, cache_page, cache_views.•Sessions stored in memcache•Cache_form cached using filecache•Cacherouter module used•Memcache module to store session

Page 19: Scaling drupal with confidence - Tweentribune Casestudy

Memcache-2•Following “difficult” tried-and-testing configuration on settings.php: $conf = array(

  'cache_inc' => './sites/all/modules/cacherouter/cacherouter.inc','session_inc' => './sites/all/modules/memcache/memcache-session.inc',  'memcache_servers' => array(    'localhost:11212' => 'cluster2',  ),  'memcache_bins' => array(    'session' => 'cluster2'  ),

Page 20: Scaling drupal with confidence - Tweentribune Casestudy

Memcache-2'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'=>'',),

Page 21: Scaling drupal with confidence - Tweentribune Casestudy

'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'=>'',),

• 'default' => array(    'engine' => 'file',   'servers' => array(),    'shared' => TRUE,    'prefix' => '',    'path' => 'sites/default/files/filecache',    'static' => FALSE,    'fast_cache' => TRUE,  ),

),

);

Page 22: Scaling drupal with confidence - Tweentribune Casestudy

Special Thanks to

Mr. Alan Jacobson

Founder of Tweentribune

for his ongoing support, patience and confidence in us!

Page 23: Scaling drupal with confidence - Tweentribune Casestudy

References•http://www.lullabot.com/articles/using-lighttpd-static-file-server

•http://2bits.com/articles/increasing-drupals-speed-squid-caching-reverse-proxy.html

•http://ebizontek.com/blogs

Page 24: Scaling drupal with confidence - Tweentribune Casestudy

Contact UsUS office

1 Autumn Ct.

East Windsor, CT 06088

USA

M:- (203) 550 4089

(510) 629 4253

India office

E-160, Sector 63

Noida – 201301

India

P:- +91120 4209635

W: http://www.ebizontek.com/

E : [email protected]

Page 25: Scaling drupal with confidence - Tweentribune Casestudy

Thanks!