Optimizing Drupal Performance. Tips and Tricks

  • 332 views
Uploaded on

Slides to my session at Drupal Camp Wroclaw 2013

Slides to my session at Drupal Camp Wroclaw 2013

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
332
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
0
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Optimizing Drupal PerformanceTips and Tricksby Tim Kamanin@timonwebtimonweb.commailto:timur@kamanin.comDrupalCamp Wroclaw 2013
  • 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. 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. Why do we care about it?PerformanceisLove and Money
  • 5. THE HORRIBLETRUTH ABOUTDRUPAL IS...
  • 6. Photo by Chris Hoving
  • 7. Drupal is● Database intensive● Memory intensive● Can easily become a resource hog
  • 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. Typical Drupal StackLinuxCSS / JavaScriptApache MySQL PHPDrupalMedia
  • 10. Drupal PerformanceTips and Tricks
  • 11. 1. Know the Tools
  • 12. Devel
  • 13. Developer Tools in abrowser
  • 14. ● Pingdom● YSlow● Apache benchmark● XHProf● top / htop● New relic● mytop / mtop● PhpMyAdmin● And lots moreKnow the Tools
  • 15. 2. Limit number ofinstalled modules
  • 16. 3. Always check whatinstalled modules are doingbehind the scenes
  • 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. 5. Enable css / javascriptaggregation:● built in● aggregate cache module
  • 19. 6. Cache PHPwith APC
  • 20. 7. Export views andPanels to code
  • 21. 8. Enable fast_404
  • 22. 9. Remeber, cachesaves the cash! Cacheeverything!
  • 23. 10. Enable page cacheand page compression(mod_deflate)
  • 24. 11. Install Boost to makeanonymous caching 100 x timesfaster or play with Varnishand make things even faster!
  • 25. 12. Enable views andblock caching forauthorized users
  • 26. 13. Consider using ESI andauthcache to cache pages forauthorized users.WARNING: This solution is forexperienced users.
  • 27. 14. Store cache inmemory. Installmemcached or redis
  • 28. 15. Tune SQL- find slow queries- use indexes- use EXPLAIN on queries
  • 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. ● 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. 18. Separate Media and Code● Move media to CDN● Move media to separateserver
  • 32. 19. Move search fromDatabase to Solr search_api+ Solr
  • 33. 20. Optimize, measureand repeat!
  • 34. Comments,questions?@timonwebtimonweb.commailto:timur@kamanin.com