SlideShare una empresa de Scribd logo
1 de 32
Apache
Web
Performan
ce
Leveraging Apache to make
your site fly
Who am I?
&
Why would you listen to me?
Why would you listen to me?
Why would you listen to me?
Devon
Hillard
Web Application Architect
Built 10MinuteMail
Run Spark::red, an enterprise
eCommerce Hosting
company
Complex Web Apps with
extremely high traffic and
critical performance needs
devon@sparkred.com
What is Performance?
• Traffic Capacity
• Request handling
speed
• Request handling
throughput
• Lower
CPU/memory/bandwidt
h usage
• Scalability
• Page Load Time
• First draw
• Inter-actable
• Complete
• Page Interaction
Responsiveness
• Time to Complete Use
Case
These two are TIED
• Browser caching of static assets reduces page
load time AND reduces the number of requests
the server has to handle for the same number
of page views
• AJAX requests can typically be handled with far
fewer resources than full page requests
• Reduced asset sizes means less bandwidth
used and shorter request response sending
times
• Solving for the Client brings Server performance
gains!
Why Should I Care?
Everyone Wins!
• Client-Side Performance means
• happier users
• increased conversions
• increased SEO ranking
• Server-Side Performance means
• more capacity on same hardware
• saves money
• scaling is easier
Increased
Conversions
•+100 ms of page load time = 1% drop in sales
•+500 ms of page load time = 20% drop in searches
•+400 ms of page load time = 5-9% increase in
clicking “back” button before the page finished
loading
Why Apache?
Why I Use Apache
• Popular web server - it’s everywhere
• Easy to install, troubleshoot, and find information
on
• Mature and stable
• Lots of extensions
• Enterprise support requirements
• It Is fast enough to max out your hardware!
CPU Util @ 930
Mbit/sechttp://www.webperformance.com/load-testing/blog/2011/11/what-is-the-fastest-
webserver/
PCA
Awards
• Saw 4x the planned for
traffic during spikes
• 140,000+ pages/minute
- 2,333 pps (2012)
• 3,000+ Mbit/sec (2011)
• 1,200+ Mbit/sec PLUS
Akamai CDN offloaded
traffic (2012)
• The site stayed up and
was quick to load and
responsive to interact
with the whole time
iftop output - 613 Mbit/sec
Puppies
Basic Apache Configs
Every App
is
Different
Different
Different
Which MPM?
• Worker MPM scales for high traffic without
running out of memory better
• Less time spent tuning worker configs
• Unless you’re still using non-threadsafe Apache
code (some PHP, etc..)
• New in Apache 2.4 is the Event MPM
Default
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild
0</IfModule>
Mine
<IfModule worker.c>
ThreadLimit 100
StartServers 5
MaxClients 5500
ServerLimit 200
MinSpareThreads 100
MaxSpareThreads 1000
ThreadsPerChild 100
MaxRequestsPerChild
0</IfModule>
MPM Worker
Configs
ab with small file
Version
Apache 2.2.3 MPM
Worker
Document Size 119 bytes
Concurrency Level 1,000
Total Requests 100,000
Requests Per Second 20,790 r/s
Throughput 8,077 kb/s
hex core X5675
ab with large file
Version
Apache 2.2.3 MPM
Worker
Document Size 95,002 bytes
Concurrency Level 1,000
Total Requests 100,000
Requests Per Second 1,258 r/s
Throughput 119,966 kb/s
hex core X5675
Linux Kernel
Configs
net.ipv4.tcp_max_syn_backlog=30000
net.core.netdev_max_backlog=1200
net.ipv4.tcp_timestamps=0
net.ipv4.tcp_sack=0
net.ipv4.tcp_window_scaling=0
net.ipv4.tcp_max_tw_buckets=2000000
net.ipv4.tcp_mem=100000000 100000000 100000000
net.ipv4.tcp_wmem=100000000 100000000 100000000
net.ipv4.tcp_rmem=30000000 30000000 30000000
net.ipv4.ip_conntrack_max = 231072
Keepalive - On or
Off?
• reduces overhead of establishing new
connections for each request from the browser
• can waste memory and other resources if left
open too long
• Common practice is to disable them
• I turn keepalive on, set to 6 seconds or 500
requests
• For CDNs like Akamai, you’ll want to turn up the
time to more like 120 seconds
GZip - mod_deflate
• gzip compressing text resources - html, js, xml,
css dramatically decreases the size of the
response for those assets: often up to 90%
reduction in size
• reduces transfer time, especially for clients with
slower connections (or big files)
• This decreases page load time (Client) and
reduces the time the server thread is sending
the response (Server)
# Removing Hosts vary
Header unset Vary
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain
text/xml text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
</IfModule>
Browser Caching
• Tell the browser to cache all static assets, for as
long as you can bear it
• Set the ETag
• Set cache control and expiration response
headers
<LocationMatch '^/pca/images/.*'>
FileETag MTime Size
Header set Cache-Control "max-age=2764800, public"
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg A2764800
ExpiresByType image/jpeg A2764800
ExpiresByType image/png A2764800
</IfModule>
</LocationMatch>
Disk Caching
• Why not use mod_mem_cache?
• Transparent web server caching of assets
reduces load without deployment and
development complexities
• Some warnings!
• Doesn’t auto clean itself
• Can grow to be huge if you don’t check the
headers being cached
• Can grow to be huge if you have dynamic
URI content - blah.jpg;jsessionid=foo
• Another place to purge cache for changed
files
Disk Caching -
Config
<IfModule mod_disk_cache.c>
CacheRoot /var/cache/mod_disk_cache
CacheDirLevels 2
CacheDirLength 1
CacheEnable disk /pca/img
CacheEnable disk /pca/flash
CacheEnable disk /pca/css
CacheEnable disk /pca/js
CacheEnable disk /pca/images
CacheMaxFileSize 200715200
CacheDefaultExpire 3600
CacheIgnoreHeaders Set-Cookie
</IfModule>
Mod_PageSpeed
• Open Source Apache Module
• Lots and Lots of filters
• image compression
• combine js/css
• sprite images
• domain sharding
• etc...
Three Tier
Architectur
e
• SSL Termination
• Load Balancing
• Mod_proxy/mod_cluster
• Mod_Security
Building
Scalable
Clusters
w/Apache
• VIP
• heartbeat
• haproxy
• DNS LB
• simple round robin
• smart
Questions?
Thank you!
devon@sparkred.co
m
devon@sparkred.co
m
devon@sparkred.co
m

