• Save
Optimizing Drupal Performance. Tips and Tricks
Upcoming SlideShare
Loading in...5
×
 

Optimizing Drupal Performance. Tips and Tricks

on

  • 539 views

Slides to my session at Drupal Camp Wroclaw 2013

Slides to my session at Drupal Camp Wroclaw 2013

Statistics

Views

Total Views
539
Views on SlideShare
527
Embed Views
12

Actions

Likes
3
Downloads
0
Comments
0

1 Embed 12

http://amazeworks.pl 12

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Optimizing Drupal Performance. Tips and Tricks Optimizing Drupal Performance. Tips and Tricks Presentation Transcript

  • Optimizing Drupal PerformanceTips and Tricksby Tim Kamanin@timonwebtimonweb.commailto:timur@kamanin.comDrupalCamp Wroclaw 2013
  • 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
  • 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.
  • 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 queries● module bloat aka „open buffet” syndrome
  • 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 of Drupals AjaxFramework- Use Drupal API!!!4. Develop modules with performancein mind:
  • 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 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
  • ● 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:
  • 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