Linux server if insufficient CPU or RAM, how to run Docker + Jenkins + npm?

Jerry Chen
1 min readSep 26, 2022

--

Let’s talk about the conclusion first. These services can be run by adjusting the frequency of swap swapping physical memory.

The situation is that it is difficult for a server with 1 CPU Core / 1 GB RAM to run Docker, Jenkins and npm at the same time. The difficulty is that the physical memory is not enough to support the memory required by the above services. What should I do without upgrading the host hardware?

In fact, it can be solved by adjusting the swap frequency of `vm.swappiness`. When the physical memory is not enough to support the service, it can be replaced by swap. The higher the `vm.swappiness` number, the higher the swap frequency. Of course, if your server has enough physical memory, then swap frequency can be reduced.

# /etc/sysctl.conf
vm.swappiness 60

After changing the parameters, it needs to be restarted or take effect immediately through the command.

# Effective immediately
/sbin/sysctl -p

--

--

Jerry Chen
Jerry Chen

No responses yet