School
...
VPS server optimization

VPS server optimization

Anna Belous
Anna Belous
Hosting Expert(work experience 11 years)
1316
5 minute

You can find general information about VPS servers in this article. This article is dedicated to VPS setup that allows to improve the performance of one or several websites hosted on it.

Server software optimization

Depending on the software pre-installed on the server by your hosting provider, you might need to install and configure some of it while simply reconfiguring the other.

What should be installed on a VPS?

NGINX

Apache+NGINX bundle is very efficient since these web-servers assist each other in processing the website queries. NGINX handles static files thereby decreasing the server load (those queries won’t reach Apache).

PHP accelerator

While usually your PHP code is compiled and executed at runtime, a PHP accelerator caches the bytecode in advance, hence saves CPU resources at the expense of increased memory usage.

Out of several accelerators offered, we advise Opcache since it’s recommended by the PHP community.

PageSpeed module

Though this module doesn’t drastically decrease the server load and its setup requires some effort, we do advise installing it.

PageSpeed by Google speeds up the process of returning the data to users, hence increases page speed.

Memcache/Memcached

Memcached service caches database queries in the server’s RAM instead of the hard drive, decreasing the server load. You need to check the process statistics to decide what process should be cached: database queries or scripts.

Server service configuration

Your hosting provider might provide you with either a server with minimal OS installed or a ‘ready-to-go’ one with a pre-installed software package. A ready-to-go server might have a list of services launched that you will never use or even know that they’re running.

Check which of the launched ones you really need and turn off the ones you don’t.

This will free server resources that can be used by services you need.

We strongly recommend to first and foremost consult with an experienced developer or server administrator to avoid turning off a service that is needed for the website to run smoothly.

PHP

We advise switching PHP to FastCGI mode or using PHP-FPM bundle. This significantly reduces the server load ensuring its stable operation.

Alternative way to configure a server

This method is suitable for experienced developers only. Instead of using Apache that is resource demanding and slow, it is possible to use NGINX+PHP-FPM bundle.

Please mind that some CMS documentation does not contain instructions on NGINX+PHP-FPM setup.

Since you intend to purchase a VPS, we assume that you have the necessary skills in managing it or hire a developer who will be managing your VPS. Hence, we will not provide step-by-step instructions on this kind of setup in this article.

If you know ways to optimize a VPS that were not described in this article, please leave a comment below and we will gladly add those to the article.

Feel free to ask any related questions in the feedback section below and our experts will reply as soon as possible.

No answer to your question?

Ask your question and get an answer from an expert, our technical support employee, to your email

Our experts

our expert Nickola Naous
Nickola Naous
our expert Oliver Salo
Oliver Salo
our expert László Kovács
László Kovács
our expert Maxim Malacili
Maxim Malacili
our expert Oleh Kharitinov
Oleh Kharitinov
our expert Pavan Nikam
Pavan Nikam
our expert Md Billal Hossain Sarker
Md Billal Hossain Sarker
our expert Zion Owelle
Zion Owelle
our expert Banko Stoyanov
Banko Stoyanov

37 of experts ready to help you make the right choice

Hosting Provider Ratings by Categories