How to reduce the consumption of CPU and RAM?

Cheerag Nundlall

Well-known member
Registered
Joined
Oct 12, 2016
Messages
336
Points
18
I have a small VPS and it didn't have more RAM and just 1 CPU core, which ways to optimize that reduce the consumption of my CPU and RAM?
 

Maxoq

Well-known member
Registered
Joined
Feb 25, 2015
Messages
520
Points
28
To reduce the consumption of the CPU as well as RAM, You need some techniques come & play, since in all cases there are dynamic processes that need a high processing capacity and we must try to reduce them.

Here are some techniques to reduce RAM and CPU usage that you should follow:

Always updated
Updates are always made to improve performance and therefore performance better. Therefore, it is advisable to update all the elements when you can do so.

What elements are we referring to? To the own version of the CMS (WordPress, Joomla, PrestaShop...), PHP version, MySQL, plugins, themes of the site and other applications that you use in your website.

Database
In many occasions databases are generated with the installation of a plugin or themes for our site, the problem is when these databases become obsolete because you have already changed the theme or you no longer use according to what plugins.

Because of this, it is advisable to eliminate the database tables that you know do not really serve us at all, and also review the ones you have to try to optimize them.

Search
The majority of RAM and CPU consumptions are of dynamic elements. The idea is to convert all the possible elements to static elements, in this way you reduce the consumption of RAM and CPU.

To perform the frisk, I recommend using the WordPress Super Cache plugin.

This should be done if you have enough space on our disk, since changing from dynamic to static, you increase disk consumption.

Content Delivery Network (CDN)
A Content Delivery Network is a set of servers spread around the world, where copies of websites are located. Its use is recommended as it improves the loading time of your website from anywhere in the world.

Every time you have visitors on your website from anywhere in the world, static elements, CSS, images or videos are served from the CDN servers (where there are copies of your website), saving consumption of your server where the server is hosted. Web.

Then using a CDN, we gain load time improving the user experience, and at the same time, you optimize the resources of your hosting.

Minimized code
Minimizing the code of all the pages of your site we will achieve a saving of load and consumption of your hosting every time you have requested.

Minimize the code is to eliminate spaces or blank lines, remove elements of the code that do not work etc.

One way to do it almost automatically is with plugins.

Control yourself with the Plugins
Check the plugins you have installed and install, and stay with the ones you use. Plugins consume many resources, so do not lose all your resources due to the improper use of plugins.

I do not say that you do not use them, but download and activate those that you need, yes or yes.

Some plugins perform checks, these are not always necessary, but if you have patience and you are constant, you can deactivate them and activate them once or twice a week so that they can carry out their checks and correct the errors.

Blocking of mailing
In the case of having a contact form, in many cases spam is received, in the case of receiving many messages, server resources are consumed.

One way to end this is to implement a captcha in our form to avoid bots and spam messages.
 

Hostsane

New member
Registered
Joined
Nov 24, 2018
Messages
9
Points
3
I have a small VPS and it didn't have more RAM and just 1 CPU core, which ways to optimize that reduce the consumption of my CPU and RAM?
Can you share the VPS configuration you have , any control panel installed ? and what is hosted
 

manoaratefy

Well-known member
Hosting Provider
Registered
Joined
Sep 15, 2016
Messages
127
Points
18
Good morning,

I'm currently hosting 13 WordPress websites and 75 emails accounts on a 2GB KVM VPS. Everything is fluent. So, how I did it?

Using ISPConfig as control panel
ISPConfig is a lightweight control panel, compared to cPanel and Webmin. It doesn't have any daemon. To perform server configuration changes, ISPConfig use a cron job which run each minute. So, memory usage is nearly like if we were not using any control panel.

Killing spamassassin
I use spamassassin as antispam. However, I don't run spamassassin daemon. To prevent spam, I load spamassassin libraries on amavisd.

Using PHP-FPM as PHP integration over Apache
Mod-PHP and FastCGI doesn't have a good memory consumption/performance ratio. PHP-FPM is lightweight and is fast.

Use a lot of cache
I use NGINX are reverse proxy to serve static files, and all my websites have WP Super Cache.

Note: a fresh installation of ISPConfig use ~800 MB RAM. Now, I'm using ~1,6 GB with this configuration and these websites.

Hope these points would help you.
 
Older Threads
Replies
10
Views
2,580
Replies
6
Views
1,612
Replies
2
Views
1,604
Newer Threads
Replies
6
Views
2,140
Replies
15
Views
4,469
Replies
13
Views
10,739
fwh
Replies
19
Views
5,756
Latest Threads
Replies
0
Views
123
Replies
1
Views
79
Recommended Threads
Replies
2
Views
1,124
Replies
8
Views
3,041
Replies
1
Views
1,764

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top