SlideShare a Scribd company logo
1 of 52
Drupal Performance and Optimization
By: Shafqat Hussain
http://speedup.co.id/
Basics of Web App Systems Architecture
• General Web Software Optimization
Strategies
• Defining a Goal for Performance
• Performance Metrics, tools
• Performance Debugging Techniques
• What Can You Control?
• What Is Caching?
• Optimizing Drupal
Overview
Me:
Shafqat Hussain
shafqat.1982@gmail.com
Why
.
.
http://goinswriter.com/frustrated-writer/
● According to surveys, nearly half of web users expect a site to load in
2 seconds or less, and they tend to abandon a site that isn’t loaded
within 3 seconds. 79% of web shoppers who have trouble with web
site performance say they won’t return to the site to buy again and
around 44% of them would tell a friend if they had a poor experience
shopping online.
● If an e-commerce site is making $100,000 per day, a 1 second page
delay could potentially cost you $2.5 million in lost sales every year
Facts and stats
Google Search ranking
Default Drupal
Large Drupal website without Performance
optimization
Our Mission
Planning
Web Architecture LAMP
● Move operations from devices with slower
access to devices with faster access
● Reduce disk I/O
● Reduce bandwidth
● Use memory more efficiently
● Increase parallelism
● Reducing CPU
● Keep Drupal and modules up to date.
● Keep monitoring
● Use of Ajax
General Strategies
● Performance optimization can become an
endless task without a goal
● What is your goal?
● – Page load time (4 seconds for blogs)
● – Requests/sec
● – Response time
● Performance metrics come first!
Defining a Goal
page loading …..
● Google Analytics Site Speed
● Yslow
● Page speed extension chrome/Firefox
● Chrome Developer tools
● Devel Module
● www.webpagetest.org
Tools
● Initial page load vs. loading assets
● What is Waiting?
Chrome Developer tools
Live Demo
Devel module demo
● Shared Hosting vs. VPS or Dedicated Server
● Shared server allows no:
● – Apache configuration
● – MySQL configuration
● – Memcached/APC for utilizing local memory
● – Consistent resources
● Despite these limitations, you still have a lot of
options even if on Shared Hosting
What Can you Control?
● Saving the results of computation to reuse at a later
date which saves time
● • Moving from slow disks to local memory
● • Reduce number of database queries
● • Reduce number of files to serve
● • Both server-side caching, and client-side caching
● • Disadvantages: stale data, duplication of data
What is Caching?
● Tuning strategies presented in the typical
priority that you should look at them.
● – Biggest improvement at lowest cost
(time or money)
● – First Shared Hosting
● – Then VPS/Dedicated Server-only
Drupal Performance Priority
● Output of many database queries that are
rendered into HTML to create an entire
page are saved as an entire object in
cache.
● Only works for Anonymous users
Page Caching
● Parallelism is limited by web browser and
web server.
● Reducing number and size of files
improves performance
Aggregate and Compress
CSS Files
● Parallelism is limited by web browser and web
server.
● Reducing number of files improves performance
● Compression has to be done outside of Drupal,
recommend YUI Compressor or Google Closure
compiler
Aggregate/Compress
Javascript Files
● To address performance for Authenticated
Users, look at enabling Views caching
● Set the time lengths for fine tuning your
caching strategy
● Views Content Cache (event based)
● Found under Advanced section when
Editing a View OR Demo
Turn Views Caching On
● Another way to address performance for
Authenticated Users
● Modules can define whether blocks can
be cached by user, by role
Turn Block Caching On
● Reduces the chain of hooks that need to be followed
● This further reduces database queries, CSS and
Javascript files
● Can you do it another way with core Drupal/ existing
module or small code snippet in template.php?
Disable Modules Not Used
● Moving static files (images, videos, CSS,
Javascript) to another server
● Reduces disk I/O and requests handled
by web server
● Increases parallelism due to client-side
limit
Move Static Files to a CDN
● Within your own modules, you can create
your own database cache tables
● Allows you to control what is cached and
how long it is kept
● Separate UI files in modules
● Disable modules UI parts in live sites.
● Link: Beginner’s Guide to Caching Data in
Drupal 7
Caching in Your Own Modules
● Just like CSS and Javascript aggregation,
● always good idea to reduce number and
sizes of images
● • Compression
● • Repeating backgrounds
● • CSS Image Sprites
Reduce Image Sizes and Number of
Images
VPS/DEDICATED SERVER-ONLY
PERFORMANCE OPTIMIZATIONS
● Determines how many requests you can handle in
parallel
● How to know:
MaxClients = Total RAM dedicated to the web server /
Max child process size
● HTTP keep-alive Timeout (also known as persistent
connections) is keeping the TCP socket open so that
another request can be made without setting up a
new connection.
Apache
● Great for saving small queries run on database
tables that never or rarely change
● • Doesn’t eliminate, just comes out of memory
● • Even just 8MB or 16MB of memory will do wonders
● • Link: http://dev.mysql.com/doc/refman/5.
1/en/query-cache.html
● MySQL Tuning https://drupal.org/node/51263
Enable MySQL Query Caching
Memcached Server for Caching
● An in-memory cache used to move
requests from disks to memory
● • Drupal cache tables run from
Memcached instead of cache database
table.
● https://drupal.org/project/memcache
● http://andrewdunkle.com/2012/how-to-
install-memcached-for-drupal-7.html
Varnish
Boost
Installation demo
https://drupal.org/node/1459690
http://beauteimparfaite.com/soyez-curieux/
● Search is resource intensive
● Consider Solr
● Google Custom search
Pressflow
● Instead of PHP being interpreted every
time, stores intermediate code (opcodes)
in memory
● Each site can take up 16M or more
Enable APC
Note: It is possible to destroy your
site by configuring incorrectly. Be
careful and back up configurations
before making changes. especially for
MySQL, Apache
● Boost
● Memcached
● Varnish
● Block Cache
● AuthCache
● CacheRouter
● Fast 404
● Entity Cache
Modules
● Database logging
● Statistics(consider Google Analytics)
● PHP filter
● Update Manager
Note: disable devel, UI modules
Bad Modules
● eg: ‘Add to cart’ change
● You might be able solve with views, or
other existing modules.
● Javascript/Jquery for small text changes.
Do you really need
module for that.
● Cache tags(to delete only related cache)
● P15N(Handling dynamic stuff for
anonymous, eg: last visited time).
Drupal 8
Spend Some $
● Separate MySQL server from Web Server
● Increase RAM
● Load Balance two web servers
● Buy a separate Memcached server
● Use Varnish or Squid (HTTP accelerators)
● Drupal specific hosting
Thank you for your patience!
By:Shafqat Hussain
Questions?
Answer:
www.google.com