Más contenido relacionado

La actualidad más candente

High Performance WordPress II
High Performance WordPress IIHigh Performance WordPress II
High Performance WordPress IIBarry Abrahamson
 
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
 
Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012eballisty
 
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo MeetupSpeed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo MeetupAhmed Mohammed Nagdy
 
Implementing High Performance Drupal Sites
Implementing High Performance Drupal SitesImplementing High Performance Drupal Sites
Implementing High Performance Drupal SitesShri Kumar
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAshokkumar T A
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APCBen Ramsey
 
NGINX for Application Delivery & Acceleration
NGINX for Application Delivery & AccelerationNGINX for Application Delivery & Acceleration
NGINX for Application Delivery & AccelerationNGINX, Inc.
 
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...Amazon Web Services
 
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloudStress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloudAndy Kucharski
 
Caching: A Guided Tour - 10/12/2010
Caching: A Guided Tour - 10/12/2010Caching: A Guided Tour - 10/12/2010
Caching: A Guided Tour - 10/12/2010Jason Ragsdale
 
NOMAD ENTERPRISE & WAN CACHING APPLIANCES NETWORK OPTIMIZATION IN A CONFIGURA...
NOMAD ENTERPRISE & WAN CACHING APPLIANCES NETWORK OPTIMIZATION IN A CONFIGURA...NOMAD ENTERPRISE & WAN CACHING APPLIANCES NETWORK OPTIMIZATION IN A CONFIGURA...
NOMAD ENTERPRISE & WAN CACHING APPLIANCES NETWORK OPTIMIZATION IN A CONFIGURA...1E: Software Lifecycle Automation
 
Supercharge Application Delivery to Satisfy Users
Supercharge Application Delivery to Satisfy UsersSupercharge Application Delivery to Satisfy Users
Supercharge Application Delivery to Satisfy UsersNGINX, Inc.
 
Optimizing WordPress for Performance - WordCamp Houston
Optimizing WordPress for Performance - WordCamp HoustonOptimizing WordPress for Performance - WordCamp Houston
Optimizing WordPress for Performance - WordCamp HoustonChris Olbekson
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on SteroidsSiteGround.com
 
