Cloud Platform - Add Swap File on CentOS 7



Cloud Platform - Add Swap File on CentOS 7

I will start with adding 4GB of swapfile

sudo fallocate -l 4G /swap.engineer.org.pk

to check 4GB equivalent to KB I will use below site:

https://www.gbmb.org/gb-to-kb

4GB = 4194304 KB (in binary)

So run below command now:

sudo dd if=/dev/zero of=/swap.engineer.org.pk bs=1024 count=4194304

wait for a while so that system creates a 4 GB file.

See correct permissions:

sudo chmod 600 /swap.engineer.org.pk

and

sudo mkswap /swap.engineer.org.pk
sudo swapon /swap.engineer.org.pk

you will need to add the swap file permanently, otherwise when the system will reboot this will be removed.

sudo nano /etc/fstab

you might need to install nano utility to install nano:

sudo yum install nano

after the nano is installed now run the same command to edit fstab file:

sudo nano /etc/fstab

move the cursor to the end of the file and paste:

/swap.engineer.org.pk swap swap defaults 0 0

to check if your swap file is added:

sudo swapon --show

you will need to setup how frequently the swap file should be used, to do that you can use below commands:

sudo nano /etc/sysctl.conf

Add below lines:

vm.swappiness = 20
vm.vfs_cache_pressure = 50
Cloud Platform - Add Swap File on CentOS 7

In case you want to remove the swap file for some reason you can remove by using this command:

sudo swapoff -v /swap.engineer.org.pk
sudo rm /swap.engineer.org.pk

and at the end reboot the system:

reboot

you will see the system performance will boost.

 

Learn more about Cloud Platform follow below links:

Cloud Platform – How to Create Account on Oracle Cloud – Part 1

https://engineer.org.pk/blog/2019/10/04/how-to-create-account-oracle-cloud/

Cloud Platform – Launch VM Instance on Oracle Cloud – Part 2

https://engineer.org.pk/blog/2019/10/07/cloud-platform-launch-vm-instance-part-2/

Originally Published at:

Cloud Platform – Add Swap File on CentOS 7

Posted in Technical Solutions on Feb 28, 2021



Coursera is offering 9 free courses with Certificate on their 9th Birthday

Posted on Apr 15, 2021

Coursera is offering 9 free courses with Certificate on their 9th Birthday Earn a free certificate in one of 9 specially selected courses! This special offer* is available through April 30.



Best Prices Now

Posted in Hosting Promotions on Jan 11, 2021

At HostingbyAliTech, you get low cost web hosting services with the power of Cloud. CyberPanel and LiteSpeed provide customers the best experience and optimized site performances. Along with best prices, you get most optimized performance. AliTech is serving since 2020 and it is a first choice of the clients who are after quality and speedy web hosting..



[SOLVED / FIXED] django.core.exceptions.ImproperlyConfigured: Requested setting AUTH_USER_MODEL

Posted on Mar 27, 2022

[SOLVED / FIXED] django.core.exceptions.ImproperlyConfigured: Requested setting AUTH_USER_MODEL ERROR / PROBLEM: Starting the Python Shell in the terminal inside virtual environment.



UAE to grant citizenship to expat investors and professionals

Posted in News on Jan 30, 2021

UAE to grant citizenship to expat investors and professionals including engineers, doctors, artists "The UAE cabinet, local Emiri courts & executive councils will nominate those eligible for the citizenship under clear criteria set for each category. The law allows receivers of the UAE passport to keep their existing citizenship."



Does your hosting provider has this performance?

Posted in News on Sep 12, 2020

Does your hosting provider has this performance? If no... you need to move now 🙂 https://hosting.alitech.uk



[SOLVED / FIXED] Django Rest Framework - Missing Static Directory

Posted in Technical Solutions on Jun 27, 2022

Used these static and media settings in settings.py STATIC_ROOT = os.path.join(BASE_DIR, 'public/static') STATIC_URL = '/static/' MEDIA_ROOT = os.path.join(BASE_DIR, 'public/media') MEDIA_URL = '/media/' and python manage.py collectstatic



[SOLVED] MySQL / MariaDB Specified key was too long; max key length is 767 bytes

Posted in Technical Solutions on Jan 07, 2022

[SOLVED] MySQL / MariaDB Specified key was too long; max key length is 767 bytes Error : mariadb specified key was too long. Specified key was too long; max key length is 767 bytes.



Ubuntu 18.04.6 LTS (Bionic Beaver) / Ubuntu 20.04.3 LTS (Focal Fossa) - Common Commands

Posted in Technical Solutions on Nov 04, 2021

Ubuntu 18.04.6 LTS (Bionic Beaver) / Ubuntu 20.04.3 LTS (Focal Fossa) - Common Commands & Frequent Tasks Disabling the firewall - iptables if you need to disable the firewall temporarily, you can flush all the rules using



Google Search Impact - Congrats on reaching 900 clicks in 28 days!