More Related Content

What's hot

WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s  | WordPress TrivandrumWordPress Hosting Best Practices - Do's and Don't s  | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s | WordPress TrivandrumWordPress Trivandrum
 
Wordpress optimization
Wordpress optimizationWordpress optimization
Wordpress optimizationAlmog Baku
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQRest West
 
ASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen OxfordASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen OxfordPhil Pursglove
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performaceTuyển Đoàn
 
Web Performance Part 3 "Server-side tips"
Web Performance Part 3  "Server-side tips"Web Performance Part 3  "Server-side tips"
Web Performance Part 3 "Server-side tips"Binary Studio
 
Client-side Website Optimization
Client-side Website OptimizationClient-side Website Optimization
Client-side Website OptimizationRadu Pintilie
 
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on NginxEasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on NginxrtCamp
 
Website performance optimization QA
Website performance optimization QAWebsite performance optimization QA
Website performance optimization QADenis Dudaev
 
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento MeetupMagento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento MeetupKelly Mason
 
Scaling a Web Service
Scaling a Web ServiceScaling a Web Service
Scaling a Web ServiceLeon Ho
 
Skalowalna architektura na przykładzie soccerway.com
Skalowalna architektura na przykładzie soccerway.comSkalowalna architektura na przykładzie soccerway.com
Skalowalna architektura na przykładzie soccerway.comSpodek 2.0
 
Scaling WordPress on DigitalOcean
Scaling WordPress on DigitalOceanScaling WordPress on DigitalOcean
Scaling WordPress on DigitalOceanServerGuy
 

What's hot (17)

WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s  | WordPress TrivandrumWordPress Hosting Best Practices - Do's and Don't s  | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
 
Wordpress optimization
Wordpress optimizationWordpress optimization
Wordpress optimization
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQ
 
ASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen OxfordASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen Oxford
 
WordCamp RVA
WordCamp RVAWordCamp RVA
WordCamp RVA
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performace
 
Web Performance Part 3 "Server-side tips"
Web Performance Part 3  "Server-side tips"Web Performance Part 3  "Server-side tips"
Web Performance Part 3 "Server-side tips"
 
Performance stack
Performance stackPerformance stack
Performance stack
 
Client-side Website Optimization
Client-side Website OptimizationClient-side Website Optimization
Client-side Website Optimization
 
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on NginxEasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
 
Web performance Talk
Web performance TalkWeb performance Talk
Web performance Talk
 
