Apache2 high RAM usage resolution

In this post i will describe how to decrease memory usage of apache2, i tried to search on google and found many solution to that problem but nothing worked for me. So i discovered a way to decrease the memory usage of apache2.



Here is the solution:

  • Login to your server via putty / shell terminal with root access.
  • Execute following command:
# cd /etc/apache2
# nano apache2.conf
  • A text editor will appear with apache2 configuration file find the below line in it:
KeepAlive On
  • Replace this line with:
KeepAlive Off
  • Press CTRL+O to and then press [Enter] to save the changes. now run the following command:
# /etc/init.d/httpd restart
# /etc/init.d/apache2 restart
# service apache2 restart
# service httpd restart
  • This will restart your apache2 server and now the RAM usage will decrease to 50% guaranteed.

For cPanel/WHM:

You can do the above configurations from your WHM/cPanel interface if you are running WHM/cPanel on your server. Follow the below steps:

  • Login to your WHM/cPanel with root username and password.
  • In the left panel under Service Configurations find Apache Configurations click on the link.
  • The new window will appear click on first option Global Configuration
  • Now find the option KeepAlive on that page and turn it to off, and then save the settings.
  • On the next page you will be asked to Rebuild Configurations and restart Apache Just press that button and you are done.
Feedback will be appreciated 🙂

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>