Posted in News on Mar 05, 2022

Google Search Impact - Congrats 900 clicks 28 days! - Awesome



Ransomware attack forces web hosting provider Managed.com

Posted in News on Jan 25, 2021

Ransomware attack forces web hosting provider Managed.com to take servers offline.



How to Install Python Django 4.0 on Windows 10 or Windows 11

Posted on Jan 20, 2022

How to Install Python Django 4.0 on Windows 10 or Windows 11 This tutorial explains how to Install Django on Windows 10 or Windows 11.



Lite Speed performance comparison

Posted in News on Aug 23, 2020

Our server supports Lite Speed webserver: With the power of LiteSpeed server your websites will have outclass performance see the difference. The benchmark shows the difference of Magneto performance on LiteSpeed server, Nginx & Apache.



[Tutorial] Installing Kubernetes Manually

Posted in Technical Solutions on May 01, 2022

[Tutorial] Installing Kubernetes Manually 1. Letting iptables see bridged traffic



Awesome Partners - Hosting by AliTech

Posted in Uncategorized on May 24, 2021

We are pleased to announce that CyberPanel has chosen us as their Awesome Partner!!! Along with other superb & awesome partners we are cordially welcoming CyberPanel. #hostingbyalitech #alitech #cyberpanel #litespeed #openlitespeed #partnership #partners #awesome #we #are #welcoming https://www.hostingbyalitech.com



Metro-Goldwyn-Mayer (MGM) Inks Cloud Computing Deal With Amazon in Search for "New Revenue Opportunities"

Posted in News on Feb 09, 2021

MGM (a private company) is set to move all of its content to Amazon’s cloud and use the tech giant’s software to modernize its media supply chain. Metro Goldwyn Mayer has signed a cloud computing agreement with Amazon Web Services to move its content and distribution efforts to the tech giant’s cloud. The James Bond studio is set to move all of its content to Amazon's cloud and use the tech giant's software to modernize its media supply chain.



100% Free Web Hosting for Startups

Posted in Hosting Promotions on Jun 16, 2021

100% Free Web Hosting 😍 for Startups We are pleased to announce 100% Free Hosting for Startups. For plan details & registration please contact our WhatsApp given at the bottom of the page to get started. This is limited time offer.



ACME now uses ZeroSSL, here is what you need to do for your CyberPanel

Posted in Technical Solutions on Jul 02, 2021

ACME now uses ZeroSSL, here is what you need to do for your CyberPanel.



Amazon AWS Google Cloud Microsoft Azure Vultr port 25 killed

Posted on Dec 28, 2021

Amazon AWS, Google Cloud, Microsoft Azure, Vultr port 25 If you are looking for sending e-mails through your Virtual Machine Instances you would be disappointed by reading this blog.



Other Blogs

Coursera is offering 9 free courses with Certificate on their 9th Birthday

Posted on Apr 15, 2021 and updated on Apr 15, 2021

Best Prices Now

Posted in Hosting Promotions on Jan 11, 2021 and updated on Mar 30, 2022

UAE to grant citizenship to expat investors and professionals

Posted in News on Jan 30, 2021 and updated on Mar 30, 2022

Does your hosting provider has this performance?

Posted in News on Sep 12, 2020 and updated on Oct 23, 2020

[SOLVED / FIXED] Django Rest Framework - Missing Static Directory

Posted in Technical Solutions on Jun 27, 2022 and updated on Jul 05, 2022

Google Search Impact - Congrats on reaching 900 clicks in 28 days!

Posted in News on Mar 05, 2022 and updated on Mar 18, 2022

Ransomware attack forces web hosting provider Managed.com

Posted in News on Jan 25, 2021 and updated on Mar 30, 2022

How to Install Python Django 4.0 on Windows 10 or Windows 11

Posted on Jan 20, 2022 and updated on Mar 17, 2022

Lite Speed performance comparison

Posted in News on Aug 23, 2020 and updated on Jan 14, 2021

[Tutorial] Installing Kubernetes Manually

Posted in Technical Solutions on May 01, 2022 and updated on Jun 29, 2022

Awesome Partners - Hosting by AliTech

Posted in Uncategorized on May 24, 2021 and updated on May 28, 2021

100% Free Web Hosting for Startups

Posted in Hosting Promotions on Jun 16, 2021 and updated on Jan 16, 2022

Amazon AWS Google Cloud Microsoft Azure Vultr port 25 killed

Posted on Dec 28, 2021 and updated on Jun 30, 2022

Best Prices Now

Posted in Hosting Promotions on Jan 11, 2021

Lite Speed performance comparison

Posted in News on Aug 23, 2020

Best Prices Now

Posted in Hosting Promotions on Jan 11, 2021

Lite Speed performance comparison

Posted in News on Aug 23, 2020






Comments

Please sign in to comment!






Subscribe To Our Newsletter

Stay in touch with us to get latest news and discount coupons