P. 1


|Views: 21|Likes:
Published by steveburrows_uk

More info:

Published by: steveburrows_uk on Feb 23, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Drupal Performance Tuning

May, 2010

Germán Villacreces

Performance Tuning Drupal
Table of C ontents Introduction Tes t environment The Tes t S ite The Virtual S erver Tes ting tools S ingle P age Load Tes ting Tools Load Tes ting Tools E valuating the current performanc e S ingle P age Load R es ults Load Tes ting R es ults Optimizing Drupal Front-end Optimization Us e a C DN Make Fewer R eques ts Add E xpires Headers C onfigure E ntity Tags (E -Tags ) Us e C ookie-Free Domains B ack-end Optimization P age & B lock C aching B oos t Optimizing your s erver Tuning Apache Tuning MyS QL Tuning P HP AP C Memcac he E valuating the performance after optimization S ingle P age Load R es ults Load Tes t R es ults C onclus ion Drupal S ucc es s S tory Additional Drupal R es ourc es from Os hyn About G erman Villacreces About Os hyn 3 4 4 5 5 5 6 7 7 12 12 12 13 13 13 14 14 15 15 15 16 17 17 19 19 21 22 22 24 25 26 28 29 29

T he evaluation will focus on the res ults of tes ting the res pons e time and amount of reques ts per s econd (R P S ) that the s erver c an hold before the average load time is unac ceptable. 10. The firs t evaluation will be done with the default c onfiguration of Drupal and the s erver. K eep in mind that this public ation is to evaluate the performanc e of Drupal for s mall s ites with low traffic. . The s econd evaluation will take plac e after optimizing both.Introduction This paper evaluates the performanc e of a s mall s ite built with Drupal on a s tandard virtual s erver running Ubuntu S erver E dition 9. T he s erver will have the minimum s pecs . The res ults from the evaluations will be compared to get to a good idea of how fas t c an Drupal run on a virtual s erver with the minimum s pecs . you will know whether a s imple virtual s erver is more than enough for a low traffic s mall webs ite and you will learn how much the performance of Drupal can be improved by jus t tuning the s ettings and the s erver. After reading this paper.