Building a DevOps pipeline for Serverless by using Mocha, GitHub and Travis
Building a DevOps pipeline for Serverless by using Mocha, GitHub and TravisBuilding a DevOps pipeline for Serverless by using Mocha, GitHub and Travis
Building a DevOps pipeline for Serverless by using Mocha, GitHub and TravisExove
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 SystemsDavid Newman
 

La actualidad más candente (20)

Fluent 2012 v2
Fluent 2012   v2Fluent 2012   v2
Fluent 2012 v2
 
High Performance WordPress II
High Performance WordPress IIHigh Performance WordPress II
High Performance WordPress II
 
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
 
Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012
 
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo MeetupSpeed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
 
Implementing High Performance Drupal Sites
Implementing High Performance Drupal SitesImplementing High Performance Drupal Sites
Implementing High Performance Drupal Sites
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricks
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
 
NGINX for Application Delivery & Acceleration
NGINX for Application Delivery & AccelerationNGINX for Application Delivery & Acceleration
NGINX for Application Delivery & Acceleration
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
 
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloudStress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
 
Caching: A Guided Tour - 10/12/2010
Caching: A Guided Tour - 10/12/2010Caching: A Guided Tour - 10/12/2010
Caching: A Guided Tour - 10/12/2010
 
SSDs are Awesome
SSDs are AwesomeSSDs are Awesome
SSDs are Awesome
 
NOMAD ENTERPRISE & WAN CACHING APPLIANCES NETWORK OPTIMIZATION IN A CONFIGURA...
NOMAD ENTERPRISE & WAN CACHING APPLIANCES NETWORK OPTIMIZATION IN A CONFIGURA...NOMAD ENTERPRISE & WAN CACHING APPLIANCES NETWORK OPTIMIZATION IN A CONFIGURA...
NOMAD ENTERPRISE & WAN CACHING APPLIANCES NETWORK OPTIMIZATION IN A CONFIGURA...
 
Supercharge Application Delivery to Satisfy Users
Supercharge Application Delivery to Satisfy UsersSupercharge Application Delivery to Satisfy Users
Supercharge Application Delivery to Satisfy Users
 
Optimizing WordPress for Performance - WordCamp Houston
Optimizing WordPress for Performance - WordCamp HoustonOptimizing WordPress for Performance - WordCamp Houston
Optimizing WordPress for Performance - WordCamp Houston
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
 
Building a DevOps pipeline for Serverless by using Mocha, GitHub and Travis
Building a DevOps pipeline for Serverless by using Mocha, GitHub and TravisBuilding a DevOps pipeline for Serverless by using Mocha, GitHub and Travis
Building a DevOps pipeline for Serverless by using Mocha, GitHub and Travis
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 Systems
 

Similar a Configuring Apache Servers for Better Web Perormance

Website Performance
Website PerformanceWebsite Performance
Website PerformanceHugo Fonseca
 
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Amazon Web Services
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningBrian Huff
 
How to improve your apache web server’s performance
How to improve your apache web server’s performanceHow to improve your apache web server’s performance
How to improve your apache web server’s performanceAndolasoft Inc
 
SharePoint Saturday The Conference 2011 - SP2010 Performance
SharePoint Saturday The Conference 2011 - SP2010 PerformanceSharePoint Saturday The Conference 2011 - SP2010 Performance
SharePoint Saturday The Conference 2011 - SP2010 PerformanceBrian Culver
 
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...Amazon Web Services
 
Capacity Planning
Capacity PlanningCapacity Planning
Capacity PlanningMongoDB
 
SharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceSharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceBrian Culver
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it FastBarry Jones
 
Tips for a Faster Website
Tips for a Faster WebsiteTips for a Faster Website
Tips for a Faster WebsiteRayed Alrashed
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013Santiago Aimetta
 
DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilitycherryhillco
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Timothy Fisher
 
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
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibrePablo Moretti
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Brian Culver
 
High performance website
High performance websiteHigh performance website
High performance websiteChamnap Chhorn
 

Similar a Configuring Apache Servers for Better Web Perormance (20)

Website Performance
Website PerformanceWebsite Performance
Website Performance
 
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance Tuning
 
How to improve your apache web server’s performance
How to improve your apache web server’s performanceHow to improve your apache web server’s performance
How to improve your apache web server’s performance
 
