5 Tips to Boost the Performance of Your Apache Web Server

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Hosting referral link if you planning to start your blog ($3.82/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gabriel Cánepa

Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

18 Responses

  1. Ivan says:

    I completely disagree with some tips:

    #1. Why do you have to compile Apache?, that’s a dumb idea in a production environment. Even if you do that you need to optimize your binary at the same level as the distro mantainers.

    #2. Hey: are you SERIOUS? RHEL/CentOS 4.x, and Debian 4 ALREADY have kernel >2.4 those are distros 11-12 years old!!! Excuse me what are you running in 2.4 your wrt54g?

    #3 Fine but bad explained, the main reason which prefork exists is backwards compatibility not debug, period.

    • Gabriel A. Cánepa says:

      Believe it or not, there are people using really, really old distros. If tip #2 (or any of the tips listed in this article) does not apply to you, don’t just assume it’s not gonna be useful for other people.

  2. Tim says:

    I’m sorry, I think #1 is very bad advice. There’s absolutely no reason to forgo the distribution’s apache security updates (which are fairly frequent) and make a mess of your servers by compiling software on them. It’s 2017 and I cannot believe there are still people who “make; make install” on servers. Barbaric.

    • Gabriel A. Cánepa says:

      Tim,
      Why then, in your opinion, does the Apache website include a section dedicated to compiling and installing from source?

    • trash.80 says:

      I have a dedicated Jenkins build that automatically downloads all the parts, including OpenSSL and FIPS, complies them all, then uploads to our repository, that we then put on our servers, thus servers are clean.

      The script I wrote do do all this cleans up afterwards, so the build server is just as clean after the build as it was before.

  3. Paulson says:

    Thank you Gabriel, It was such a useful tip…

  4. olivedev says:

    Apart from configuring Apache, there are other ways of boosting performance of your PHP based websites. I have hosted my PHP website on AWS through Cloudways. Their platform is using Apache, Varnish, Memcached, Nginx and MySQL stack with Cloudflare. When I upgrade my website to PHP 7 the benchmarks were 4ms response time with 250 concurrent users.

    • Gabriel A. Cánepa says:

      @olivedev,
      Thanks for your insightful comment. We usually write these tutorials on VirtualBox VMs, and thus unfortunately we don’t have the same resources you are referring to. However, it’s great to know in case our readers are considering using the same services.

  5. Davi says:

    MPM Configuration depend upon your server confirguration and application run over the apache. For basic tuning you may refer http://www.techflirt.com/apache-performance-tuning

  6. Yaroslav P says:

    Hi Gabriel,
    I’m running CentOS 7 and Apache 2.4.6 with event MPM. Not PHP.
    Visitors can distribute certian files, both upload and download. However, while the download speed is quite good, the upload speed is horrible low, just 64-240 kb/s. Downloadspeed is about 2 mb/s. Do you think this is an Apache issue?

    • @Yaroslav,
      At first glance I would say no, it is not an Apache issue, as there are other considerations to be taken into account. Is this a production server? Do your clients have the same upload speeds when checking their Internet connections against a service such as speedtest.net (assuming this server is facing the Internet)? You mentioned a upload speed range (64-240kb/s). Is this an average for all users? Any time of day?

  7. rob says:

    this kills PHP on Apache 2.4.6

    standard prefork – fine
    worker or event – PHP does not work.

    • @rob,
      You forgot to tell us which distro you are using. Note there is a warning in the article for Debian and Debian-based distros. It DOES work on CentOS 7. I know that for a fact since that’s the distro I used to write the article.

  8. Yoander says:

    This another ones:

    – Disable non use shared modules

    – Do not use .htaccess

    – Set HostnameLookups = Off

  9. Kay says:

    Yes, very useful, learned a few new things. Thanks!

  10. Fábio says:

    Very useful tips, thank you Gabriel!

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 202,035
  2. 9,267
  3. 38,621

Are you subscribed?