SlideShare a Scribd company logo
1 of 26
Download to read offline
25 Apache Performance Tips
www.monitis.com
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
1. Remove unused modules
Save memory by not loading modules that aren’t needed,
including (but not limited to)…
… mod_php,
… mod_ruby,
… mod_perl,
etc.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
2. Use mod_disk_cache and NOT
mod_mem_cache
Mod_mem_cachewill not share its cache amongst different
apache processes, which results in high memory usage with
little performance gain. On an active server mod_mem_cache
will rarely serve the same page twice in the same Apache
process.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
3. Configure mod_disk_cache with a
flat hierarchy
Make sure you are using CacheDirLength=2and
CacheDirLevels=1to ensure htcachecleanwill not take forever
when cleaning up your cache directory.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
4. Setup appropriate Expires, Etag,
and Chache-Control headers
In order to utilize your cache you have to specify when a file
expires, otherwise your client will not experience the caching
benefits.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
5. Put the cache on a separate disk
Move your cache to a separate physical disk for the fastest
access without slowing down other processes.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
6. Use piped logging instead of
direct logging
Directly logging to a file results in issues when rotating the log
file. A restart will be necessary to use the next log file. This
causes significant slowness for you users during the restart.
Particularly if you are using Passenger or some other app
loader.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
7. Log to a different disk than the
disk serving pages
Put your logs on physically different disks than the files you
are serving.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
8. Utilize mod_gzip/mod_deflate
Gzip your content before sending it off. The client will ungzip
upon receipt which will minimize the size of file transfers. Also,
it will generally improve the user experience.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
9. Turn off HostnameLookups
Stop doing effortful DNS lookups. You will rarely ever need
them and when you do, you can always look them up when
really needed.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
10. Avoid using hostname in configs
If HostnameLookups are turned off, it will keep you from
waiting for the DNS resolving the hostnames in your configs.
Instead, use IP addresses.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
11. Use persistent connections
Set KeepAlive, KeepAliveTimeout and KeepAliveRequests.
KeepAliveTimeout defines how long Apache will wait for the
next request, and KeepAliveRequests defines the maximum
number of requests for a client prior to resetting the
connection. This will prevent the client from having to
reconnect between each request.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
12. Do not set KeepAliveTimeout too
high
If you have more requests than Apache children, settings
which are set too high could exhaust your pool of available
clients.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
13. Disable .htaccess
I.e. AllowOverride None. This will keep Apache from checking
for an .htaccess file upon each request.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
14. Allow symlinks
I.e. Options + FoolowSymLinks – SymLinksIfOwnerMatch.
Otherwise, Apache will make a separate call on each filename
to ensure it is not a symlink.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
15. Set ExtendStatus off
Although very useful, the ExtendStatus will produce several
system calls for each request to gather statistics. It‘s better to
only define a certain time frame in order to benchmark and
keep it turned off the remainder of the time.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
16. Avoid Wildcards in
DirectoryIndex
Use a specific DirectoryIndex, i.e. index.html or index.php, not
index.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
17. Increase Swappiness
Particularly on single site hosts this will increase the
performance. On Linux systems increase
/proc/sys/vm/swappiness to at least 60 if not higher. This will
result in loading as many files as possible into the memory
cache for a quicker access.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
18. Increase Write Buffer Size
Increase your write buffer size for TCP/IP buffers. On Linux
systems increase /proc/sys/net/core/wmem_max and
/proc/sys/net/core/wmem_default. If your pages fit within this
buffer, Apache will complete a process in just one call to the
TCP/IP buffer.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
19. Increase Max Open Files
If you are handling high loads, increase the number of
allowed open files. On Linux increase /proc/sys/fs/file-max
and run ulimit –H –n 4096.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
20. Setup a frontend proxy for
images and stylesheets
Allow your main web servers to process the application while
images and stylesheets are served from frontend webservers.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
21. Use mod_passenger for rails
Mod_passenger is able to share memory and resources
amongst several processes, allowing for faster spawning of
new application instances. It will also monitor these
processes and remove them when they become unncessary.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
23. Don‘t use threaded mpm with
mod_php
Look at using mod_itk, mod_php tends to segfault with
threaded mpm.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
24. Flush buffers early for pre-
render
It takes a relatively long time to create a webpage on the
backend. Flush your buffer prior to page completion to send
a partial page to the client, so it can start rendering. A good
place to do this is right after the HEAD section – so that the
browser can start fetching other objects.
25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring
25. Use a cache for frequently
accessed data
Memcached is a great for frequently used data and sessions. It
will speed up your Apache render time as databases are
slow.
facebook.com/Monitis.Monitoring
@Monitis
The All-in-One Monitoring Solution
Start your free 15-day trial for
free!
www.monitis.com

