{"id":685,"date":"2016-10-09T19:07:33","date_gmt":"2016-10-09T16:07:33","guid":{"rendered":"https:\/\/community.virtono.com\/?p=685"},"modified":"2023-06-21T10:25:56","modified_gmt":"2023-06-21T07:25:56","slug":"10-apache-performance-tips","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/knowledgebase\/10-apache-performance-tips\/","title":{"rendered":"10 Apache Performance Tips"},"content":{"rendered":"<p>To get an in-depth knowledge on Apache Web Server, please visit, <a href=\"https:\/\/virtono.com\/community\/news-announcements\/apache-web-server\/\" target=\"_blank\" rel=\"noopener\">this<\/a>.<\/p>\n<p>But if you are looking for fast efficient ways to increase your Apache Server&#8217;s performance, just follow the steps below, they are fast, small and they work like a charm.<\/p>\n<p><strong>1. Put the cache on a separate disk<\/strong><br \/>\nMove your cache to a separate physical disk for the fastest access without slowing down other processes.<\/p>\n<p><strong>2.Disable .htaccess<\/strong><br \/>\nI.e. AllowOverride None. This will keep Apache from checking for an .htaccess file upon each request.<\/p>\n<p><strong>3.Increase Write Buffer Size<\/strong><br \/>\nIncrease 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.<\/p>\n<p><strong>4. Don\u2018t use threaded mpm with mod_php<\/strong><br \/>\nLook at using mod_itk, mod_php tends to segfault with threaded mpm.<\/p>\n<p><strong>5. Log to a different disk than the disk serving pages<\/strong><br \/>\nPut your logs on physically different disks than the files you are serving.<\/p>\n<p><strong>6. Setup appropriate Expires, Etag, and Chache-Control headers<\/strong><br \/>\nIn order to utilize your cache you have to specify when a file expires, otherwise your client will not experience the caching benefits.<\/p>\n<p><strong>7. Remove unused modules<\/strong><br \/>\nSave memory by not loading modules that aren\u2019t needed, including (but not limited to)\u2026<br \/>\n\u2026 mod_php,<br \/>\n\u2026 mod_ruby,<br \/>\n\u2026 mod_perl<\/p>\n<p><strong>8. Setup appropriate Expires, Etag, and Chache-Control headers<\/strong><br \/>\nIn order to utilize your cache you have to specify when a file expires, otherwise your client will not experience the caching benefits.<\/p>\n<p><strong>9. Turn off HostnameLookups<\/strong><br \/>\nStop doing effortful DNS lookups. You will rarely ever need them and when you do, you can always look them up when really needed.<\/p>\n<p><strong>10.Do not set KeepAliveTimeout too high<\/strong><br \/>\nIf you have more requests than Apache children, settings which are set too high could exhaust your pool of available clients.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To get an in-depth knowledge on Apache Web Server, please visit, this. But if you are looking for fast efficient ways to increase your Apache Server&#8217;s performance, just follow the steps below, they are fast, small and they work like a charm. 1. Put the cache on a separate disk<\/p>\n","protected":false},"author":3,"featured_media":686,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[5],"tags":[],"class_list":["post-685","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/10\/asf_logo.png?fit=429%2C175&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-b3","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1293,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/fix-apache-internal-server-error-due-to-htaccess-bad-flag-delimiter\/","url_meta":{"origin":685,"position":0},"title":"Fix Apache Internal Server Error due to htaccess bad flag delimiter","author":"Daniel Draga","date":"January 6, 2018","format":false,"excerpt":"The Apache web server has several causes that cause an\u00a0internal server error\u00a0.\u00a0One possible cause is erroneous entries in an htaccess file, for example due to incorrectly defined forwarding.\u00a0In this article we describe how you can narrow down the problem and fix the cause. error message Internal Server Error Your Apache\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2018\/01\/hqdefault.jpg?fit=480%2C360&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":517,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/install-nginx-stack-on-centos\/","url_meta":{"origin":685,"position":1},"title":"INSTALL NGINX STACK ON CENTOS","author":"Daniel Draga","date":"August 25, 2016","format":false,"excerpt":"What is Nginx?\u00a0Nginx is a better free alternative to Apache because its lightweight and RAM-friendly. It can perform better and faster than Apache, particularly when the\u00a0number\u00a0of concurrent site visitors is on the rise. The only downside of Nginx is that not many users familiar with Nginx because it has different\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"1","src":"https:\/\/i0.wp.com\/community.virtono.com\/wp-content\/uploads\/2016\/08\/1-10-300x44.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":688,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/setting-up-security-on-apache\/","url_meta":{"origin":685,"position":2},"title":"Setting Up Security on Apache","author":"Daniel Draga","date":"October 9, 2016","format":false,"excerpt":"To get an in-depth knowledge on Apache Web Server, please visit, this. However if you've already begun working with Apache and know about it, and are only concerned with securing your server, here are a few tricks that will help you out, read them and use them carefully. Protecting the\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3300,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/install-varnish-cache-for-apache-on-centos\/","url_meta":{"origin":685,"position":3},"title":"Install Varnish Cache for Apache on CentOS","author":"George B.","date":"April 23, 2023","format":false,"excerpt":"Varnish Cache is a popular caching solution that can be used to speed up the delivery of content on your web server. It works by caching frequently accessed content in memory so that subsequent requests can be served from the cache instead of being processed by the web server. In\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Install-Varnish-Cache-for-Apache-on-CentOS.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Install-Varnish-Cache-for-Apache-on-CentOS.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Install-Varnish-Cache-for-Apache-on-CentOS.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3407,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-kafka-on-ubuntu-22-04\/","url_meta":{"origin":685,"position":4},"title":"How to Install Apache Kafka on Ubuntu 22.04","author":"George B.","date":"May 27, 2023","format":false,"excerpt":"In this tutorial, we will walk you through the step-by-step process of installing Apache Kafka on Ubuntu 22.04, enabling you to leverage its powerful features for your data streaming needs. Apache Kafka is an open-source distributed event streaming platform that allows you to build real-time data pipelines and streaming applications.\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-Apache-Kafka-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-Apache-Kafka-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-Apache-Kafka-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":1296,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/arm-apache-for-denial-of-service-attacks\/","url_meta":{"origin":685,"position":5},"title":"Arm Apache for denial-of-service attacks","author":"Daniel Draga","date":"January 7, 2018","format":false,"excerpt":"A little thought experiment: You want to write a web server, so program a socket-based server.\u00a0When a browser connects to it and requests a file, it delivers it, the client terminates the connection, and everyone is satisfied.\u00a0But then suddenly there is a bug report from someone whose web server is\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2018\/01\/ddos-attack-ex-100695385-large.jpg?fit=699%2C474&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2018\/01\/ddos-attack-ex-100695385-large.jpg?fit=699%2C474&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2018\/01\/ddos-attack-ex-100695385-large.jpg?fit=699%2C474&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=685"}],"version-history":[{"count":2,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/685\/revisions"}],"predecessor-version":[{"id":3574,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/685\/revisions\/3574"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/686"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}