Hello, in this tutorial, you will learn how to increase the memory of your VPS (Linux virtual machine) or your WordPress site. You can add a swap file for VM instance to increase memory. If you want to know to get free VPS, check the VPS and Mining Playlist of the channel.
Open the terminal of your VPS or WordPress VM instances using an SSH connection.
To see available Memory and swap file size, use this command. You can see there is no swap file.
free -m
Create a swap file and allocate space. I’ve used 1024 MB but you can take more.
sudo dd if=/dev/zero of=/mnt/swap.0 bs=1024 count=1048576
Next use this line to mount it.
sudo mkswap /mnt/swap.0
Switch to root account to activate the swap.
sudo su
Use this to activate it.
echo "/mnt/swap.0 swap swap defaults 0 0" >> /etc/fstab
Next use this command.
swapon /mnt/swap.0
check if it’s created successfully.
sudo swapon -s
Check again the created main and swap size for memory. The swap file is created successfully.
free -m
If you want to know how to remove added swap virtual memory, check this article below.
[…] see available Memory and swap file size, use this command. You can see there is no swap […]
[…] I check the memory using this command to make sure, it has a swap file. Because WordPress required 1 GB memory. You don’t have to worry; CentOS 7 already include the swap file. […]
[…] Create a swap file and allocate space. […]
[…] can use the Swap file to increase the memory of the VPS. First, you can enter this command to check the available […]
[…] This VPS is small and it comes with small memory. Before the installation, you can add a Swap file to increase the memory. […]
[…] can check the available memory first. See whether it includes a swap file. This server does not have swap […]
[…] can check the available memory by typing this command. Swap file added to the system […]
[…] can check the available memory by typing this command. Swap file added to the system […]
[…] Create a swap file and allocate space. I’ve used 1024 MB but you can take more. […]