SlideShare a Scribd company logo
#PureSpeed
elmsln.org
@btopro
Come get sticker like this one
In dribs and drabs
we will change the world
Project Lead
ELMS Initiative
Instructional Systems Architect
E-Learning Institute
College of Arts & Architecture
Penn State University
@btopro (aka Bryan Ollendyke)
https://github.com/elmsln/elmsln
https://elmsln.org
Star, Follow and Fork!
#purespeed
• Tools to identify problems / needs
• General Server Optimization
• Drupal 7/8 Optimization
• Fixing common front-end delivery issues
Free / Local digging
• Drupal.org/project/devel
• Enable and set to display results of queries / memory usage
• Hack Core
• Throw a dpm() into module_invoke_all (includes/module.inc in D7)
• https://drupal.psu.edu/blog/post/memory-profiling-hooks
• XH-Prof
• https://www.drupal.org/project/xhprof
• Stand alone php profiler w/ drupal integration
Big Data
• Ability to trace errors deeply
• Drupal specific breakdowns
• Example
• https://www.drupal.org/node/2370309#comment-10368929
Server: Apache FPM
• Switch from mod_php processing to FPM
• yum install php5-fpm
• Obviously more to it then that but worth exploring
• https://github.com/bradallenfisher/php56-fpm-centos7-mysql56
Server: PHP
• PHP -- /etc/php.ini or /etc/php5/fpm/php.ini
• Zend Opcache -- /etc/php.d/opcache.ini or /etc/php5/mods-available/opcache.ini
• APC/u - /etc/php.d/apc.ini or /etc/php5/mods-available/apcu.ini
• https://drupal.psu.edu/blog/post/purespeed-php-tuning
• Cache code files in memory
• Otherwise memory used to deliver insane!
• PHP 5.5+ use Zend OpCache
• APCu if you want as cache backend
• PHP < 5.4 use APC
• user bin for backend builtin
• Biggest deal in mcarper’s opinion
• realpath_cache_size = 1M
• realpath_cache_ttl = 3600
Server: MySQL
• MySQL - /etc/my.cnf
• Most common issue:
• max-allowed-packet = 32M
• Disable caching engine (counter intuitive but Drupal makes this worthless)
• Ensure innodb table encoding, and tuned
• Drupal Contrib:
• APDQC – drupal.org/project/apdqc
• Replacement for Core mysql cache bin engine
• Eliminates deadlocks
• Gives report on how to further optimize your server
• Use other alternate cache backends (so mysql does less)
Drupal: Cache bin management
• Cache Bin Management
• https://drupal.psu.edu/blog/post/purespeed-cache-bin-backends
• Popular options
• Apc user bin – great for things that don’t change
• Fast, cheap and easy for anyone (don’t push page cache here!)
• Filecache – writ to file system for cache data
• Great, cheap and easy if on SSD
• Memcache –popular in distributed / complex setups
• Reddis – similar to memcache, newer and more popular now
• Both great but usually you want this on its own server / more complicated
• Apdqc – replacement for mysql core cache bin mechanism
• Run on any site
Drupal: Cache bin WARNING
• Make sure file paths are correct!
• WSOD
• cache_form CAN NOT live in bins
• All page form submission breaks
• APC fragmentation
• Restart apache on interval
• APDQC recommendations
• Some involve mysql upgrades
• Semephor / session replacements
can cause issues
Drupal / Server
• httprl_spider - https://www.drupal.org/project/httprl_spider
• xmlrpc_page_load - https://www.drupal.org/project/xmlrpc_page_load
• Usage:
• drush @site hss node (request all nodes on site, as anonymous)
• drush @site hss node –xmlrpcuid=1 (all nodes on site, “as user 1”)
• Great for seeding anonymous/auth’ed user page caches
• Stuff in a crontab nightly after cron (so caches are cleared out)
• vi /etc/crontab
* 4 * * * root drush @mysite cron
15 4 * * * root drush @mysite hss
Server: Varnish
• Varnish - /etc/varnish/default.vcl
• yum install varnish
• Reverse Proxy that sits in front of apache
• Listen on 80; move apache to port 8080
• must have for anonymous traffic / high scale
• Can’t handle HTTPS (without 4.x + plugin)
• Nginx
• More performant then stock apache but leess support
• useful reverse proxy for HTTPS if not running outright
Drupal 7 - entitycache
• https://www.drupal.org/project/entitycache
• Core in drupal 8.x.x!
• Caches entity / object definitions (basically required for field collections)
• Turn it on, that’s it!
Drupal 7 - APDQC
• Covered earlier
• Install, read README and status page
• Fix issues it reports
• Faster site with less time spent in mysql calls
Drupal 7 & 8 - advagg
• Drupal.org/project/advagg
• Covered earlier
• Should be on every site you do
• Biggest gains in compression, bundler, async font loader and pushing js to footer
• Great for improving perception of page load
• Beware of bricking JS though
Drupal - HTTPRL
• Drupal.org/project/httprl
• Threading capable
• Allows for queuing background threads and non-blocking calls
• Similar to Guzzle (D8 core)
• Makes certain projects faster (like advagg)
• *Can be a bit of a troublemaker
• https://drupal.psu.edu/blog/post/bench-marking-non-blocking-httprl-vs-
drupalhttprequest
• https://drupal.psu.edu/blog/post/core-caching-and-drupalstatic-make-cached-
drupalhttprequests
Drupal - APC
• drupal.org/project/apc -Exposes APC user bin as a cache backend
• Beware of fragmentation
• Can’t be used in a distributed / clustered deployment (use memecache / reddis)
$conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
$conf['cache_class_cache'] = 'DrupalAPCCache';
$conf['cache_class_cache_admin_menu'] = 'DrupalAPCCache';
$conf['cache_class_cache_block'] = 'DrupalAPCCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';
$conf['cache_class_cache_entity_file'] = 'DrupalAPCCache';
$conf['cache_class_cache_field'] = 'DrupalAPCCache';
$conf['cache_class_cache_menu'] = 'DrupalAPCCache';
$conf['cache_class_cache_libraries'] = 'DrupalAPCCache';
$conf['cache_class_cache_token'] = 'DrupalAPCCache';
$conf['cache_class_cache_views'] = 'DrupalAPCCache';
$conf['cache_class_cache_path_breadcrumbs'] = 'DrupalAPCCache';
$conf['cache_class_cache_path'] = 'DrupalAPCCache';
$conf['cache_class_cache_book'] = 'DrupalAPCCache’;
Drupal 7 - Authcache
• drupal.org/project/authcache
• Aggressive caching methods for authenticated users
• Great when granularity of access is per role
• Caches per combination of roles (handles anonymous too)
• Can cache admin, not recommended
• Need to modify settings.php / authcache.php in Drupal root
• https://github.com/elmsln/elmsln/blob/master/core/dslmcode/shared/drupal-
7.x/modules/ulmus/authcache/modules/authcache_p13n/safe_frontcontroller/au
thcache.php
Drupal 8 - BigPipe
• Core in 8.1.x+
• Delivers parts of the page that take
more time by loading the static stuff
by itself, to load SOMETHING
• Then additional JS based calls inject
the slower parts of the page build
Drupal 8 - Refreshless
• https://www.drupal.org/project/refreshless
• Similar to the Turbo Links, a technique from Rails
• Page never actually reloads, it just calls in the background for parts of page
• Similar to loading items on github.com (click between links and see!)
The dreaded inherited site
• ELMSLN stack
• Someone screwed stuff up!
• Identify issues
• Win
Front end performance
Front end performance
• Yslow
• Firefox / Chrome plugin by Yahoo
Front end performance
• PageSpeed
• Chrome, right click -> inspect element -> Audits
• Select Reload page and Audit on Load -> Run
Front end performance
• Webpagetest.org
Asset Delivery
• Deliver assets logically
• Etags that make sense
• Expire headers that make sense (far in the future for static assets)
• Logical headers = less requests on future page loads
• Which makes Apache happy
• Your users happy!
Server: Apache
• Compression – send less w/ the same result
• Etags – strip off so validation of resource match happens
• Expires headers – ensure static assets are kept far into the future
• Keep Alive – create less apache workers by keeping them open longer
• MaxClients – set appropriately or server will die
• memory per page / (RAM – other services) = MaxClients
• Cheating – zzz_performance.conf
• Drop in performance gain for almost any drupal / apache site
• https://github.com/elmsln/elmsln/blob/master/scripts/server/zzz_performance.conf
JS / CSS blocking
• AdvAgg
• https://www.drupal.org/project/advagg
• Turn on modify and bundler sub-modules
• Push for 2 groupings of css / js on bundler settings page
• Modifier
• Basically check everything that doesn’t sound evil
• Use modify to push js into the bottom of the page
• Careful, JS needs to be well formed!
• Experimental!
• Use javascript to load CSS
• It’s in the bottom of the advagg modifier settings
Fixing CDN category
• All systems complain about CDN till you define what CDN is!
• Ways to fix
• Buy a legit CDN and pay a lot of money
• Install https://www.drupal.org/project/cdn (illegitimate CDN)
• Use settings in jquery_update module to deliver from Google / Microsoft
• If on bootstrap, select CDN for code source
• Use https://www.google.com/fonts for custom font CSS instead of local
Make less requests
• AdvAgg / aggregate CSS/JS files can help
• https://www.drupal.org/project/advagg
• Convert small images to sprites or “data” objects
• https://www.drupal.org/project/css_emimage
• Good luck though..
• You’re using a modular CMS / framework!
Questions
@btopro
elmsln.org