Website performance optimization QA
Website performance optimization QAWebsite performance optimization QA
Website performance optimization QA
 
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento MeetupMagento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
 
Scaling a Web Service
Scaling a Web ServiceScaling a Web Service
Scaling a Web Service
 
Caching Strategies
Caching StrategiesCaching Strategies
Caching Strategies
 
Skalowalna architektura na przykładzie soccerway.com
Skalowalna architektura na przykładzie soccerway.comSkalowalna architektura na przykładzie soccerway.com
Skalowalna architektura na przykładzie soccerway.com
 
Scaling WordPress on DigitalOcean
Scaling WordPress on DigitalOceanScaling WordPress on DigitalOcean
Scaling WordPress on DigitalOcean
 

Similar to Drupal 7 performance and optimization

Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalabilityTwinbit
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibrePablo Moretti
 
Optimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance. Tips and TricksOptimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance. Tips and TricksTimur Kamanin
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013Santiago Aimetta
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performanceAndrew Siemer
 
Performance Optimization in Drupal 8
Performance Optimization in Drupal 8Performance Optimization in Drupal 8
Performance Optimization in Drupal 8valuebound
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtNick Santamaria
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedAndy Kucharski
 
Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11Jess Coburn
 
How to Boost the performance of your Wordpress powered websites
How to Boost the performance of your Wordpress powered websitesHow to Boost the performance of your Wordpress powered websites
How to Boost the performance of your Wordpress powered websitesPratik Jagdishwala
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadKrivoy Rog IT Community
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGearsAlessandro Molina
 
Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsBrettTasker
 
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...George White
 
Building faster websites: web performance with WordPress
Building faster websites: web performance with WordPressBuilding faster websites: web performance with WordPress
Building faster websites: web performance with WordPressJohannes Siipola
 
Memcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav JainMemcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav JainDrupal Camp Delhi
 

Similar to Drupal 7 performance and optimization (20)

Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalability
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibre
 
Optimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance. Tips and TricksOptimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance. Tips and Tricks
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
Performance Optimization in Drupal 8
Performance Optimization in Drupal 8Performance Optimization in Drupal 8
Performance Optimization in Drupal 8
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an Afterthought
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 
Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11
 
How to Boost the performance of your Wordpress powered websites
How to Boost the performance of your Wordpress powered websitesHow to Boost the performance of your Wordpress powered websites
How to Boost the performance of your Wordpress powered websites
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGears
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applications
 
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...
 
Building faster websites: web performance with WordPress
Building faster websites: web performance with WordPressBuilding faster websites: web performance with WordPress
Building faster websites: web performance with WordPress
 
Memcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav JainMemcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav Jain
 

Recently uploaded

Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Recently uploaded (20)

Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

