Successfully reported this slideshow.
By   blueRiver
Mura CMSPerformance Tuning
AgendaServer Tuning
AgendaServer Tuning  Web Server
AgendaServer Tuning  Web Server  Static Assets
AgendaServer Tuning  Web Server  Static Assets  JVM Settings
AgendaMura Tuning
AgendaMura Tuning Admin Settings
AgendaMura Tuning Admin Settings Custom Caching
AgendaMura Tuning Admin Settings Custom Caching Code Examples
AgendaServer Tuning We’ll take a look at a few common areas that often need tuning
AgendaServer Tuning We’ll take a look at a few common areas that often need tuning   Web Server
AgendaServer Tuning We’ll take a look at a few common areas that often need tuning   Web Server   JVM settings
AgendaServer Tuning We’ll take a look at a few common areas that often need tuning   Web Server   JVM settings   DB
Web ServerCheck the following1. Is the web server configured according to load?
Web ServerMinimal Apache ConfigStartServers       1MinSpareServers    1MaxSpareServers    3MaxClients         50MaxRequests...
Web ServerHeavy Load Apache ConfigStartServers       18MinSpareServers    20MaxSpareServers    55MaxClients         600MaxR...
Web ServerCheck the following1. Is the web server configured according to load?2. Are static assets being gzipped?
Web ServerMOD_DEFLATE EXAMPLELoadModule deflate_module libexec/apache2/mod_deflate.so<IfModule mod_deflate.c>  # html, xml...
Web ServerCheck the following1. Is the web server configured according to load?2. Are static assets being gzipped?3. Are fa...
Web ServerMOD_EXPIRES EXAMPLELoadModule deflate_module libexec/apache2/mod_deflate.so<IfModule mod_expires.c>    Header se...
Static AssetsGet the assets to the browser as fast as possible1. Minify your JS and CSS
Static AssetsGet the assets to the browser as fast as possible1. Minify your JS and CSS2. Combine as much JS into one file....
Static AssetsGet the assets to the browser as fast as possible1. Minify your JS and CSS2. Combine as much JS into one file....
Static AssetsGet the assets to the browser as fast as possible1. Minify your JS and CSS2. Combine as much JS into one file....
JVM TuningImportant settings-Xms384m -Xmx512m-XX:MaxPermSize=256m-XX:+UseParallelGCIf possible, use Java 1.6
JVM TuningMinimum / Maximum Heap Size-Xms384m -Xmx512mFor best performance, always make sure the maximum isset to 512m or ...
JVM TuningMaximum Permanent Heap Size-XX:MaxPermSize=256mXX:MaxPermSize specifies the the maximum size for thepermanent gen...
JVM TuningGarbage Collection-XX:+UseParallelGCThis tells the JVM to use a multi-threaded approach togarbage collection.
DatabaseImportant settingsquery_cache_size = 32Mquery_cache_type = 1
Mura TuningNow lets take a look at what we can tune in Mura
Mura TuningNow lets take a look at what we can tune in Mura  First up, settings you can change in the admin
Mura TuningNow lets take a look at what we can tune in Mura  First up, settings you can change in the admin  On deck, what...
Admin SettingsThere are a few key settings in the Mura admin to look for  Site Caching  Session Tracking  Restrict Access
Admin SettingsSite Caching    Enable caching on production Mura instances     Reduces the workload on the DB and CFML engi...
Admin SettingsSession Tracking  Can cause a huge strain on the database  Consider using Google Analytics  When performance...
Admin SettingsRestrict Access  Be strategic about how content is restricted  Restricting a section is far more effective  ...
CodeCommon performance impacting aspects of Mura Primary Navigation CacheOMatic tag CfStatic ShowTrace Feed sorting / limits
CodePrimary Navigation  Set viewDepth to 1 at most  Use the CacheOMatic tag to eliminate server load
CodeCacheOMatic tag Use the CacheOMatic tag when possible Navigation is a great use case Database output - lists, tables A...
CodeCacheOMatic tag <cf_CacheOMatic key=”UNIQUE_KEY” nocache=”1|0” timespan=”#createTimeSpan()#”>  #Cache_Me_Please# </cf_...
CodeCfStatic  Minifies your CSS and JavaScript  Files are saved to disk, so the performance hit is  minimal
CodeCfStatic - CSS  #$.static()  ! .include("/css/core/")  ! .include("/css/print/")  ! .include("/css/ie/lte7/")  ! .rend...
CodeCfStatic - JS  #$.static()  ! .include("/js/ie/lte7/roundies/")  ! .renderIncludes("js")#
CodeShowTrace Shows you what’s going on under the hood of Mura Helpful to debug production instances, where enabling serve...
CodeCustom feed sorting / limits  If possible limit the rows returned  Try not to sort by extended attributes  If you can’...
Hands onWhat’s next?
Hands onWhat’s next?Fixing a slow site, in action  We’ll go over a few common performance killers in  Mura
Hands onAction Items:  1) Turn on site caching
Hands onAction Items:  1) Turn on site caching  2) Check Primary Nav
Hands onAction Items:  1) Turn on site caching  2) Check Primary Nav  3) Implement CfStatic
Hands onAction Items:  1) Turn on site caching  2) Check Primary Nav  3) Implement CfStatic  4) Add CacheOMatic tag
Hands onAction Items:  1) Turn on site caching  2) Check Primary Nav  3) Implement CfStatic  4) Add CacheOMatic tag  5) Ru...
Hands onThat’s it! Now we’ve got a lean mean Mura machine.
Many ThanksI hope this presentation was helpful!  Questions?  Comments?
Say HiEddie Ballisty eddie.ballisty@blueriver.com
Upcoming SlideShare
Loading in …5
×

