Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Optimizing Drupal Performance (English)

These are slides for my talk at second meetup of Drupal Trojmiasto Group

  • Login to see the comments

Optimizing Drupal Performance (English)

  1. 1. Optimizing Drupal Performance Basic practices by Tim Kamanin @timonweb timonweb.com mailto:timur@kamanin.com Drupal Trójmiasto 3drupal.pl
  2. 2. Reasons why most Drupalsites are slow:- full page renders- serving dynamic content toanonymous users- slow mysql queries- module bloat
  3. 3. Typical Drupal Stack CSS / JavaScript Media Drupal Apache MySQL PHP Linux
  4. 4. Drupal Performance Checklist
  5. 5. 1. Limit number of your modules
  6. 6. 2. Always check whatinstalled modules are doing behind the scenes
  7. 7. 3. Architect the system and write modules withperformance in mind
  8. 8. 4. Split code invoked viaurls into separate files: module_name.admin.inc, module_name.page.inc, etc
  9. 9. 5. use drupal_static(),provides central staticvariable storage, docs: http://bit.ly/QD86rP
  10. 10. 6. Install fast_404
  11. 11. 7. Export views and Panels to code
  12. 12. 8. Enable css /javascript aggregation
  13. 13. 9. Let aggregate cacheto take care of css/js aggregation
  14. 14. 10. Enable page and page compression (mod_deflate)
  15. 15. 11. Install Boost tomake anonymous caching 10 x times faster!
  16. 16. 12. Enable views and block caching for authorized users
  17. 17. 13. Store cache in memory. Installmemcached or redis
  18. 18. 14. Cache PHP with APC
  19. 19. 15. Tune MySQL: - find slow queries - use indexes - use EXPLAIN on queries - tune my.cnf- get decent query cache and key buffer
  20. 20. 16. Tune Apache: StartServersMinSpareServers MaxSpareServers MaxClients KeepAlive
  21. 21. 17. Remember about mod_expiresExpiresActive onExpiresByType image/jpg "access plus 1 month"ExpiresByType image/jpeg "access plus 1 month"ExpiresByType image/gif "access plus 1 month"ExpiresByType image/png "access plus 1 month"ExpiresByType text/css "access plus 1 months"ExpiresByType application/javascript "access plus 1 months"
  22. 22. 18. Separate Media and Code: - Move media to CDN - Move media to separate server
  23. 23. 19. Move search from Database to Solr search_api + Solr
  24. 24. What else can be done?
  25. 25. varnish, squid, loadbalancing, memcached, fieldsin mongdo, css sprites, Etag, ESI, separate database server, optimize media, preload, postload, external js, nginx, Lighttpd, amazon cloud, SSD
  26. 26. Comments,questions? @timonweb timonweb.commailto:timur@kamanin.com

×