More Related Content

PDF
DrupalCampLA 2014 - Drupal backend performance and scalability
PDF
Aem dispatcher – tips & tricks
PDF
High Performance Drupal
PPT
Speeding Up The Snail
PPTX
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
PDF
Here Be Dragons - Debugging WordPress
KEY
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
ODP
The secret life of a dispatcher (Adobe CQ AEM)
DrupalCampLA 2014 - Drupal backend performance and scalability
Aem dispatcher – tips & tricks
High Performance Drupal
Speeding Up The Snail
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
Here Be Dragons - Debugging WordPress
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
The secret life of a dispatcher (Adobe CQ AEM)

What's hot (20)

PDF
Server Check.in case study - Drupal and Node.js
PDF
Top ten-list
PDF
Drupal feature proposal: two new stream-wrappers
KEY
Memcached: What is it and what does it do?
PDF
DrupalCampLA 2011: Drupal backend-performance
PDF
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
PPT
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
PPT
Roy foubister (hosting high traffic sites on a tight budget)
PPTX
Improving Website Performance with Memecached Webinar | Achieve Internet
PPTX
Apache Performance Tuning: Scaling Up
PPTX
Ansible: How to Get More Sleep and Require Less Coffee
PPTX
PPTX
Varnish bof
PDF
Staging Drupal 8 31 09 1 3
PDF
Drupal VM for Drupal 8 Dev - MidCamp 2017
PPTX
Varnish intro
KEY
London devops logging
PDF
Memcached: What is it and what does it do? (PHP Version)
PDF
Memcached Code Camp 2009
PDF
Single page apps with drupal 7
Server Check.in case study - Drupal and Node.js
Top ten-list
Drupal feature proposal: two new stream-wrappers
Memcached: What is it and what does it do?
DrupalCampLA 2011: Drupal backend-performance
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Roy foubister (hosting high traffic sites on a tight budget)
Improving Website Performance with Memecached Webinar | Achieve Internet
Apache Performance Tuning: Scaling Up
Ansible: How to Get More Sleep and Require Less Coffee
Varnish bof
Staging Drupal 8 31 09 1 3
Drupal VM for Drupal 8 Dev - MidCamp 2017
Varnish intro
London devops logging
Memcached: What is it and what does it do? (PHP Version)
Memcached Code Camp 2009
Single page apps with drupal 7
Ad

