VestaCP,  Linux

How to Optimize Apache, PHP and MySQL Performance for 1GB RAM VPS

There are lots of requests from the visitors especially from David T. upon 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.

Optimization of Apache :

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


Under Centos Open this file in editor:

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

Then restart Apache server :

Ubuntu :

Under Ubuntu Open this file in editor:

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

Then restart Apache server :

Optimization of MYSQL :

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

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

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

  • Also consider adding SWAP to your VPS which will drastically stabalizes the 1 gb VPS
  • 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.

Tui là jamesblackvn!

Gửi phản hồi

Website này sử dụng Akismet để hạn chế spam. Tìm hiểu bình luận của bạn được duyệt như thế nào.