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.