Similar to Pure Speed Drupal 4 Gov talk (20)

PDF
High Performance Drupal
PDF
Drupal 7 performance and optimization
PPTX
Drupal performance
PDF
Drupal Performance : DrupalCamp North
PPT
Drupalcamp Estonia - High Performance Sites
PPT
Drupalcamp Estonia - High Performance Sites
PDF
Common Pitfalls for your Drupal Site, and How to Avoid Them
PDF
Plain english guide to drupal 8 criticals
PDF
Drupal performance and scalability
PPT
Performance and Scalability
ODP
Speeding up your Drupal site
PPT
Make Drupal Run Fast - increase page load speed
PDF
Scaling Drupal: Not IF... HOW
PPT
Drupal Performance - SerBenfiquista.com Case Study
PPT
Drupal caching
PDF
DrupalSouth 2015 - Performance: Not an Afterthought
PDF
Cache all the things - A guide to caching Drupal
PPTX
PHP Performance tuning for Drupal 8
PDF
High Performance Drupal Sites
PDF
Jeff Rigby on Scaling Drupal in the Enterprise
High Performance Drupal
Drupal 7 performance and optimization
Drupal performance
Drupal Performance : DrupalCamp North
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
Common Pitfalls for your Drupal Site, and How to Avoid Them
Plain english guide to drupal 8 criticals
Drupal performance and scalability
Performance and Scalability
Speeding up your Drupal site
Make Drupal Run Fast - increase page load speed
Scaling Drupal: Not IF... HOW
Drupal Performance - SerBenfiquista.com Case Study
Drupal caching
DrupalSouth 2015 - Performance: Not an Afterthought
Cache all the things - A guide to caching Drupal
PHP Performance tuning for Drupal 8
High Performance Drupal Sites
Jeff Rigby on Scaling Drupal in the Enterprise
Ad

