Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

Adding Swap to an AWS Lightsail Ubuntu Instance (running WordPress on NGINX)

Installing WordPress on AWS Lightsail Using NGINX (including Let’s Encrypt TLS/SSL): https://youtu.be/PqIQVbErHus

Getting an A+ Rating on Qualys SSL Test for WordPress Install Running on NGINX: https://youtu.be/rvaGJV3Twr8

Check Swap Status
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo swapon --show
sudo swapon --show
sudo swapon --show
Check Drive Capacity
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
df -h
df -h
df -h
Allocate Swap File Space on Drive
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo fallocate -l 1G /swapfile
sudo fallocate -l 1G /swapfile
sudo fallocate -l 1G /swapfile
Change Permissions of Swap File
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo chmod 600 /swapfile
sudo chmod 600 /swapfile
sudo chmod 600 /swapfile
Check Swap File Size and Permissions
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ls -lh /swapfile
ls -lh /swapfile
ls -lh /swapfile
Make Swap File
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo mkswap /swapfile
sudo mkswap /swapfile
sudo mkswap /swapfile
Enable Swap
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo swapon /swapfile
sudo swapon /swapfile
sudo swapon /swapfile
Open fstab for Editing
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo nano /etc/fstab
sudo nano /etc/fstab
sudo nano /etc/fstab
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
/swapfile none swap defaults 0 0
/swapfile none swap defaults 0 0
/swapfile none swap defaults 0 0
Check Swap Parameters
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cat /proc/sys/vm/swappiness
cat /proc/sys/vm/vfs_cache_pressure
cat /proc/sys/vm/swappiness cat /proc/sys/vm/vfs_cache_pressure
cat /proc/sys/vm/swappiness
cat /proc/sys/vm/vfs_cache_pressure
Change Swap Parameters
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo sysctl vm.swappiness=10
sudo sysctl vm.vfs_cache_pressure=50
sudo sysctl vm.swappiness=10 sudo sysctl vm.vfs_cache_pressure=50
sudo sysctl vm.swappiness=10
sudo sysctl vm.vfs_cache_pressure=50
Open sysctl.conf for Editing
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo nano /etc/sysctl.conf
sudo nano /etc/sysctl.conf
sudo nano /etc/sysctl.conf
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
vm.swappiness=10
vm.vfs_cache_pressure=50
vm.swappiness=10 vm.vfs_cache_pressure=50
vm.swappiness=10
vm.vfs_cache_pressure=50
Check Swap File
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo swapon --show
sudo swapon --show
sudo swapon --show

Leave a comment

Your email address will not be published. Required fields are marked *