Techolac - Computer Technology News
  • Home
  • Internet
  • Business
  • Computers
  • Gadgets
  • Lifestyle
  • Phones
  • Travel
  • Tech
  • More
    • Automotive
    • Education
    • Entertainment
    • Health
    • SEO
    • Linux
    • WordPress
    • Home Improvement
    • How to
    • Games
No Result
View All Result
  • Home
  • Internet
  • Business
  • Computers
  • Gadgets
  • Lifestyle
  • Phones
  • Travel
  • Tech
  • More
    • Automotive
    • Education
    • Entertainment
    • Health
    • SEO
    • Linux
    • WordPress
    • Home Improvement
    • How to
    • Games
No Result
View All Result
Techolac - Computer Technology News
No Result
View All Result
Home Linux

How to Optimize Apache, MySQL Performance for 1GB RAM VPS Centos/RHEL

by Editorial Staff
April 7, 2024
in Linux
Reading Time: 2 mins read
Apache, MySQL Performance

How to Optimize Apache, MySQL Performance for 1GB RAM VPS Centos/RHEL in this article we guide u how to optimize Apache, php and MySQL/Mariadb server which are installed on VPS server with 1gb of RAM, Such 1 gb ram vps is enough powerful for single application and optimizations are necessary in order to Avoid OOM (out of memory) and take juice from it.

Table of Contents
Optimization of Apache :
Centos/RHEL:
Ubuntu :
Optimization of MYSQL :

Optimization of Apache :

Optimize Apache which is installed on 1gb VPS, it recommended to use Apache MPM worker as prefork :-

Centos/RHEL:

Under Centos Open this file in editor:

nano /etc/httpd/httpd.conf

And add this configs at the end of httpd.conf :

KeepAlive Off
<IfModule prefork.c>
   StartServers        6
   MinSpareServers     5
   MaxSpareServers     15
   ServerLimit         256
   MaxClients          256
   MaxRequestsPerChild 3000
</IfModule>

Then restart Apache server :

service httpd restart

Ubuntu :

Under Ubuntu Open this file in editor:

nano /etc/apache2/apache2.conf

Find and add/change this configs under apache2.conf file :

<IfModule mpm_prefork_module>
 StartServers        3
 MinSpareServers     5
 MaxSpareServers     15
 ServerLimit         256
 MaxClients          256
 MaxRequestsPerChild 3000
</IfModule>

Then restart Apache server :

service apache2 restart

Optimization of MYSQL :

To optimize MySQL/Mariadb which is installed on 1gb VPS you need to add  this configs in  my.cnf under [mysqld] :

[mysqld]
symbolic-links=0
skip-external-locking
key_buffer_size = 32K
max_allowed_packet = 4M
table_open_cache = 8
sort_buffer_size = 128K
read_buffer_size = 512K
read_rnd_buffer_size = 512K
net_buffer_length = 4K
thread_stack = 480K
innodb_file_per_table
max_connections=100
max_user_connections=50
wait_timeout=50
interactive_timeout=50
long_query_time=5

On Centos/RHEL based system you can add it in :

/etc/my.cnf

On Ubuntu/Debian based system you can add it in :

/etc/mysql/my.cnf 
  • Also consider adding SWAP to your VPS which will drastically stabalizes the 1 gb VPS : Create and Add Swap On Linux OS CWP Centos WebPanel and VestaCP
  • To optimize PHP just installed php-opcache and memcached (memcached need to be supported by script)
  • Configure PHP memory limit not more than 128 mb.
  • Use cache system which is provided by your script or for WordPress use WP super cache.

 

Related Posts

Top 5 MySQL Performance Tuning Tips

Top 5 MySQL Performance Tuning Tips

January 25, 2023
Top Commands to Check the Running Processes in Linux

Top Commands to Check the Running Processes in Linux

May 27, 2022

4 Tips to Prevent and Troubleshoot the ImagePullBackOff Kubernetes Error

March 30, 2022

How Common Signals are Used in Kubernetes Pod Management

November 20, 2021

How to Transfer Windows 10 to SSD?

April 14, 2022

Understand Doubly Linked List C++ With Illustration

February 26, 2021

Leave a Reply Cancel reply

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

Recent Articles

  • Top 15 Best Payroo Alternatives In 2024
  • 15 Best Affiliate Marketing Websites In 2024
  • Top 10 Best Anti Spam Software Tools for 2024
  • 12 Best Spy Competitors Tools In 2024
  • Top 10 HOA and Condo Management Software for 2024
  • 30 Divicast Alternatives To Watch Movies And TV Shows Online
  • Discover the Latest Natural Treatments for Multiple Sclerosis in 2024

Related Posts

None found

  • DashTech
  • TechDaddy
  • Terms and Conditions
  • Disclaimer
  • Write for us

© Techolac © Copyright 2019 - 2022, All Rights Reserved.

No Result
View All Result
  • Home
  • Internet
  • Business
  • Computers
  • Gadgets
  • Lifestyle
  • Phones
  • Travel
  • Tech
  • More
    • Automotive
    • Education
    • Entertainment
    • Health
    • SEO
    • Linux
    • WordPress
    • Home Improvement
    • How to
    • Games

© Techolac © Copyright 2019 - 2022, All Rights Reserved.