More from Bryan Ollendyke (20)

PPTX
Lecture 14 - OER final project
PDF
Lecture 12 - Docker
PDF
Lecture 11 - Web components
PPTX
EdTechJoker Spring 2020 - Lecture 10 HAXTheWeb
PPTX
EdTechJoker Spring 2020 - Lecture 8 Drupal again
PPTX
EdTechJoker Spring 2020 - Lecture 7 Drupal intro
PPTX
EdTechJoker Spring 2020 - Lecture 6 - WordPress
PPTX
EdTechJoker Spring 2020 - Lecture 5 grav cms
PPTX
EdTechJoker Spring 2020 - Lecture 4 - HTML
PPTX
EdTechJoker Spring 2020 - Lecture 2 - Git
PPTX
EdTechJoker Spring 2020 - Lecture 1 - Welcome
PPTX
Apereo 2018 - NGDLE, OER, Cost reduction, accessibility and decentralization
PPTX
Apereo 2018 - Webcomponents and building a unified authoring experience for a...
PPTX
Apereo 2018 - HAX lightning talk
PPTX
Apereo 2018 - NGDLE efforts
PPTX
Apereo 2018 - Polymer training
PPTX
Building and Envisioning a Next Generation Digital Learning Environment
PPTX
History of the web as a platform from 1996 to 2017
PPTX
NGDLE (2016 version)
PPTX
Rethinking system design
Lecture 14 - OER final project
Lecture 12 - Docker
Lecture 11 - Web components
EdTechJoker Spring 2020 - Lecture 10 HAXTheWeb
EdTechJoker Spring 2020 - Lecture 8 Drupal again
EdTechJoker Spring 2020 - Lecture 7 Drupal intro
EdTechJoker Spring 2020 - Lecture 6 - WordPress
EdTechJoker Spring 2020 - Lecture 5 grav cms
EdTechJoker Spring 2020 - Lecture 4 - HTML
EdTechJoker Spring 2020 - Lecture 2 - Git
EdTechJoker Spring 2020 - Lecture 1 - Welcome
Apereo 2018 - NGDLE, OER, Cost reduction, accessibility and decentralization
Apereo 2018 - Webcomponents and building a unified authoring experience for a...
Apereo 2018 - HAX lightning talk
Apereo 2018 - NGDLE efforts
Apereo 2018 - Polymer training
Building and Envisioning a Next Generation Digital Learning Environment
History of the web as a platform from 1996 to 2017
NGDLE (2016 version)
Rethinking system design

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Getting Started with Data Integration: FME Form 101
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
A Presentation on Artificial Intelligence
PPTX
1. Introduction to Computer Programming.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Machine Learning_overview_presentation.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Network Security Unit 5.pdf for BCA BBA.
Advanced methodologies resolving dimensionality complications for autism neur...
TLE Review Electricity (Electricity).pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Programs and apps: productivity, graphics, security and other tools
Getting Started with Data Integration: FME Form 101
cloud_computing_Infrastucture_as_cloud_p
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Machine learning based COVID-19 study performance prediction
A Presentation on Artificial Intelligence
1. Introduction to Computer Programming.pptx
Unlocking AI with Model Context Protocol (MCP)
Machine Learning_overview_presentation.pptx
Spectral efficient network and resource selection model in 5G networks
Diabetes mellitus diagnosis method based random forest with bat algorithm
Reach Out and Touch Someone: Haptics and Empathic Computing
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Pure Speed Drupal 4 Gov talk

  • 1. #PureSpeed elmsln.org @btopro Come get sticker like this one In dribs and drabs we will change the world
  • 2. Project Lead ELMS Initiative Instructional Systems Architect E-Learning Institute College of Arts & Architecture Penn State University @btopro (aka Bryan Ollendyke)
  • 4. #purespeed • Tools to identify problems / needs • General Server Optimization • Drupal 7/8 Optimization • Fixing common front-end delivery issues
  • 5. Free / Local digging • Drupal.org/project/devel • Enable and set to display results of queries / memory usage • Hack Core • Throw a dpm() into module_invoke_all (includes/module.inc in D7) • https://drupal.psu.edu/blog/post/memory-profiling-hooks • XH-Prof • https://www.drupal.org/project/xhprof • Stand alone php profiler w/ drupal integration
  • 6. Big Data • Ability to trace errors deeply • Drupal specific breakdowns • Example • https://www.drupal.org/node/2370309#comment-10368929
  • 7. Server: Apache FPM • Switch from mod_php processing to FPM • yum install php5-fpm • Obviously more to it then that but worth exploring • https://github.com/bradallenfisher/php56-fpm-centos7-mysql56
  • 8. Server: PHP • PHP -- /etc/php.ini or /etc/php5/fpm/php.ini • Zend Opcache -- /etc/php.d/opcache.ini or /etc/php5/mods-available/opcache.ini • APC/u - /etc/php.d/apc.ini or /etc/php5/mods-available/apcu.ini • https://drupal.psu.edu/blog/post/purespeed-php-tuning • Cache code files in memory • Otherwise memory used to deliver insane! • PHP 5.5+ use Zend OpCache • APCu if you want as cache backend • PHP < 5.4 use APC • user bin for backend builtin • Biggest deal in mcarper’s opinion • realpath_cache_size = 1M • realpath_cache_ttl = 3600
  • 9. Server: MySQL • MySQL - /etc/my.cnf • Most common issue: • max-allowed-packet = 32M • Disable caching engine (counter intuitive but Drupal makes this worthless) • Ensure innodb table encoding, and tuned • Drupal Contrib: • APDQC – drupal.org/project/apdqc • Replacement for Core mysql cache bin engine • Eliminates deadlocks • Gives report on how to further optimize your server • Use other alternate cache backends (so mysql does less)
  • 10. Drupal: Cache bin management • Cache Bin Management • https://drupal.psu.edu/blog/post/purespeed-cache-bin-backends • Popular options • Apc user bin – great for things that don’t change • Fast, cheap and easy for anyone (don’t push page cache here!) • Filecache – writ to file system for cache data • Great, cheap and easy if on SSD • Memcache –popular in distributed / complex setups • Reddis – similar to memcache, newer and more popular now • Both great but usually you want this on its own server / more complicated • Apdqc – replacement for mysql core cache bin mechanism • Run on any site
  • 11. Drupal: Cache bin WARNING • Make sure file paths are correct! • WSOD • cache_form CAN NOT live in bins • All page form submission breaks • APC fragmentation • Restart apache on interval • APDQC recommendations • Some involve mysql upgrades • Semephor / session replacements can cause issues
  • 12. Drupal / Server • httprl_spider - https://www.drupal.org/project/httprl_spider • xmlrpc_page_load - https://www.drupal.org/project/xmlrpc_page_load • Usage: • drush @site hss node (request all nodes on site, as anonymous) • drush @site hss node –xmlrpcuid=1 (all nodes on site, “as user 1”) • Great for seeding anonymous/auth’ed user page caches • Stuff in a crontab nightly after cron (so caches are cleared out) • vi /etc/crontab * 4 * * * root drush @mysite cron 15 4 * * * root drush @mysite hss
  • 13. Server: Varnish • Varnish - /etc/varnish/default.vcl • yum install varnish • Reverse Proxy that sits in front of apache • Listen on 80; move apache to port 8080 • must have for anonymous traffic / high scale • Can’t handle HTTPS (without 4.x + plugin) • Nginx • More performant then stock apache but leess support • useful reverse proxy for HTTPS if not running outright
  • 14. Drupal 7 - entitycache • https://www.drupal.org/project/entitycache • Core in drupal 8.x.x! • Caches entity / object definitions (basically required for field collections) • Turn it on, that’s it!
  • 15. Drupal 7 - APDQC • Covered earlier • Install, read README and status page • Fix issues it reports • Faster site with less time spent in mysql calls
  • 16. Drupal 7 & 8 - advagg • Drupal.org/project/advagg • Covered earlier • Should be on every site you do • Biggest gains in compression, bundler, async font loader and pushing js to footer • Great for improving perception of page load • Beware of bricking JS though
  • 17. Drupal - HTTPRL • Drupal.org/project/httprl • Threading capable • Allows for queuing background threads and non-blocking calls • Similar to Guzzle (D8 core) • Makes certain projects faster (like advagg) • *Can be a bit of a troublemaker • https://drupal.psu.edu/blog/post/bench-marking-non-blocking-httprl-vs- drupalhttprequest • https://drupal.psu.edu/blog/post/core-caching-and-drupalstatic-make-cached- drupalhttprequests
  • 18. Drupal - APC • drupal.org/project/apc -Exposes APC user bin as a cache backend • Beware of fragmentation • Can’t be used in a distributed / clustered deployment (use memecache / reddis) $conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc'; $conf['cache_class_cache'] = 'DrupalAPCCache'; $conf['cache_class_cache_admin_menu'] = 'DrupalAPCCache'; $conf['cache_class_cache_block'] = 'DrupalAPCCache'; $conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache'; $conf['cache_class_cache_entity_file'] = 'DrupalAPCCache'; $conf['cache_class_cache_field'] = 'DrupalAPCCache'; $conf['cache_class_cache_menu'] = 'DrupalAPCCache'; $conf['cache_class_cache_libraries'] = 'DrupalAPCCache'; $conf['cache_class_cache_token'] = 'DrupalAPCCache'; $conf['cache_class_cache_views'] = 'DrupalAPCCache'; $conf['cache_class_cache_path_breadcrumbs'] = 'DrupalAPCCache'; $conf['cache_class_cache_path'] = 'DrupalAPCCache'; $conf['cache_class_cache_book'] = 'DrupalAPCCache’;
  • 19. Drupal 7 - Authcache • drupal.org/project/authcache • Aggressive caching methods for authenticated users • Great when granularity of access is per role • Caches per combination of roles (handles anonymous too) • Can cache admin, not recommended • Need to modify settings.php / authcache.php in Drupal root • https://github.com/elmsln/elmsln/blob/master/core/dslmcode/shared/drupal- 7.x/modules/ulmus/authcache/modules/authcache_p13n/safe_frontcontroller/au thcache.php
  • 20. Drupal 8 - BigPipe • Core in 8.1.x+ • Delivers parts of the page that take more time by loading the static stuff by itself, to load SOMETHING • Then additional JS based calls inject the slower parts of the page build
  • 21. Drupal 8 - Refreshless • https://www.drupal.org/project/refreshless • Similar to the Turbo Links, a technique from Rails • Page never actually reloads, it just calls in the background for parts of page • Similar to loading items on github.com (click between links and see!)
  • 22. The dreaded inherited site • ELMSLN stack • Someone screwed stuff up! • Identify issues • Win
  • 24. Front end performance • Yslow • Firefox / Chrome plugin by Yahoo
  • 25. Front end performance • PageSpeed • Chrome, right click -> inspect element -> Audits • Select Reload page and Audit on Load -> Run
  • 26. Front end performance • Webpagetest.org
  • 27. Asset Delivery • Deliver assets logically • Etags that make sense • Expire headers that make sense (far in the future for static assets) • Logical headers = less requests on future page loads • Which makes Apache happy • Your users happy!
  • 28. Server: Apache • Compression – send less w/ the same result • Etags – strip off so validation of resource match happens • Expires headers – ensure static assets are kept far into the future • Keep Alive – create less apache workers by keeping them open longer • MaxClients – set appropriately or server will die • memory per page / (RAM – other services) = MaxClients • Cheating – zzz_performance.conf • Drop in performance gain for almost any drupal / apache site • https://github.com/elmsln/elmsln/blob/master/scripts/server/zzz_performance.conf
  • 29. JS / CSS blocking • AdvAgg • https://www.drupal.org/project/advagg • Turn on modify and bundler sub-modules • Push for 2 groupings of css / js on bundler settings page • Modifier • Basically check everything that doesn’t sound evil • Use modify to push js into the bottom of the page • Careful, JS needs to be well formed! • Experimental! • Use javascript to load CSS • It’s in the bottom of the advagg modifier settings
  • 30. Fixing CDN category • All systems complain about CDN till you define what CDN is! • Ways to fix • Buy a legit CDN and pay a lot of money • Install https://www.drupal.org/project/cdn (illegitimate CDN) • Use settings in jquery_update module to deliver from Google / Microsoft • If on bootstrap, select CDN for code source • Use https://www.google.com/fonts for custom font CSS instead of local
  • 31. Make less requests • AdvAgg / aggregate CSS/JS files can help • https://www.drupal.org/project/advagg • Convert small images to sprites or “data” objects • https://www.drupal.org/project/css_emimage • Good luck though.. • You’re using a modular CMS / framework!