Performance engineering
Performance engineeringPerformance engineering
Performance engineering
 
SharePoint Saturday The Conference 2011 - SP2010 Performance
SharePoint Saturday The Conference 2011 - SP2010 PerformanceSharePoint Saturday The Conference 2011 - SP2010 Performance
SharePoint Saturday The Conference 2011 - SP2010 Performance
 
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
 
Capacity Planning
Capacity PlanningCapacity Planning
Capacity Planning
 
SharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceSharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 Performance
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
 
Web Performance Optimization (WPO)
Web Performance Optimization (WPO)Web Performance Optimization (WPO)
Web Performance Optimization (WPO)
 
Tips for a Faster Website
Tips for a Faster WebsiteTips for a Faster Website
Tips for a Faster Website
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013
 
DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalability
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
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
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibre
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!
 
High performance website
High performance websiteHigh performance website
High performance website
 

Último

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 

Último (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

Configuring Apache Servers for Better Web Perormance

  • 2. Who am I? & Why would you listen to me? Why would you listen to me? Why would you listen to me?
  • 3. Devon Hillard Web Application Architect Built 10MinuteMail Run Spark::red, an enterprise eCommerce Hosting company Complex Web Apps with extremely high traffic and critical performance needs devon@sparkred.com
  • 5. • Traffic Capacity • Request handling speed • Request handling throughput • Lower CPU/memory/bandwidt h usage • Scalability
  • 6. • Page Load Time • First draw • Inter-actable • Complete • Page Interaction Responsiveness • Time to Complete Use Case
  • 7. These two are TIED • Browser caching of static assets reduces page load time AND reduces the number of requests the server has to handle for the same number of page views • AJAX requests can typically be handled with far fewer resources than full page requests • Reduced asset sizes means less bandwidth used and shorter request response sending times • Solving for the Client brings Server performance gains!
  • 8. Why Should I Care?
  • 9. Everyone Wins! • Client-Side Performance means • happier users • increased conversions • increased SEO ranking • Server-Side Performance means • more capacity on same hardware • saves money • scaling is easier
  • 10. Increased Conversions •+100 ms of page load time = 1% drop in sales •+500 ms of page load time = 20% drop in searches •+400 ms of page load time = 5-9% increase in clicking “back” button before the page finished loading
  • 12. Why I Use Apache • Popular web server - it’s everywhere • Easy to install, troubleshoot, and find information on • Mature and stable • Lots of extensions • Enterprise support requirements • It Is fast enough to max out your hardware!
  • 13. CPU Util @ 930 Mbit/sechttp://www.webperformance.com/load-testing/blog/2011/11/what-is-the-fastest- webserver/
  • 14. PCA Awards • Saw 4x the planned for traffic during spikes • 140,000+ pages/minute - 2,333 pps (2012) • 3,000+ Mbit/sec (2011) • 1,200+ Mbit/sec PLUS Akamai CDN offloaded traffic (2012) • The site stayed up and was quick to load and responsive to interact with the whole time iftop output - 613 Mbit/sec
  • 18. Which MPM? • Worker MPM scales for high traffic without running out of memory better • Less time spent tuning worker configs • Unless you’re still using non-threadsafe Apache code (some PHP, etc..) • New in Apache 2.4 is the Event MPM
  • 19. Default <IfModule worker.c> StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0</IfModule> Mine <IfModule worker.c> ThreadLimit 100 StartServers 5 MaxClients 5500 ServerLimit 200 MinSpareThreads 100 MaxSpareThreads 1000 ThreadsPerChild 100 MaxRequestsPerChild 0</IfModule> MPM Worker Configs
  • 20. ab with small file Version Apache 2.2.3 MPM Worker Document Size 119 bytes Concurrency Level 1,000 Total Requests 100,000 Requests Per Second 20,790 r/s Throughput 8,077 kb/s hex core X5675
  • 21. ab with large file Version Apache 2.2.3 MPM Worker Document Size 95,002 bytes Concurrency Level 1,000 Total Requests 100,000 Requests Per Second 1,258 r/s Throughput 119,966 kb/s hex core X5675
  • 23. Keepalive - On or Off? • reduces overhead of establishing new connections for each request from the browser • can waste memory and other resources if left open too long • Common practice is to disable them • I turn keepalive on, set to 6 seconds or 500 requests • For CDNs like Akamai, you’ll want to turn up the time to more like 120 seconds
  • 24. GZip - mod_deflate • gzip compressing text resources - html, js, xml, css dramatically decreases the size of the response for those assets: often up to 90% reduction in size • reduces transfer time, especially for clients with slower connections (or big files) • This decreases page load time (Client) and reduces the time the server thread is sending the response (Server) # Removing Hosts vary Header unset Vary <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html </IfModule>
  • 25. Browser Caching • Tell the browser to cache all static assets, for as long as you can bear it • Set the ETag • Set cache control and expiration response headers <LocationMatch '^/pca/images/.*'> FileETag MTime Size Header set Cache-Control "max-age=2764800, public" <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg A2764800 ExpiresByType image/jpeg A2764800 ExpiresByType image/png A2764800 </IfModule> </LocationMatch>
  • 26. Disk Caching • Why not use mod_mem_cache? • Transparent web server caching of assets reduces load without deployment and development complexities • Some warnings! • Doesn’t auto clean itself • Can grow to be huge if you don’t check the headers being cached • Can grow to be huge if you have dynamic URI content - blah.jpg;jsessionid=foo • Another place to purge cache for changed files
  • 27. Disk Caching - Config <IfModule mod_disk_cache.c> CacheRoot /var/cache/mod_disk_cache CacheDirLevels 2 CacheDirLength 1 CacheEnable disk /pca/img CacheEnable disk /pca/flash CacheEnable disk /pca/css CacheEnable disk /pca/js CacheEnable disk /pca/images CacheMaxFileSize 200715200 CacheDefaultExpire 3600 CacheIgnoreHeaders Set-Cookie </IfModule>
  • 28. Mod_PageSpeed • Open Source Apache Module • Lots and Lots of filters • image compression • combine js/css • sprite images • domain sharding • etc...
  • 29. Three Tier Architectur e • SSL Termination • Load Balancing • Mod_proxy/mod_cluster • Mod_Security
  • 30. Building Scalable Clusters w/Apache • VIP • heartbeat • haproxy • DNS LB • simple round robin • smart

Notas del editor

  1. Been doing this for 14 years. 10MinuteMail handled a Slashdotting, front page listing on Yahoo Tech, and front page Digg at the same time. Worked on sites such as AT&amp;T.com, People’s Choice Awards, Payless Shoes, Vermont Country Store.
  2. When a user sees the page start loading, to when they can do stuff, to when the browser’s loading animation is done. Use Ajax to pre-populate fields, type-ahead, real-time field validation, reduce the number of full page submits/requests. Solving for client side performance can have a dramatic impact on the server side performance. Cached assets draw pages faster AND reduce requests the server has to handle.
  3. In engine building they say “Build for torque and the horsepower will follow”
  4. We’ve all seen these stats, but they’re worth repeating. This isn’t ivory tower stuff, this is simple business.
  5. Why not nginx (engine-X), Lighttpd, etc...? Extensions like mod_pagespeed, mod_cluster, and more.
  6. The problem with Apache configs are that the defaults are typically extremely out of date and based on much older hardware, network bandwidth, browser abilities, and application complexity
  7. Limited testing I did with Event MPM shows it’s ~5% faster than Worker, without real tuning.
  8. Just set it and forget it. If you have memory leak issues, set MaxRequestsPerChild to something like 5,000.
  9. This last setting (or larger) will keep your kernel from dropping incoming connections under high load
  10. Defaults are On, 15 seconds (too long), 100 requests (too small)
  11. This is HUGE! You can reduce the number of HTTP requests you have to handle by an order of magnitude or two by setting good cache headers.
  12. Mod_mem_cache has some bad bugs. mod_disk_cache lets the kernel’s in memory file caching algorithm do all the heavy lifting without tuning or exhausting available memory. For 3 tier environments, it’s common to have static assets that get deployed to the web servers separately from the application itself. This makes deployments more complex and error prone and makes local dev environments much harder to keep up to date. Seam and richfaces image tags insert jsessionid to URI, etc...
  13. I know a previous presentation was done on mod_pagespeed, so I won’t dive too deeply into all of it’s features and configs. Trying to optimize for performance can make dev more complicated. packtag. pagespeed.
  14. Apache is key for 3-tier architectures. It provides significant performance, security, and PCI compliance wins. Big improvements in Mod_proxy_balancer with 2.4 (dynamic cluster, session bleedoff, etc)