Will adding more ram decrease CPU use

central-processing-unitmemoryweb

I had a virtual server with 2GB ram and average use was always under 1GB of ram, so I got a new one for exact same purpose and I only got 1GB of ram. But it seems to me that it uses more CPU now.

Having less ram means it will use more CPU? Even if average ram use is not used at 100% ?

// it is a web server with Plesk panel

Best Answer

The answer is not so straight-forward but essentially - Yes.

By having less RAM, you will typically force the system to use more virtual memory on the HDD. This results in the CPU having to do a bit more work e.g. moving data between RAM and HDD and tweaking page tables, particularly when there is a context switch. Therefore, there is less CPU time available to the applications.

That is why, if you had a choice to spend the same money to either double your RAM or increase your CPU speed by 5%-10%, it is usually better to spend it on doubling your RAM.

Related Topic