Apache Performance Tuning on Linux

  • In CentOS or Fedora, run: httpd -V
  • On Debian or Ubuntu, run: apache2 -v
  • On CentOS or Fedora: /etc/httpd/conf/httpd.conf
  • On Debian or Ubuntu: /etc/apache2/apache2.conf

Types of MPMs

MPM Prefork

MPM Worker

MPM Event

MPM Values

StartServers

MinSpareServers

MaxSpareServers

MaxConnectionsPerChild

ThreadsPerChild

MaxRequestWorkers

top

ServerLimit

What Is the Default MPM Settings?

For Prefork Module

StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 250 // MaxRequestWorkers
MaxRequestsPerChild 0 // MaxConnectionsPerChild

For Worker or Event Module

StartServers 3
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxClients 400 // MaxRequestWorkers
MaxRequestsPerChild 0 // MaxConnectionsPerChild
<IfModule MODULE_NAME>
StartServers 4
MinSpareServers 20
MaxSpareServers 40
MaxClients 200
MaxRequestsPerChild 4000
</IfModule>

Other Settings That May Affect MPM

KeepAlive

KeepAlive On

MaxKeepAliveRequests

MaxKeepAliveRequests 500

Tools That Would Help You

Apache2Buddy

curl -sL https://raw.githubusercontent.com/richardforth/apache2buddy/master/apache2buddy.pl | perl

ApacheBench Tool (ab)

ab -k -n 1000 -c 10 "http://yoursite.com/test"
top
  • On CentOS/Fedora:
  • sudo systemctl restart httpd
  • On Debian/Ubuntu:
  • sudo systemctl restart apache2

References and Useful Links

Original Source

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Android Short Insights: Android and App Basics.

Autodesk Maya 2013 Free Download For Mac

Response to “What is Web 2.0”

SSL Certificate Authority for Docker and Traefik

Newsletter #9

15-Day Writing Challenge

Protein Music with Python (Part 3)- Applying a Recursive Neural Net

Suspend what you’re doing: Retrofit has now Coroutines support!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

CMAN-TDM — An Oracle Database connection proxy for scalable and highly available applications

Apache Kafka Guide

How to setup and launch Kafka Connect/Connector

Getting Started with TiDB Cloud Using Java