More Related Content

What's hot

Tomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance TuningTomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance Tuninglovingprince58
 
Apache Tomcat 8 Application Server
Apache Tomcat 8 Application ServerApache Tomcat 8 Application Server
Apache Tomcat 8 Application Servermohamedmoharam
 
Apache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikApache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikEdgar Espina
 
Tomcat New Evolution
Tomcat New EvolutionTomcat New Evolution
Tomcat New EvolutionAllan Huang
 
Tomcat configuration
Tomcat configurationTomcat configuration
Tomcat configurationDima Gomaa
 
Introduction of Tomcat
Introduction of TomcatIntroduction of Tomcat
Introduction of TomcatDebashis Nath
 
Apache Traffic Server & Lua
Apache Traffic Server & LuaApache Traffic Server & Lua
Apache Traffic Server & LuaKit Chan
 
WE18_Performance_Up.ppt
WE18_Performance_Up.pptWE18_Performance_Up.ppt
WE18_Performance_Up.pptwebhostingguy
 
[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure[MathWorks] Versioning Infrastructure
[MathWorks] Versioning InfrastructurePerforce
 
Apache Manager Table of Contents
Apache Manager Table of ContentsApache Manager Table of Contents
Apache Manager Table of Contentswebhostingguy
 

What's hot (20)

Tomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance TuningTomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance Tuning
 
Apache Tomcat 8 Application Server
Apache Tomcat 8 Application ServerApache Tomcat 8 Application Server
Apache Tomcat 8 Application Server
 
Tomcat server
 Tomcat server Tomcat server
Tomcat server
 
Tomcat
TomcatTomcat
Tomcat
 
Tomcat Server
Tomcat ServerTomcat Server
Tomcat Server
 
Apache TomEE - Tomcat with a kick
Apache TomEE  - Tomcat with a kickApache TomEE  - Tomcat with a kick
Apache TomEE - Tomcat with a kick
 
Tomcat next
Tomcat nextTomcat next
Tomcat next
 
Apache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikApache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip Hanik
 
Tomcat New Evolution
Tomcat New EvolutionTomcat New Evolution
Tomcat New Evolution
 
Apache tomcat
Apache tomcatApache tomcat
Apache tomcat
 
Auxiliary : Tomcat
Auxiliary : TomcatAuxiliary : Tomcat
Auxiliary : Tomcat
 
Tomcat configuration
Tomcat configurationTomcat configuration
Tomcat configuration
 
Introduction of Tomcat
Introduction of TomcatIntroduction of Tomcat
Introduction of Tomcat
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
Apache Traffic Server & Lua
Apache Traffic Server & LuaApache Traffic Server & Lua
Apache Traffic Server & Lua
 
are available here
are available hereare available here
are available here
 
WE18_Performance_Up.ppt
WE18_Performance_Up.pptWE18_Performance_Up.ppt
WE18_Performance_Up.ppt
 
[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure
 
Apache Manager Table of Contents
Apache Manager Table of ContentsApache Manager Table of Contents
Apache Manager Table of Contents
 
Aem maintenance
Aem maintenanceAem maintenance
Aem maintenance
 

Viewers also liked

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
 
Linux Shell Scripting Craftsmanship
Linux Shell Scripting CraftsmanshipLinux Shell Scripting Craftsmanship
Linux Shell Scripting Craftsmanshipbokonen
 
Trouble shoot with linux syslog
Trouble shoot with linux syslogTrouble shoot with linux syslog
Trouble shoot with linux syslogashok191
 
UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1Nihar Ranjan Paital
 
UNIX - Class5 - Advance Shell Scripting-P2
UNIX - Class5 - Advance Shell Scripting-P2UNIX - Class5 - Advance Shell Scripting-P2
UNIX - Class5 - Advance Shell Scripting-P2Nihar Ranjan Paital
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritpingchockit88
 
Module 13 - Troubleshooting
Module 13 - TroubleshootingModule 13 - Troubleshooting
Module 13 - TroubleshootingT. J. Saotome
 
Advanced Oracle Troubleshooting
Advanced Oracle TroubleshootingAdvanced Oracle Troubleshooting
Advanced Oracle TroubleshootingHector Martinez
 
Linux troubleshooting tips
Linux troubleshooting tipsLinux troubleshooting tips
Linux troubleshooting tipsBert Van Vreckem
 
unix training | unix training videos | unix course unix online training
unix training |  unix training videos |  unix course  unix online training unix training |  unix training videos |  unix course  unix online training
unix training | unix training videos | unix course unix online training Nancy Thomas
 
Process monitoring in UNIX shell scripting
Process monitoring in UNIX shell scriptingProcess monitoring in UNIX shell scripting
Process monitoring in UNIX shell scriptingDan Morrill
 
Fusion Middleware 11g How To Part 2
Fusion Middleware 11g How To Part 2Fusion Middleware 11g How To Part 2
Fusion Middleware 11g How To Part 2Dirk Nachbar
 
Sql server troubleshooting
Sql server troubleshootingSql server troubleshooting
Sql server troubleshootingNathan Winters
 

Viewers also liked (17)

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"
 
Linux Shell Scripting Craftsmanship
Linux Shell Scripting CraftsmanshipLinux Shell Scripting Craftsmanship
Linux Shell Scripting Craftsmanship
 
Trouble shoot with linux syslog
Trouble shoot with linux syslogTrouble shoot with linux syslog
Trouble shoot with linux syslog
 
UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1
 
UNIX - Class1 - Basic Shell
UNIX - Class1 - Basic ShellUNIX - Class1 - Basic Shell
UNIX - Class1 - Basic Shell
 
Unixshellscript 100406085942-phpapp02
Unixshellscript 100406085942-phpapp02Unixshellscript 100406085942-phpapp02
Unixshellscript 100406085942-phpapp02
 
UNIX - Class5 - Advance Shell Scripting-P2
UNIX - Class5 - Advance Shell Scripting-P2UNIX - Class5 - Advance Shell Scripting-P2
UNIX - Class5 - Advance Shell Scripting-P2
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
Module 13 - Troubleshooting
Module 13 - TroubleshootingModule 13 - Troubleshooting
Module 13 - Troubleshooting
 
APACHE
APACHEAPACHE
APACHE
 
Advanced Oracle Troubleshooting
Advanced Oracle TroubleshootingAdvanced Oracle Troubleshooting
Advanced Oracle Troubleshooting
 
Linux troubleshooting tips
Linux troubleshooting tipsLinux troubleshooting tips
Linux troubleshooting tips
 
unix training | unix training videos | unix course unix online training
unix training |  unix training videos |  unix course  unix online training unix training |  unix training videos |  unix course  unix online training
unix training | unix training videos | unix course unix online training
 
Process monitoring in UNIX shell scripting
Process monitoring in UNIX shell scriptingProcess monitoring in UNIX shell scripting
Process monitoring in UNIX shell scripting
 
Fusion Middleware 11g How To Part 2
Fusion Middleware 11g How To Part 2Fusion Middleware 11g How To Part 2
Fusion Middleware 11g How To Part 2
 
Sql server troubleshooting
Sql server troubleshootingSql server troubleshooting
Sql server troubleshooting
 
Tomcat next
Tomcat nextTomcat next
Tomcat next
 

Similar to 25 Apache Performance Tips

Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with NginxBud Siddhisena
 
Performance and Scalability
Performance and ScalabilityPerformance and Scalability
Performance and ScalabilityMediacurrent
 
AEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser CachingAEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser CachingAndrew Khoury
 
High Performance Web Sites
High Performance Web SitesHigh Performance Web Sites
High Performance Web SitesRavi Raj
 
Aegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовAegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовDrupalCamp Kyiv Рысь
 
Make WordPress Fly With Virtual Server Hosting - WordCamp Sydney 2014
Make WordPress Fly With Virtual Server Hosting  - WordCamp Sydney 2014Make WordPress Fly With Virtual Server Hosting  - WordCamp Sydney 2014
Make WordPress Fly With Virtual Server Hosting - WordCamp Sydney 2014Vlad Lasky
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cacheMarc Cortinas Val
 
50-Tips-for-Boosting-MySQL-Performance-CON2655.pdf
50-Tips-for-Boosting-MySQL-Performance-CON2655.pdf50-Tips-for-Boosting-MySQL-Performance-CON2655.pdf
50-Tips-for-Boosting-MySQL-Performance-CON2655.pdfAsparuhPolyovski2
 
PHP Performance tuning for Drupal 8
PHP Performance tuning for Drupal 8PHP Performance tuning for Drupal 8
PHP Performance tuning for Drupal 8Acquia
 
Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Chris Tankersley
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!WordCamp Cape Town
 
Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)Timur Kamanin
 
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...WordCamp Harare
 
WordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = SuccessWordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = SuccessAnthony Somerset
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best PracticesRatnesh kumar, CSM
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSCloudLinux
 
wordpress-performance-presentation
wordpress-performance-presentationwordpress-performance-presentation
wordpress-performance-presentationArun Janarthanan
 
Apache Street Smarts Presentation (SANS 99)
Apache Street Smarts Presentation (SANS 99)Apache Street Smarts Presentation (SANS 99)
Apache Street Smarts Presentation (SANS 99)Michael Dobe, Ph.D.
 

Similar to 25 Apache Performance Tips (20)

Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with Nginx
 
Performance and Scalability
Performance and ScalabilityPerformance and Scalability
Performance and Scalability
 
AEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser CachingAEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser Caching
 
High Performance Web Sites
High Performance Web SitesHigh Performance Web Sites
High Performance Web Sites
 
Aegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовAegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтов
 
Aegir presentation
Aegir presentation Aegir presentation
Aegir presentation
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
Make WordPress Fly With Virtual Server Hosting - WordCamp Sydney 2014
Make WordPress Fly With Virtual Server Hosting  - WordCamp Sydney 2014Make WordPress Fly With Virtual Server Hosting  - WordCamp Sydney 2014
Make WordPress Fly With Virtual Server Hosting - WordCamp Sydney 2014
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cache
 
50-Tips-for-Boosting-MySQL-Performance-CON2655.pdf
50-Tips-for-Boosting-MySQL-Performance-CON2655.pdf50-Tips-for-Boosting-MySQL-Performance-CON2655.pdf
50-Tips-for-Boosting-MySQL-Performance-CON2655.pdf
 
PHP Performance tuning for Drupal 8
PHP Performance tuning for Drupal 8PHP Performance tuning for Drupal 8
PHP Performance tuning for Drupal 8
 
Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
 
Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)
 
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
 
WordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = SuccessWordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = Success
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best Practices
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
 
wordpress-performance-presentation
wordpress-performance-presentationwordpress-performance-presentation
wordpress-performance-presentation
 
Apache Street Smarts Presentation (SANS 99)
Apache Street Smarts Presentation (SANS 99)Apache Street Smarts Presentation (SANS 99)
Apache Street Smarts Presentation (SANS 99)
 

Recently uploaded

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Recently uploaded (20)

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

25 Apache Performance Tips

  • 1. 25 Apache Performance Tips www.monitis.com
  • 2. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 1. Remove unused modules Save memory by not loading modules that aren’t needed, including (but not limited to)… … mod_php, … mod_ruby, … mod_perl, etc.
  • 3. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 2. Use mod_disk_cache and NOT mod_mem_cache Mod_mem_cachewill not share its cache amongst different apache processes, which results in high memory usage with little performance gain. On an active server mod_mem_cache will rarely serve the same page twice in the same Apache process.
  • 4. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 3. Configure mod_disk_cache with a flat hierarchy Make sure you are using CacheDirLength=2and CacheDirLevels=1to ensure htcachecleanwill not take forever when cleaning up your cache directory.
  • 5. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 4. Setup appropriate Expires, Etag, and Chache-Control headers In order to utilize your cache you have to specify when a file expires, otherwise your client will not experience the caching benefits.
  • 6. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 5. Put the cache on a separate disk Move your cache to a separate physical disk for the fastest access without slowing down other processes.
  • 7. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 6. Use piped logging instead of direct logging Directly logging to a file results in issues when rotating the log file. A restart will be necessary to use the next log file. This causes significant slowness for you users during the restart. Particularly if you are using Passenger or some other app loader.
  • 8. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 7. Log to a different disk than the disk serving pages Put your logs on physically different disks than the files you are serving.
  • 9. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 8. Utilize mod_gzip/mod_deflate Gzip your content before sending it off. The client will ungzip upon receipt which will minimize the size of file transfers. Also, it will generally improve the user experience.
  • 10. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 9. Turn off HostnameLookups Stop doing effortful DNS lookups. You will rarely ever need them and when you do, you can always look them up when really needed.
  • 11. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 10. Avoid using hostname in configs If HostnameLookups are turned off, it will keep you from waiting for the DNS resolving the hostnames in your configs. Instead, use IP addresses.
  • 12. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 11. Use persistent connections Set KeepAlive, KeepAliveTimeout and KeepAliveRequests. KeepAliveTimeout defines how long Apache will wait for the next request, and KeepAliveRequests defines the maximum number of requests for a client prior to resetting the connection. This will prevent the client from having to reconnect between each request.
  • 13. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 12. Do not set KeepAliveTimeout too high If you have more requests than Apache children, settings which are set too high could exhaust your pool of available clients.
  • 14. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 13. Disable .htaccess I.e. AllowOverride None. This will keep Apache from checking for an .htaccess file upon each request.
  • 15. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 14. Allow symlinks I.e. Options + FoolowSymLinks – SymLinksIfOwnerMatch. Otherwise, Apache will make a separate call on each filename to ensure it is not a symlink.
  • 16. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 15. Set ExtendStatus off Although very useful, the ExtendStatus will produce several system calls for each request to gather statistics. It‘s better to only define a certain time frame in order to benchmark and keep it turned off the remainder of the time.
  • 17. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 16. Avoid Wildcards in DirectoryIndex Use a specific DirectoryIndex, i.e. index.html or index.php, not index.
  • 18. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 17. Increase Swappiness Particularly on single site hosts this will increase the performance. On Linux systems increase /proc/sys/vm/swappiness to at least 60 if not higher. This will result in loading as many files as possible into the memory cache for a quicker access.
  • 19. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 18. Increase Write Buffer Size Increase your write buffer size for TCP/IP buffers. On Linux systems increase /proc/sys/net/core/wmem_max and /proc/sys/net/core/wmem_default. If your pages fit within this buffer, Apache will complete a process in just one call to the TCP/IP buffer.
  • 20. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 19. Increase Max Open Files If you are handling high loads, increase the number of allowed open files. On Linux increase /proc/sys/fs/file-max and run ulimit –H –n 4096.
  • 21. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 20. Setup a frontend proxy for images and stylesheets Allow your main web servers to process the application while images and stylesheets are served from frontend webservers.
  • 22. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 21. Use mod_passenger for rails Mod_passenger is able to share memory and resources amongst several processes, allowing for faster spawning of new application instances. It will also monitor these processes and remove them when they become unncessary.
  • 23. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 23. Don‘t use threaded mpm with mod_php Look at using mod_itk, mod_php tends to segfault with threaded mpm.
  • 24. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 24. Flush buffers early for pre- render It takes a relatively long time to create a webpage on the backend. Flush your buffer prior to page completion to send a partial page to the client, so it can start rendering. A good place to do this is right after the HEAD section – so that the browser can start fetching other objects.
  • 25. 25 Apache Performance Tuning Tipswww.monitis.com Uptime & Device Monitoring 25. Use a cache for frequently accessed data Memcached is a great for frequently used data and sessions. It will speed up your Apache render time as databases are slow.
  • 26. facebook.com/Monitis.Monitoring @Monitis The All-in-One Monitoring Solution Start your free 15-day trial for free! www.monitis.com