6 kb) . MiniPanels and PanelNodes) Blog Color Comment Contact Content Translation Token and token actions Database logging Help Locale Menu Path PHP Filter Search Taxonomy Update status Upload ImageAPI with GD2 ImageCache & ImageCacheUI CKEditor FlashNode Global redirect Pathauto PDF version Printer-friendly pages Send by e-mail SWFTools and SWFObject Google Analytics The s ite was built us ing the features from all the above modules . 5 kb) 1 XML as ynchronous page reques t (510 b) 16 s tyles heet reques ts (10. 16). 5 different views are us ed. The s ite makes us e of the following modules in addition to the required core modules : Administration menu Views and ViewsUI CCK and all Submodules FileField. The page has numerous elements : 1 HTML page reques t (4. This is what it looks like: This page is built with the P anels module.Tes t environment The Tes t S ite The s ite us ed for this benchmark was built with the lates t Drupal 6 releas e at the time of this writing (Drupal 6. 9 kb) 5 J avaS c ript reques ts (29. The homepage will be the target for all the tes ting. ImageField Panels (CTools.

Tes ting tools When tes ting the performance of a s ite. S ingle P age Load Testing Tools We need to meas ure how long it takes to load all the page elements that form . The Virtual S erver The virtual s erver us ed has the following s pecs : Intel C ore 2 Duo 2. 10 MyS QL 5. 12 P HP 5. 6 kb) Lazy loading is us ed for the Flas h additional reques ts and the XML s o the total initial page reques t s ize is 19 0. we as k ours elves . S o the homepage is a little over the above bec aus e of the main Flas h element. 0 G hz 64-bit architec ture 70G B dis k s pac e 2G B R am The virtual s erver runs under VMware E S X 3i. 2. 6 kb and the additional reques t s ize is 713. 37 ins talled Apache and P H P configurations are s et with Drupal' s requirements :     Apache mod_rewrite extens ion enabled P HP G D library extens ion enabled P HP R egis ter G lobals variable is s et to off.9 image reques ts (102. Memory limit is s et to 96Mb bec aus e this is the minimum rec ommended library when us ing the ImageC ache module. 1 kb The average total page s ize ac cording to a res earch made is 130kb. 2. how we s hould meas ure this ? T he res pons e time when loading a page? The volume of us ers that c an ac ces s the s ite at the s ame time without the s erver c ras hing? T he ans wer is both. 10 64-bit. The web s erver L AMP s tack vers ions are: Apache 2. 3. 5 kb) 1 intial Flas h reques t (45 kb) 4 additional fFas h reques ts (712. 0 The OS ins talled is Ubuntu S erver E dition 9. Our approach will evaluate the performance of a Drupal s ite in a virtual s erver by meas uring the res pons e time of the homepage and the number of reques ts per s econd the s erver c an take without c ras hing or c aus ing reques t queues . 5. 1. We s hould keep that in mind.

T his is under the average IS P s peed in the US but can be cons idered as an average worldwide ac cording to this global report from mos t popular s peed tes ts s ites s peedtes t. This tas k is not c omplic ated. The firs t tool we are going to us e is very popular. 62 Mb/s connections . T here are great meas uring tools that let you know how fas t or s low your page is loading. we c an us e Apache' s jMeter to run the tes ts . we need to define the maximum waiting time we are to ac cept before cons idering that the s erver cannot take any more load. we are going to s tick to the traditional 8s econd rule. This is bec aus e this value is different for people depending on the content they are waiting to s ee. The R P S value will increas e until the s erver' s res pons e time is not acc eptable. .the homepage. including a "waterfall" view of the page load. we will conc lude that the s erver c an’ t take any more reques ts . This inc ludes the HT ML. org c onduc ts a tes t to the s ite you want from the different loc ations in the world and returns s everal res ults . YS low grades your s ite' s load time us ing s everal c riteria. To keep things s imple for thes e tes ts . C S S files . It is important to point out that the tes ts are made from average 0. As s oon as we have an average res pons e time above 8 s econds . T he total page load time and a grade are the two main values we are interes ted in. This can be very complicated to ans wer if we try to generalize a univers al acc eptanc e res pons e time. The s ite webpagetes t. The load tes ting will be executed with different R P S values each time while monitoring the s erver' s health. Load Tes ting Tools The load tes ting tools are needed to meas ure the amount of traffic that your s erver can take before us er reques ts are queued or the s erver cras hes . Y S low is a Firebug extens ion which is a Firefox plugin. it’ s c alled YS low. T o improve your overall res ult you mus t get a better grade on each criteria. The s econd meas urement tool we are going to us e is an online web page tes t tool. B efore beginning to tes t. images and Flas h files . net. J avaS cript files .

S ingle P age Load R esults The next figure dis plays the detailed grading provided by Y S low: T he overall grade is D. Thanks to this tool we know what we c an do to get a better grade and feel confident that our s ite is optimized as much as pos s ible in the front-end. YS low als o dis plays that the page load time was : onload: 2. We are s tarting with 1G B of R AM in the s erver and evaluating all the res ults . 88s total load: 10. we can’ t really judge by making a s ingle page load. 32 s econds to load. 1 kb. 32s This means that the page took 2. we have not changed anything in the Drupal s ite to optimize it.E valuating the current performance S o far. T his s econd number may s eem high. Now. . but you need to unders tand that it’ s bec aus e of the Flas h and XML files that s um up to a total load weight of 713. s o we will try this 20 times to obtain average values . 88 s econds to initially load but the total page res pons e that inc ludes the 4 additional Flas h objec ts and the XML file that are loaded as ynchronous ly took 10. this is pretty bad but we c an' t really as k for more cons idering that none of the Drupal optimization features are enabled.

87 3.88 3.26 10.29 10.627 2.913 2.32 10.88 3.333 4.62 10.41 10.307 5.26 10.347 4.54 10.12 10.24 10.29 3. the graph for thes e res ults is dis played below: Num 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Average Initial Load 2.31 10.72 3.67 3.27 4.387 3.953 3.818 2.42 11.9 10.68 10.75 10.195 2.32 11.17 11.36 10.41 10.24 4.547 .26 10.49 3.Here are the res ults .3 10.261 3.141 7.7796 Total Load 10.

We will again make an average of all the res ults . This is why we are going to us e the s econd tool we talked about before.12 10 Seconds Initial Load Total Load 8 6 4 2 0 1 2 3 4 5 6 7 8 9 10 11 Initial Load 12 13 14 15 16 17 18 19 20 Number of Request The average initial load takes 3. The meas urements dis played by Y S low are pretty good. 55 s econds . US A C alifornia. but we can improve this and we als o want to get a good grade to leave the s ite as optimized as pos s ible in the front. this time cons idering meas urements from different loc ations in the world:      Virginia. 78 s econds .end. 5 Mbps ADS L connection. US A G louc es ter. but you are probably thinking that they c an' t really be cons idered as clos e to reality as pos s ible bec aus e we are trying from a s ingle loc ation. the average total load takes 10. The initial load is within the ac ceptanc e limits . . Us ing this tool will give us more ac curate meas urements bec aus e the tes ts are conducted from different locations around the world. webpagetes t. C hina Wellington Note: All thes e locations have a 1. org. UK J iangs u.

the average initial load of the page takes 7.Here is a s c reens hot of the res ults from the firs t location (E as t C oas t US A) As you c an s ee. This is a little higher than the res ults we made from Here are the res ults for all the locations . 06 s econds . the total load time is 15. . 207 s econds .

and the average total load is 2 0. we do need to make a few adjus tments to the front.554 6.807 13. China Virginia.UK Initial Load Total Load 7.194 21.40 35 30 Seconds Initial Load Total Load 25 20 15 10 5 0 Initial Load Location Jiangsu. USA Gloucester.109 15. USA .end optimization.308 23. Average (seconds) Wellington. This is above the ac ceptanc e limit (8s ).3742 The res ults s how that the average initial load value is 1 3.382 35.207 6.7106 20. New Zealand California.06 15.554 18. 3 7 s ec onds .249 21. 7 1 s ec onds . E vidently.

our current overall grade is D.685 50 RPS 15.000 4.654 30 RPS 9.000 2.000 0. The res ults after increas ing the amount of R P S are the following: Average Load Time 16. 943 s econds . We are going to bas e our actions on the recommendations that Y S low gives us s o we c an get a better grade. but do keep in mind the s erver s pec ifications and that no optimization changes have been done to the s erver or the s ite.943 40 RPS 11. W e c an s afely s ay that the virtual machine. with the current configuration c an only ac cept 20 reques ts per s econd.000 Seconds Average Load Time 10. . we mentioned we were going to us e jMeter.027 20 RPS 6.000 14.000 12.031 The average load time when making 30 R P S is 9. this is above our ac c eptanc e value. s o lets apply all the recommendations pos s ible and get A' s on all pos s ible c riteria.Load Tes ting R esults To tes t the amount of load the s ite c an handle.000 10 RPS 20 RPS 30 RPS 40 RPS 50 RPS Requests per Second Average Load Time 10 RPS Average Load Time 4. R emember.000 6. Optimizing Drupal Front-end Optimization Let’ s s ee how we c an optimize the s ite to get a better load time.000 8. T his is a great tool and it’ s all we need for the purpos es of this public ation. This value is low.

We do this by login in as the admin. The next s tep is to s et the expires value. In mos t c as es . going to S ite C onfiguration > P erforma nc e and enabling the "O ptimize C S S files " and "O ptimize J avaS c ript files " in the B andwidth Optimizations fields et. Make Fewer R equests In this criterion. conf file that looks like this : #LoadModule expires_module libexec/apache2/mod_expires. our grade is F bec aus e we have too many reques ts . load in /etc /apache2/mods . It does help front.enabled. this module will be loaded by default. you need to firs t enable the mod_expires module in Apac he by unc ommenting the line in the httpd. S ave the form and lets continue. s o you will not need to do anything.so K eep in mind that the exac t path of this line will vary on the different type of Linux dis tributions .end performanc e enormous ly.load /etc/apache2/mods-enabled/. Add E xpires Headers Us ing expires headers avoids unneces s ary HTT P reques ts when the us er vis its the s ite more than onc e by making files cacheable. module enabling is done a little differently. In this Ubuntu s erver edition. Drupal can gather all the s tyles heets and J avaS c ript files to two s ingle reques ts . W e do this running the following command in the s erver: sudo ln -s /etc/apache2/mods-available/expires. To add the expire headers to c acheable files . all we have to do is create a s ymbolic link of /etc /apac he2/mods available/expires . If you are us ing a Linux dis tribution .Use a C DN Integrating a C DN is not s omething we are going to do for now s ince it requires a cons iderate ec onomic inves tment. but in this paper we are going to try to inc reas e the performanc e of Drupal with what we have at hand.

we add thos e likes to an empty file we c reate c alled expires . This way we reduce the overhead on s tatic files . conf file. J avaS cript files and s wf files . This group c an be in your httpd. c onf file or ins ide your <VirtualH os t> definition. W e are not going to get into any details of how to do this .conf /etc/apache2/mods-enabled/. com. To dis able the e-tags you will need to include two directives wherever your s ite folder <Directory> group is . Apache has e-tags enabled by default in mos t vers ions . W e are going to dis able them bec aus e they don' t really help that much and this way we' ll reduc e overhead on the res pons e. The s ec ond s tep here is to create another virtual hos t on Apac he. c onf file: <IfModule expires_module> ExpiresActive On ExpiresDefault "access plus 6 months" </IfModule> In our dis tribution. ins tead of adding thes e lines to the httpd.other than the one we are us ing here you might have to s et this value by adding the following line at the end of the httpd. You c an res tart Apac he to tes t if this works . conf. You c an us e a domain like www. This file needs to be place in the /etc/apache2/mods -available directory and we c reate a s ymbolic link to it on /etc/apac he2/mods -enabled: sudo ln -s /etc/apache2/mods-available/expires. Once your domain is ready you can tes t it by opening it in the brows er and you s hould be able to view your s ite. When a s ite runs on a s erver farm. On s tatic files like images . C onfigure E ntity Tags (E -Tags ) E -Tags help the brows er identify files in the cache. The firs t s tep is to c reate a domain that points to the s ame s erver.tags c an degrade performanc e becaus e the tags c an make two identic al res ourc es s eem different and therefore s kip caching. Note: T he directive value "ac ces s plus 6 months " means we s et the expire to be added to the eac h file s o that it caches the file for the next 6 months s inc e the firs t time it was acc es s ed. H eader uns et E T ag FileE T ag N one Use C ookie-Free Domains When the brows er makes reques ts to the web s erver. e. it s ends cookie data on the header. s tyles heets . but you c an follow this . You s hould now get an A grade on the E xpires Headers c riteria. Thes e are the two lines you need to add to dis able entity tags . s tatic-yours ite. the c ookie data is not needed s o thes e files s hould be placed on a s eparate cookie-free domain.

the value we input is http://os hyn-s tatic. Download (http: //drupal. c om/projec t/cdn) which is us ed to pull s tatic c ontent from another domain or s ubdomain. we will evaluate the res ults later on after c ompleting all optimizations . You might notic e there is another property we c an s et. it can c ac he blocks . We have made all the adjus tments in the front-end.(http: //httpd. The native optimization features help a great deal s inc e they are c ac hing s ys tems within the core Drupal code. This way all blocks wont have to be recons truc ted on each page load. S ave the form and flus h your s ite' s cache. enable C ac hing mode to Normal and als o enable P age C ompres s ion. 0/vhos ts /examples . org/project/boos t) and ins tall this module on your s ite. go to S ite C onfiguration > P erformance. P age & B loc k C aching B y enabling page caching Drupal does not build a page eac h time an anonymous us er vis its . apac he. This way when anonymous us ers open a content page. In our c as e.com. it literally turns a Drupal page to a s tatic HT ML file. this will have a s ignific ant boos t. The s erver name and s erver alias s hould be the domain name you created in the firs t s tep and you s hould inc lude in the virtual hos t <Direc tory> direc tive group the following lines that dis abled the cookies : RequestHeader unset Cookie Header unset Set-Cookie The third and final s tep is to make Drupal point all s tatic files to your s eparate domain. it’ s us eful when your s ite gets a big amount of traffic and content updates don' t need to be "live" and c an wait an hour. The s ame way Drupal can c ac he pages . enable B lock cache too. Make s ure you us e the <Directory> group while c reating your new virtual hos t. B oos t This is a very helpful module for s ites that have mos tly anonymous traffic. . In the P age C ac hing fields et. We do this by ins talling the C DN Integration module (http: //drupal. Login to your admin ac count. two hours . Minimum C ache Lifetime. B ac k-end Optimization There are many ways we c an improve the performanc e of Drupal without touching the s erver yet. or even a day. go to the bas ic mode s ettings in S ite C onfiguration > C DN Integration > B as ic mode. HTML) or any tutorial online. In this s c reen input your s tatic domain to the one you jus t created in this s ection' s firs t s tep. Finally. go to the tab called S ettings and click on the E nable radio button under S tatus . S ave the form. org/docs /2. It caches all s tatic pages . This is bes t left alone in this cas e. and we need to configure it. Ins tall the module. Drupal does n’ t have to pull data from the databas e to render the page.

then jus t go to S ite S ettings > P erformanc e > B oos t S ettings and at the bottom of the form.php Next we need to c reate the following nes ted folders in your root folder: cache/perm/[yours ite. org/cron. php file in our s ite. go to http: //drupal. . chmod -R 777 cache There is an additional s tep we' ll need to do but we can' t yet. For now if you get a "file_get_contents . . Firs t we need to prevent web c rawlers from indexing the output of the module in c ertain files . All thes e changes have been done to Drupal. s o remember that. txt file. located in the root folder of your s ite: Disallow: /boost_stats. we made all pos s ible optimizations in the front-end s ide. we log in to the s erver us ing the admin ac count (not root). com value for your real domain. For additional help on s etting up c ron.htac ces s warning c heckbox. Optimizing your s erver S o far we have done a lot of tuning. the las t s tep to make B oos t work is done in the Apache tuning s ec tion. thats all we need in our c as e. c ron.php What we are doing here is telling cron to exec ute a command every hour. S o we add the following line at the end of the robots .com/cron.To configure B oos t properly and quickly. go to the admin/reports /s tatus page in your s ite and you will s ee all the things that need to be done to make this module work. run the "chmod" command from the root folder.-q -t 1 http://yoursite.c om] And give them writing acc es s to Apac he. we have tuned Drupal enabling all its default caching options and we have ins talled the B oos t module. " warning in the admin s ec tion. find the Ignore . R emember. And we edit c rontab with the following command: sudo crontab -e We then add the following new line: 0 * * * * wget -O . now let' s optimize our s erver c onfiguration. W e' ll do it when we tune Apache in the next s ec tion. We can move on to our las t s tep of B oos t configuration. The c ommand is to make an http reques t to the cron. We don’ t need to change anything els e here now. s elec ted and s ave the form. You will need of c ours e to replac e the yours ite. S etting up cron is really eas y.

S ave the file. Als o.*)$ index. us e the doc umentation that B oos t provides in their projec t page (http: //drupal. if there are files there it means boos t is working fine. Hardware upgrade Tune the mys ql s ettings Optimize your queries In our c as e. everything c ounts right? T o do this you can jus t pas te the following c ode in your <Direc tory> directive within your hos t on top of the entity tag direc tives placed before. go back to make s ure all s teps were completed. htacc es s file. and us ers do more reads from the databas e than writes . C opy that c ode and pas te it under the rewrite rules you jus t added to your <Directory> direc tive. T he only optimization left to do is to move all the rewriting rules from your . Login as the admin in your s ite and go to S ite configuration > P erformance > B oos t htacc es s rule generation. com] folder you c reated for B oos t before. AllowOverride None Order allow. T here are a few s ettings we c a n c hange to inc reas e the performa nc e of M yS Q L for our s ite. 2. its good to have a good amount of query c ache s ize. Tuning MyS QL MyS QL is probably one of the mos t complic ated components to tune. htac ces s files . The directive AllowOverride None tells Apache not to look for the . here is when we add the mis s ing piece from the B oos t module.php?q=$1 [L.QSA] This code is the exis ting code in the . T he reas on for this is bec aus e the optimal configuration is different depending on the s ite you have. In our cas e.deny allow from all RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(. hardwa re upgrade is not an option as we are trying to keep this performanc e with minimum expens es . org/project/boos t). dis abled the entity tags and configured a c ookie-free domain. we have already done s ome tuning in Apac he. s ince we have a lot of reads . htacc es s files on all folders and get a s mall performanc e improvement. Now. res tart Apac he and tes t your s ite s o that friendly urls are s till working. To optimize our s ite we c an do three things : 1.Tuning Apache As you know. we have s etup the expire headers . s omething is wrong. G o to the . check the cac he/perm/[yours ite. htacc es s file to your Apac he configuration file. We do this s o we c an tell Apache not to look for . 3. our traffic is mos tly anonymous . This is all we need to do for Apache. If not.

You c an s ee the maximum number of connec tions your databas e has handled us ing the following MyS QL command: mysql>SHOW STATUS LIKE 'max_used_connections'. . T ables are s tored as files in MyS QL. MyS QL c an leave thes e files open s o that next time it reads them it won’ t need to reopen them.cnf E dit the file with s udo us ing any editor. if you find that MyS QL does not take a lot of your memory up and C P U. find the query_cac he_s ize and change it to 32M. The s econd c hange we need to make helps limit the s erver res ources us e in the MyS QL proc es s . We s et this value to 500 to s ee how it works . you c an s ee if the value you input is the bes t by monitoring the query c ache. it s hould look like this : query_cache_size = 32M This value s hould be c hanged depending on the traffic on your s ite. G o to the MyS QL cons ole and type: mysql>SHOW STATUS LIKE 'open%tables'. It is us ually located in /etc/my. to s ee how MyS QL res ponds . c nf file: max-connections=500 This s ets the maximum number of allowed connections . we c an s ee if with this value MyS QL has had the need of reopening tables . while tes ting your s erver. L ogin as the root us er in the MyS QL cons ole and type: mysql>SHOW STATUS LIKE 'qcache%'. cnf. We unc omment and c hange the following line in the my. cnf. Y ou c an type the following command anywhere to find the loc ation of yours : locate my.MyS QL s ettings file c alled my. this means that each table file needs to be opened for read. MyS QL c an leave a c ertain number of tables open. you do this in the MyS Ql cons ole. if you allow too many connections MyS QL may take all of your s erver res ourc es and eventually cras h. c nf or /etc/mys ql/my. B e careful though. The third and final change we are going to make in the MyS QL s ettings is in the c ac hes . you c an inc reas e this value to allow more connections at the s ame time. You c an monitor thes e values while tes ting your s ite. its default value is 100.

We need to cons ider that with the caching s ettings we have s et in Drupal and with the B oos t module ins talled.log Tuning P HP There are two ways to optimize P HP and both work great. T he only thing we need to make s ure now is to c hec k if there are any s low queries running on our s ite. HT ML = /var/log/mysql/mysql-slow. you don’ t need to change anything. R eading from memory is much fas ter than reading from dis k s o it’ s a great way of optimizing the s ite. this c aching s ys tem s tores data objec ts in memory. T o c hange more advanc ed s ettings pleas e refer to the following guide http: //www.log You will then s ee what queries are running s low and you c an optimize them.tunelamp-3. This s ys tem c aches the opcode generated when P H P is interpreted. we need P E C L s o we c an ins tall AP C from the lates t repos itories . To do this run: tail -f /var/log/mysql/mysql-slow. com/developerworks /linux/library/l. if it’ s more than 0 then you s hould c ons ider increas ing the table_c ache value in my. you will need to monitor the mys ql-s low. Ins tall all required libraries from aptitude firs t: . AP C The following ins truc tions explain how to ins tall AP C on the Ubuntu s erver we have s etup for our s ite. the default is 2.If the "opened_tables " value is 0. log file. The s econd way is to ins tall Memcache. Optimizing MyS QL is probably the hardes t s inc e you have to us e trial and error to get to the bes t s ettings for your s ite and bec aus e there are s o many s ettings you c an change. that way MyS QL does n' t s pend muc h time opening table files . our s ite won’ t need to make as many databas e reads as before. cnf file: log_slow_queries long_query_time = 5 log-queries-not-using-indexes Make s ure you change the long_query_time to 5. To do this unc omment the following lines in your my. ibm. and res tart MyS QL s o all s ettings take effect: sudo mysqld restart While navigating through your s ite. In our cas e we wont make additional changes s ince our s ite won’ t benefit from all of them. us ually res ults from the databas e. S ave the file. There are many other c hanges you can make to optimize MyS QL even more. c nf. T o get AP C up and running. One is to ins tall AP C (Alternative P H P C ac he).

php file to our s ite folder: cp APC-3. the opcode is being generated and kept on cache. After brows ing through the s ite for the firs t time after AP C is ins talled.ini Then jus t res tart Apac he and that’ s it: sudo /etc/init.so" > /etc/php5/apache2/conf.sudo aptitude install php-pear sudo aptitude install php5-dev sudo aptitude install apache2-dev Now we ins tall AP C us ing P E C L: sudo pecl install apc Next you need to enable AP C on Apac he: sudo echo "extension=apc.d/apc.tgz Now we will copy the apc.php /var/www/.1.d/apache2 restart To make s ure AP C is working great we can us e the apc. Download and untar the lates t built.3p1.tgz tar xvzf APC-3. php s cript: .net/get/APC-3. 3: wget http://pecl. 1.php.1.3p1/apc. At the moment of this public ation AP C ' s lates t build is 3. If you s urf through the s ite again various times the opcode will be already created and the s ite will be fas ter.3p1. Here are the s tats generated by the apc.1. php s c ript that comes in the package.

Doing this is as eas y as executing the apt and pecl commands : sudo apt-get install memcached sudo pecl install Memcache Als o.d/memcache. A s ite will take a lot les s time to read a databas e res ult cached in memory. Y ou can s tart from s tep 3. we need to enable the memcache extens ion on php: sudo echo "extension=memcache.ini Now pleas e follow the ins tallation ins tructions in the memcache module page provided before to make memcac he work with Drupal.The green bar dis plays the hits on c ac he. Once you are done we c an now perform new tes ts to s ee how much the s ite' s performanc e has improved. it’ s better to ins tall the memc ache module (http: //drupal. . Memcache The las t optimization we are going to implement is memc ache. org/project/memc ac he). memory is fas ter to read than hard drive.so" > /etc/php5/apache2/conf. As you may already know. To make the bes t us e of memcache on Drupal. Firs t lets ins tall the memc ache binaries on Ubuntu. it is a very s imple c aching s ys tem that us es memory to s tore objec ts .

On our cas e. Next we are going to look into the webpagetes t. W e make the exact s ame tes t from the different locations . S ingle P age Load R esults G oing back to Y S low. us ing a C DN involves an inves tment. There are more ways to optimize even more a Drupal s ite. E verything went well as planned.E valuating the performance after optimization We have s uc ces s fully completed all the optimizations on our Drupal s ite. Like we s aid before. Firs t we are going to evaluate the s ingle page load res ults and then the load tes ting res ults . W e didn’ t get 100 bec aus e we are not us ing a c ontent delivery network. and we are trying to optimize our s mall s ite without s pending. we have done a lot. you c an s ee that our new grade is A! The total s core we got was 92. . The res ults are very good. a s mall webs ite with mos tly s tatic content. Lets know s ee how helpful this was . S tarting with the front-end. then to the Drupal back-end and even s erver tuning. org res ults .

753 1.852 Looking at thes e res ults .457 1.433 1. the s ingle page load tes t value demons trates how we Average (seconds) Wellington.759 1. org s ite: 3 2. China Virginia.5 2 Seconds Initial Load Total Load 1. New Zealand California.5 1 0. USA .5 0 Initial Load Location Jiangsu.793 0.177 1.938 1.UK Initial Load Total Load 1.3102 1.168 1.Here are the res ults from the webpagetes t.555 2. USA Gloucester.778 1.

W ith 70 R P S the average load time is above 8 s econds .318 8.850 4. The average initial load takes 1.000 4.441 3.000 0.292 7. 3 1 s ec onds and the total load time takes 1. Average Load Time 10.000 Seconds Average Load Time 6. 8 5 s ec onds .933 6.000 2. R emember we are us ing the s tandard 8 s econds to determine when a page load time is not ac ceptable.have s uc c es s fully dec reas ed the average page load time globally. .000 8.649 9. Load Tes t R esults The load tes ting is done in the s ame way we did before. s tarting with 10 R P S until the average res pons e time is not ac c eptable.217 2.000 10 20 30 40 50 60 RPS RPS 70 80 RPS RPS RPS RPS RPS RPS Requests per Second Average Load Time 10 RPS 20 RPS 30 RPS 40 RPS 50 RPS 60 RPS 70 RPS 80 RPS Average Load Time 1.594 The total number of reques ts per s econd that our s erver can take after all the optimizations is 60 R P S .

B efore expanding on infras truc ture. the average load time is 1. a s ite s hould be c ompletely optimized. that may be enough to meet the traffic demand. loading our s ite took an average of 1 3. we can s ee that without adding new hardware. 31 s ec onds .C onclus ion We have s uc ces s fully optimized our Drupal s ite. In s ome cas es .com to discuss your current CMS business needs and how Oshyn can help you achieve them. We have decreas ed the initial page load time by 9 0% . we can s peed up our s ite and the s erver can proc es s more reques ts per s econd. B efore our changes . but how helpful were all the changes we made? W e get the ans wer by looking at the numbers . After the optimization c hanges . T he s erver load could take up to 20 R P S before. 71 s ec onds from different parts of the world. Now the s erver c an take 60 R P S . After reviewing the res ults . whic h means that all the optimizations we did increas ed three times the amount of load that this virtual s erver can take. . Have CMS Needs? Call us at 1 (888) 483-1770 ext 100 or email newbusiness@oshyn.

podc as t. com with the aim of it bec oming the mos t trus ted wellnes s des tination for capturing and s haring people’ s pers onal. the daughter of Deepak C hopra and S al Taylor K ydd a former Yahoo! exec utive. and video. Intent. T herefore. com planned to aggregate c ontent from various online s ourc es . invitation-only feature. Intent. In addition to the c ons umer fac ing webs ite. com s elec ted Os hyn to des ign and build out the res t of the plan and execute the launch of the webs ite. blog. s piritual. and to s yndicate original c ontent to many other webs ites . s oc ial networking platform. Os hyn rapidly built a beta vers ion of Intent. quizzes and polls . wanted to launch Intent. s ocial. “The customized CMS allows us to constantly deliver great content that is increasing registered members. content s yndic ation. c om to give the bus ines s development team the opportunity to s howc as e the webs ite’ s func tionality from any loc ation while they purs ued revenue and content opportunities . Intent. news letters .” C ollaboration was at the heart of the Intent. com webs ite. com needed to have the capabilities to handle many regis tered us er bloggers and gues t bloggers . T he S olution Armed with an outline of a preliminary vis ual des ign and required functionality. the bus ines s development team at Intent als o needed a pre-launch demo of the webs ite to as s is t them in s igning deals with c ontent s yndic ation partners . and advertis ers .Drupal S ucces s S tory T he C hallenge Mallika C hopra. s pons ors . mos t of whom were not tec hnic ally s avvy. Os hyn s elec ted the Drupal open s ource framework for building a C ontent Management S ys tem (C MS ) that would allow non-technical editors to eas ily manage all content and s yndication . Os hyn built a webs ite that offered vis itors with many ways to contribute. and c onnect: us er ac counts . and environmental intentions . collaborate.

com has rapidly expanded its members hip bas e and has rec eived much public ity. 0 R ed Hat E nterpris e 4 L inux R ic h content s yndic ation model through.T he R es ults The cus tomized C MS allows us to c ons tantly deliver great content that is increas ing regis tered members . Intent. S ince the launc h. com is well on its way to bec oming the mos t trus ted wellnes s des tination. and advertis ers . R S S badges AddThis S end to a Friend Now imagine what Os hyn can do for you! . Intent. Intent. s pons ors . com has continued to s ign new content s yndic ation partners . Os hyn delivered Intent. com. a highly engaging webs ite des igned for s oc ial networking. T he T ec hnology          Drupal C ontent Management S ys tem (C MS ) P HP 5 MyS QL 5 Apache 2.

Mobile and Rich Media Drupal Social Media      .Additional Drupal R es ources from Os hyn   Drupal Development at Oshyn Drupal Blog ICON 4x4 Drupal Case Study Drupal Multisite Options white paper Drupal Multilingual white paper Enterprise Drupal: Social Media.

is an E nterpris e T echnology Agency that has earned a reputation for delivering innovative bus ines s s olutions for the web. E lectronic Arts . Inc. is partnered with the s ome of the mos t res pec ted agencies and tec hnology providers s uch as 72andS unny. J ahia. L exus . mobile devices and enterpris e technology platforms . S outhern C alifornia E dis on and Volks wagen. For more information pleas e vis it us at www. Os hyn. Oliver W yman. Mars . G erman has a B achelor’ s Degree in C omputer S cienc e from University of San Francisco of Quito.s cale s olutions in today’ s demanding timelines . Inc. Oracle and S itecore.About G erman Villacreces During his 6 years in enterpris e tec hnology. Harbor C apital. C oc a-C ola. C ris pin P orter + B ogus ky. H e has managed s mall teams of technology profes s ionals to deliver medium. G ermán Villacrec es has performed work for clients in the E nterpris e C ontent Management. . com. G raduate P ros pec ts . S aatc hi & S aatchi. OpenT ext. Digital Media. Automotive. E ps on. os hyn. S apient. Headquartered in L os Angeles . S pringbox. Micros oft. Fordham Univers ity. S cripps . About Os hyn Os hyn. Os hyn' s growing c lient lis t includes B es t B uy/G eek S quad. S oc ial Networking and Advertis ement indus tries . National E duc ation As s ociation. Ogilvy & Mather. T he G roop and T eam One. Os hyn. H is expertis e ranges from ric h internet web tec hnologies with particular emphas is in c ontent management s ys tem implementations . Micros oft. J DS Uniphas e. Miramax. partners and maintains c ertific ations with leading technology providers s uc h as E P iS erver. Follow us on T witter @Os hyn_Inc. As c entium. Inc.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->