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

Optimizing Drupal Performance (English)

2,135

Published on

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

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

No Downloads
Views
Total Views
2,135
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

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

×