Performance Tuning - MuraCon 2012

1,615 views

Published on

A quick list of items to check for when Mura is running slow

Published in: Technology
  • Be the first to comment

Performance Tuning - MuraCon 2012

  1. 1. By blueRiver
  2. 2. Mura CMSPerformance Tuning
  3. 3. AgendaServer Tuning
  4. 4. AgendaServer Tuning Web Server
  5. 5. AgendaServer Tuning Web Server Static Assets
  6. 6. AgendaServer Tuning Web Server Static Assets JVM Settings
  7. 7. AgendaMura Tuning
  8. 8. AgendaMura Tuning Admin Settings
  9. 9. AgendaMura Tuning Admin Settings Custom Caching
  10. 10. AgendaMura Tuning Admin Settings Custom Caching Code Examples
  11. 11. AgendaServer Tuning We’ll take a look at a few common areas that often need tuning
  12. 12. AgendaServer Tuning We’ll take a look at a few common areas that often need tuning Web Server
  13. 13. AgendaServer Tuning We’ll take a look at a few common areas that often need tuning Web Server JVM settings
  14. 14. AgendaServer Tuning We’ll take a look at a few common areas that often need tuning Web Server JVM settings DB
  15. 15. Web ServerCheck the following1. Is the web server configured according to load?
  16. 16. Web ServerMinimal Apache ConfigStartServers 1MinSpareServers 1MaxSpareServers 3MaxClients 50MaxRequestsPerChild 4000
  17. 17. Web ServerHeavy Load Apache ConfigStartServers 18MinSpareServers 20MaxSpareServers 55MaxClients 600MaxRequestsPerChild 4000
  18. 18. Web ServerCheck the following1. Is the web server configured according to load?2. Are static assets being gzipped?
  19. 19. Web ServerMOD_DEFLATE EXAMPLELoadModule deflate_module libexec/apache2/mod_deflate.so<IfModule mod_deflate.c> # html, xml, css, and js: AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript</IfModule>
  20. 20. Web ServerCheck the following1. Is the web server configured according to load?2. Are static assets being gzipped?3. Are far future expires headers set?
  21. 21. Web ServerMOD_EXPIRES EXAMPLELoadModule deflate_module libexec/apache2/mod_deflate.so<IfModule mod_expires.c> Header set cache-control: public ExpiresActive on # set default ExpiresDefault "access plus 24 hours" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType text/css "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType text/html "now"</IfModule>
  22. 22. Static AssetsGet the assets to the browser as fast as possible1. Minify your JS and CSS
  23. 23. Static AssetsGet the assets to the browser as fast as possible1. Minify your JS and CSS2. Combine as much JS into one file. Same goes for CSS
  24. 24. Static AssetsGet the assets to the browser as fast as possible1. Minify your JS and CSS2. Combine as much JS into one file. Same goes for CSS3. Load as much JS near the end of the HTML file
  25. 25. Static AssetsGet the assets to the browser as fast as possible1. Minify your JS and CSS2. Combine as much JS into one file. Same goes for CSS3. Load as much JS near the end of the HTML fileBy doing this, the site will ‘feel’ much faster.
  26. 26. JVM TuningImportant settings-Xms384m -Xmx512m-XX:MaxPermSize=256m-XX:+UseParallelGCIf possible, use Java 1.6
  27. 27. JVM TuningMinimum / Maximum Heap Size-Xms384m -Xmx512mFor best performance, always make sure the maximum isset to 512m or greater. If your server has the free ramavailable, this is a great way to increase performance.
  28. 28. JVM TuningMaximum Permanent Heap Size-XX:MaxPermSize=256mXX:MaxPermSize specifies the the maximum size for thepermanent generation heap, a heap that holds objectssuch as classes and methods.
  29. 29. JVM TuningGarbage Collection-XX:+UseParallelGCThis tells the JVM to use a multi-threaded approach togarbage collection.
  30. 30. DatabaseImportant settingsquery_cache_size = 32Mquery_cache_type = 1
  31. 31. Mura TuningNow lets take a look at what we can tune in Mura
  32. 32. Mura TuningNow lets take a look at what we can tune in Mura First up, settings you can change in the admin
  33. 33. Mura TuningNow lets take a look at what we can tune in Mura First up, settings you can change in the admin On deck, what we can do with code to reduce the server workload
  34. 34. Admin SettingsThere are a few key settings in the Mura admin to look for Site Caching Session Tracking Restrict Access
  35. 35. Admin SettingsSite Caching Enable caching on production Mura instances Reduces the workload on the DB and CFML engine Cache Capacity Sets a hard limit on how many cached items Cache Free Memory Threshold Keeps a specified % free for other proccesses
  36. 36. Admin SettingsSession Tracking Can cause a huge strain on the database Consider using Google Analytics When performance is critical, consider disabling session tracking
  37. 37. Admin SettingsRestrict Access Be strategic about how content is restricted Restricting a section is far more effective Mura must calculate the permissions for each page request
  38. 38. CodeCommon performance impacting aspects of Mura Primary Navigation CacheOMatic tag CfStatic ShowTrace Feed sorting / limits
  39. 39. CodePrimary Navigation Set viewDepth to 1 at most Use the CacheOMatic tag to eliminate server load
  40. 40. CodeCacheOMatic tag Use the CacheOMatic tag when possible Navigation is a great use case Database output - lists, tables Ability to set a timespan to keep output fresh Ability to set a unique key - useful for mobile, users
  41. 41. CodeCacheOMatic tag <cf_CacheOMatic key=”UNIQUE_KEY” nocache=”1|0” timespan=”#createTimeSpan()#”> #Cache_Me_Please# </cf_CacheOMatic>
  42. 42. CodeCfStatic Minifies your CSS and JavaScript Files are saved to disk, so the performance hit is minimal
  43. 43. CodeCfStatic - CSS #$.static() ! .include("/css/core/") ! .include("/css/print/") ! .include("/css/ie/lte7/") ! .renderIncludes("css")#
  44. 44. CodeCfStatic - JS #$.static() ! .include("/js/ie/lte7/roundies/") ! .renderIncludes("js")#
  45. 45. CodeShowTrace Shows you what’s going on under the hood of Mura Helpful to debug production instances, where enabling server debugging is problematic Mura adds tracepoints to custom events to help debug slow code
  46. 46. CodeCustom feed sorting / limits If possible limit the rows returned Try not to sort by extended attributes If you can’t avoid, then make sure the feed is very targeted -- limit work for the DB
  47. 47. Hands onWhat’s next?
  48. 48. Hands onWhat’s next?Fixing a slow site, in action We’ll go over a few common performance killers in Mura
  49. 49. Hands onAction Items: 1) Turn on site caching
  50. 50. Hands onAction Items: 1) Turn on site caching 2) Check Primary Nav
  51. 51. Hands onAction Items: 1) Turn on site caching 2) Check Primary Nav 3) Implement CfStatic
  52. 52. Hands onAction Items: 1) Turn on site caching 2) Check Primary Nav 3) Implement CfStatic 4) Add CacheOMatic tag
  53. 53. Hands onAction Items: 1) Turn on site caching 2) Check Primary Nav 3) Implement CfStatic 4) Add CacheOMatic tag 5) Run ShowTrace=true
  54. 54. Hands onThat’s it! Now we’ve got a lean mean Mura machine.
  55. 55. Many ThanksI hope this presentation was helpful! Questions? Comments?
  56. 56. Say HiEddie Ballisty eddie.ballisty@blueriver.com

×