# Linode VPS VRAM Expansion ### Manually adding more VRAM to a Debian-based Linode VPS. Simply create a new swap partition with the desired size and then activate it. 1. This will show you the current swap size, as well as the amount of used and available swap space: ```bash free -h ``` 2. Create a new swap file with the desired size. For example, to create a 1GB swap file: ```bash sudo fallocate -l 1G /swapfile ``` 3. Change the permissions on the new swap file so that it is only accessible to the root user: ```bash sudo chmod 600 /swapfile ``` 4. Format the new swap file as a swap partition: ```bash sudo mkswap /swapfile ``` 5. Enable the new swap partition: ```bash sudo swapon /swapfile ``` 6. To make the changes permanent, you need to add the new swap partition to the _fstab_ file. Open the file by running the command: ```bash sudo nano /etc/fstab ``` 7. Add something like the following line (example): ```bash /swapfile none swap sw 0 0 ``` Or here's an example _fstab_ file that I've configured for performance: ```bash # /dev/sda / ext4 errors=remount-ro 0 1 /dev/sdb none swap rw,noatime 0 0 /swapfile none swap rw,noatime 0 0 ``` 8. This will check the file system and tell you if there's an error with the _fstab_ file, which you can fix before reboot: ```bash sudo mount -a ``` > Note: No output means there were no errors. 9. Check if the new swap file is active. You should see the new swap size in the output: ```bash free -h ``` 10. Finally, we can see that both swap devices are present: ```bash sudo swapon -s ``` ### Swappiness adjustment. This is a tuning parameter, and the optimal value may vary depending on the specific system and use case. A common value for swappiness is 60. I'm happy with 40. But you could try lower values like 20, 10 or even 0. It's best to test different values and monitor system performance to determine the optimal value for your specific use case. The swappiness value controls how aggressively the system swaps data out of memory to the swap partition or file. If the system has a lot of free RAM and is not swapping frequently, a higher swappiness value will cause the system to swap less aggressively. If the system has little free RAM and is swapping frequently, a lower swappiness value will cause the system to swap more aggressively. In general, if the system has little free RAM and is frequently swapping, it may be beneficial to lower the swappiness value. You can change the swappiness value by modifying the `vm.swappiness sysctl` setting. The `sysctl` command allows you to modify kernel parameters at runtime. Here are the steps to change the swappiness value: 1. Open a terminal and check the current swappiness value by running the command: ``` sysctl vm.swappiness ``` 2. To change the swappiness value, use the following command, replacing X with the desired value (0-100): ``` sudo sysctl vm.swappiness=X ``` 3. To make the change permanent across reboots, you will need to edit the `sysctl` configuration file. On Ubuntu and other Debian-based systems, the file is located at `/etc/sysctl.conf`. Edit the file using a text editor with root privileges: ``` sudo nano /etc/sysctl.conf ``` 4. Add the following line to the file, replacing X with the desired value: ``` vm.swappiness=X ``` 5. Save the file and exit the text editor. 6. Reload the sysctl configuration by running the following command: ``` sudo sysctl -p ``` Monitor your system after changing the swappiness value to ensure that the new value is working well for your specific use case.