Drupal 7 performance and optimization

  • 1. Drupal Performance and Optimization By: Shafqat Hussain http://speedup.co.id/
  • 2. Basics of Web App Systems Architecture • General Web Software Optimization Strategies • Defining a Goal for Performance • Performance Metrics, tools • Performance Debugging Techniques • What Can You Control? • What Is Caching? • Optimizing Drupal Overview
  • 4.
  • 5.
  • 6.
  • 7. Why
  • 9. ● According to surveys, nearly half of web users expect a site to load in 2 seconds or less, and they tend to abandon a site that isn’t loaded within 3 seconds. 79% of web shoppers who have trouble with web site performance say they won’t return to the site to buy again and around 44% of them would tell a friend if they had a poor experience shopping online. ● If an e-commerce site is making $100,000 per day, a 1 second page delay could potentially cost you $2.5 million in lost sales every year Facts and stats
  • 12. Large Drupal website without Performance optimization
  • 16. ● Move operations from devices with slower access to devices with faster access ● Reduce disk I/O ● Reduce bandwidth ● Use memory more efficiently ● Increase parallelism ● Reducing CPU ● Keep Drupal and modules up to date. ● Keep monitoring ● Use of Ajax General Strategies
  • 17. ● Performance optimization can become an endless task without a goal ● What is your goal? ● – Page load time (4 seconds for blogs) ● – Requests/sec ● – Response time ● Performance metrics come first! Defining a Goal
  • 19. ● Google Analytics Site Speed ● Yslow ● Page speed extension chrome/Firefox ● Chrome Developer tools ● Devel Module ● www.webpagetest.org Tools
  • 20. ● Initial page load vs. loading assets ● What is Waiting? Chrome Developer tools Live Demo
  • 22. ● Shared Hosting vs. VPS or Dedicated Server ● Shared server allows no: ● – Apache configuration ● – MySQL configuration ● – Memcached/APC for utilizing local memory ● – Consistent resources ● Despite these limitations, you still have a lot of options even if on Shared Hosting What Can you Control?
  • 23. ● Saving the results of computation to reuse at a later date which saves time ● • Moving from slow disks to local memory ● • Reduce number of database queries ● • Reduce number of files to serve ● • Both server-side caching, and client-side caching ● • Disadvantages: stale data, duplication of data What is Caching?
  • 24. ● Tuning strategies presented in the typical priority that you should look at them. ● – Biggest improvement at lowest cost (time or money) ● – First Shared Hosting ● – Then VPS/Dedicated Server-only Drupal Performance Priority
  • 25. ● Output of many database queries that are rendered into HTML to create an entire page are saved as an entire object in cache. ● Only works for Anonymous users Page Caching
  • 26. ● Parallelism is limited by web browser and web server. ● Reducing number and size of files improves performance Aggregate and Compress CSS Files
  • 27. ● Parallelism is limited by web browser and web server. ● Reducing number of files improves performance ● Compression has to be done outside of Drupal, recommend YUI Compressor or Google Closure compiler Aggregate/Compress Javascript Files
  • 28. ● To address performance for Authenticated Users, look at enabling Views caching ● Set the time lengths for fine tuning your caching strategy ● Views Content Cache (event based) ● Found under Advanced section when Editing a View OR Demo Turn Views Caching On
  • 29. ● Another way to address performance for Authenticated Users ● Modules can define whether blocks can be cached by user, by role Turn Block Caching On
  • 30. ● Reduces the chain of hooks that need to be followed ● This further reduces database queries, CSS and Javascript files ● Can you do it another way with core Drupal/ existing module or small code snippet in template.php? Disable Modules Not Used
  • 31. ● Moving static files (images, videos, CSS, Javascript) to another server ● Reduces disk I/O and requests handled by web server ● Increases parallelism due to client-side limit Move Static Files to a CDN
  • 32. ● Within your own modules, you can create your own database cache tables ● Allows you to control what is cached and how long it is kept ● Separate UI files in modules ● Disable modules UI parts in live sites. ● Link: Beginner’s Guide to Caching Data in Drupal 7 Caching in Your Own Modules
  • 33. ● Just like CSS and Javascript aggregation, ● always good idea to reduce number and sizes of images ● • Compression ● • Repeating backgrounds ● • CSS Image Sprites Reduce Image Sizes and Number of Images
  • 35. ● Determines how many requests you can handle in parallel ● How to know: MaxClients = Total RAM dedicated to the web server / Max child process size ● HTTP keep-alive Timeout (also known as persistent connections) is keeping the TCP socket open so that another request can be made without setting up a new connection. Apache
  • 36. ● Great for saving small queries run on database tables that never or rarely change ● • Doesn’t eliminate, just comes out of memory ● • Even just 8MB or 16MB of memory will do wonders ● • Link: http://dev.mysql.com/doc/refman/5. 1/en/query-cache.html ● MySQL Tuning https://drupal.org/node/51263 Enable MySQL Query Caching
  • 37. Memcached Server for Caching ● An in-memory cache used to move requests from disks to memory ● • Drupal cache tables run from Memcached instead of cache database table. ● https://drupal.org/project/memcache ● http://andrewdunkle.com/2012/how-to- install-memcached-for-drupal-7.html
  • 40. ● Search is resource intensive ● Consider Solr ● Google Custom search
  • 42. ● Instead of PHP being interpreted every time, stores intermediate code (opcodes) in memory ● Each site can take up 16M or more Enable APC
  • 43. Note: It is possible to destroy your site by configuring incorrectly. Be careful and back up configurations before making changes. especially for MySQL, Apache
  • 44. ● Boost ● Memcached ● Varnish ● Block Cache ● AuthCache ● CacheRouter ● Fast 404 ● Entity Cache Modules
  • 45. ● Database logging ● Statistics(consider Google Analytics) ● PHP filter ● Update Manager Note: disable devel, UI modules Bad Modules
  • 46. ● eg: ‘Add to cart’ change ● You might be able solve with views, or other existing modules. ● Javascript/Jquery for small text changes. Do you really need module for that.
  • 47.
  • 48. ● Cache tags(to delete only related cache) ● P15N(Handling dynamic stuff for anonymous, eg: last visited time). Drupal 8
  • 49. Spend Some $ ● Separate MySQL server from Web Server ● Increase RAM ● Load Balance two web servers ● Buy a separate Memcached server ● Use Varnish or Squid (HTTP accelerators) ● Drupal specific hosting
  • 50. Thank you for your patience! By:Shafqat Hussain