Your SlideShare is downloading. ×
Optimizing Drupal PerformanceTips and Tricksby Tim Kamanin@timonwebtimonweb.commailto:timur@kamanin.comDrupalCamp Wroclaw ...
About me- Freelance Drupal consultant- Working with Drupal since 2006- Started my journey from building own projectson Dru...
What is Performance?Performance refers to how long does it take toproduce a page.It is a result of how long it takes to re...
Why do we care about it?PerformanceisLove and Money
THE HORRIBLETRUTH ABOUTDRUPAL IS...
Photo by Chris Hoving
Drupal is● Database intensive● Memory intensive● Can easily become a resource hog
Reasons why most Drupalsites are slow:● doing full page renders● serving dynamic content to anonymoususers● slow mysql que...
Typical Drupal StackLinuxCSS / JavaScriptApache MySQL PHPDrupalMedia
Drupal PerformanceTips and Tricks
1. Know the Tools
Devel
Developer Tools in abrowser
● Pingdom● YSlow● Apache benchmark● XHProf● top / htop● New relic● mytop / mtop● PhpMyAdmin● And lots moreKnow the Tools
2. Limit number ofinstalled modules
3. Always check whatinstalled modules are doingbehind the scenes
- take advantage of caching(drupal_static(), cache_set(),cache_get())- split ui part and functional part- take advantage o...
5. Enable css / javascriptaggregation:● built in● aggregate cache module
6. Cache PHPwith APC
7. Export views andPanels to code
8. Enable fast_404
9. Remeber, cachesaves the cash! Cacheeverything!
10. Enable page cacheand page compression(mod_deflate)
11. Install Boost to makeanonymous caching 100 x timesfaster or play with Varnishand make things even faster!
12. Enable views andblock caching forauthorized users
13. Consider using ESI andauthcache to cache pages forauthorized users.WARNING: This solution is forexperienced users.
14. Store cache inmemory. Installmemcached or redis
15. Tune SQL- find slow queries- use indexes- use EXPLAIN on queries
16. Tune MySQL:Tweak my.cnf:- query_cache_size – caches query results(32M - 512M)- innodb_buffer_pool_size – caches indexe...
● StartServers - number of child server processescreated at startup (default 5)● MinSpareServers - minimum number of idle ...
18. Separate Media and Code● Move media to CDN● Move media to separateserver
19. Move search fromDatabase to Solr search_api+ Solr
20. Optimize, measureand repeat!
Comments,questions?@timonwebtimonweb.commailto:timur@kamanin.com
Upcoming SlideShare
Loading in...5
×

Optimizing Drupal Performance. Tips and Tricks

381

Published on

Slides to my session at Drupal Camp Wroclaw 2013

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
381
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Transcript of "Optimizing Drupal Performance. Tips and Tricks"

  1. 1. Optimizing Drupal PerformanceTips and Tricksby Tim Kamanin@timonwebtimonweb.commailto:timur@kamanin.comDrupalCamp Wroclaw 2013
  2. 2. About me- Freelance Drupal consultant- Working with Drupal since 2006- Started my journey from building own projectson Drupal- Share Drupal knowledge at timonweb.com- Co-founder of Drupal Trójmiasto Users Group(Gdańsk / Sopot / Gdynia, 3drupal.pl)- Creator of Dropbucket.org – Drupal snippetsrepository
  3. 3. What is Performance?Performance refers to how long does it take toproduce a page.It is a result of how long it takes to render apage on the server and on the client side in thebrowser.
  4. 4. Why do we care about it?PerformanceisLove and Money
  5. 5. THE HORRIBLETRUTH ABOUTDRUPAL IS...
  6. 6. Photo by Chris Hoving
  7. 7. Drupal is● Database intensive● Memory intensive● Can easily become a resource hog
  8. 8. Reasons why most Drupalsites are slow:● doing full page renders● serving dynamic content to anonymoususers● slow mysql queries● module bloat aka „open buffet” syndrome
  9. 9. Typical Drupal StackLinuxCSS / JavaScriptApache MySQL PHPDrupalMedia
  10. 10. Drupal PerformanceTips and Tricks
  11. 11. 1. Know the Tools
  12. 12. Devel
  13. 13. Developer Tools in abrowser
  14. 14. ● Pingdom● YSlow● Apache benchmark● XHProf● top / htop● New relic● mytop / mtop● PhpMyAdmin● And lots moreKnow the Tools
  15. 15. 2. Limit number ofinstalled modules
  16. 16. 3. Always check whatinstalled modules are doingbehind the scenes
  17. 17. - take advantage of caching(drupal_static(), cache_set(),cache_get())- split ui part and functional part- take advantage of Drupals AjaxFramework- Use Drupal API!!!4. Develop modules with performancein mind:
  18. 18. 5. Enable css / javascriptaggregation:● built in● aggregate cache module
  19. 19. 6. Cache PHPwith APC
  20. 20. 7. Export views andPanels to code
  21. 21. 8. Enable fast_404
  22. 22. 9. Remeber, cachesaves the cash! Cacheeverything!
  23. 23. 10. Enable page cacheand page compression(mod_deflate)
  24. 24. 11. Install Boost to makeanonymous caching 100 x timesfaster or play with Varnishand make things even faster!
  25. 25. 12. Enable views andblock caching forauthorized users
  26. 26. 13. Consider using ESI andauthcache to cache pages forauthorized users.WARNING: This solution is forexperienced users.
  27. 27. 14. Store cache inmemory. Installmemcached or redis
  28. 28. 15. Tune SQL- find slow queries- use indexes- use EXPLAIN on queries
  29. 29. 16. Tune MySQL:Tweak my.cnf:- query_cache_size – caches query results(32M - 512M)- innodb_buffer_pool_size – caches indexes.Up to 80% of your memory- table_cache – number of tables mysql keepsin cache. Start with 1000- tmp_table_size and max_heap_table_size
  30. 30. ● StartServers - number of child server processescreated at startup (default 5)● MinSpareServers - minimum number of idle childserver processes (default is 5)● MaxSpareServers – maximum number of idle processes(default is 10)● MaxClients - maximum number of connections that willbe processed simultaneously, otherwise queued (default256)● KeepAlive. On / Off depending on circumstances17. Tune Apache:
  31. 31. 18. Separate Media and Code● Move media to CDN● Move media to separateserver
  32. 32. 19. Move search fromDatabase to Solr search_api+ Solr
  33. 33. 20. Optimize, measureand repeat!
  34. 34. Comments,questions?@timonwebtimonweb.commailto:timur@kamanin.com

×