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:

https://engineer.org.pk/2019/10/11/cloud-platform-add-swap-file-centos/

Posted in Technical Solutions on Feb 28, 2021



How to Install Remote Desktop (RDP) on CentOS 7

Posted in Technical Solutions on Aug 26, 2022

How to Install Remote Desktop (RDP) on CentOS 7 How to install XRDP



The Ultimate Guide to Top Web Hosting Features in 2024

Posted in Uncategorized on Sep 19, 2024

In 2024, web hosting is about more than just storing your website; it's about providing a solid foundation for online success. To achieve this, consider key features such as speed and performance, security, scalability, and reliability. A fast website is crucial, with SSD storage, LiteSpeed or Nginx servers, and Content Delivery Networks (CDNs) playing vital roles. Security measures like SSL certificates, regular backups, and firewalls are also essential. Scalability options, user-friendly control panels, and reliable customer support further enhance your hosting experience.



Now hiring Wordpress PHP Developer (Remote / Office) - 2022

Posted in Jobs on Feb 28, 2022

Now hiring Wordpress PHP Developer (Remote / Office): Required Wordpress CSS, HTML, Javascript, PHP



Automated Backup to GoogleDrive - CyberPanel - HostingbyAliTech

Posted in About Hosting by AliTech, Technical Solutions on Jul 18, 2021

Automated Backup to GoogleDrive - CyberPanel All the Hosting by AliTech customers have access to GoogleDrive Backups, here is what you need..



Can Renewable Energy Really Fix the Global Energy Crisis?

Posted in News on Jan 10, 2025

Renewable energy offers a transformative potential to address the global energy crisis by leveraging sustainable resources like solar, wind, and hydropower. While advancements in technology and infrastructure have made clean energy more accessible and affordable, challenges such as intermittency, high initial costs, and outdated grids remain. Innovations like battery energy storage, decentralized grids, and agrivoltaics are helping to overcome these hurdles, paving the way for a greener, more reliable energy future. However, a comprehensive approach combining renewable energy, policy support, and technological breakthroughs is essential to create a sustainable and resilient global energy system.



New Look with the New Plans...

Posted on Jan 04, 2021

New Look with the New Plans... Buy the hosting which doesn’t only saves you money but also give you extreme performance...



Everything You Need to Know About Meta Connect 2024

Posted in News on Sep 23, 2024

Meta Connect 2024, happening from September 25 to 26, promises to be a groundbreaking event in the world of augmented and virtual reality. Attendees can expect exciting announcements, including the anticipated Quest 3S headset, which aims to offer a more affordable VR experience, and the innovative Orion AR glasses designed for seamless augmented reality interactions. In addition to hardware, the conference will highlight advancements in artificial intelligence, potentially unveiling an upgraded version of the Llama language model to enhance user experiences across Meta’s platforms. With live-streamed keynotes and developer sessions, Meta Connect 2024 is set to shape the future of technology and the metaverse, making it a must-watch event for enthusiasts and developers alike.



[SOLVED / FIXED ] ModuleNotFoundError: No module named 'setuptools_rust'

Posted in Technical Solutions on Apr 09, 2022

[SOLVED / FIXED ] ModuleNotFoundError: No module named 'setuptools_rust' Error: While installing docker-compose the following error can come up: ModuleNotFoundError: No module named 'setuptools_rust'



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.



WordPress Cofounder Asks Court to Dismiss WP Engine’s Lawsuit

Posted in News on Nov 01, 2024

WordPress cofounder Matt Mullenweg, along with Automattic, has moved to dismiss a lawsuit filed by WP Engine that alleges defamation, extortion, and trademark infringement. WP Engine’s claims arise from Mullenweg’s criticism of the company’s contributions to WordPress and his decision to restrict its access to WordPress.org resources. Mullenweg counters that WP Engine has no legal right to these resources, describing the company’s reliance on WordPress.org as a “risky decision” made without a backup plan. This high-stakes case has stirred concerns within the WordPress community about the implications for other developers and businesses relying on the platform’s open-source ecosystem.



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.



Apple Is Developing a Doorbell That Unlocks With Your Face, Report Says

Posted in News on Dec 24, 2024

Apple is reportedly developing a revolutionary smart doorbell with Face ID, allowing it to unlock your door by recognizing your face. This innovative device is expected to integrate seamlessly with Apple's growing smart home ecosystem, including upcoming security cameras and a new smart home hub. With a potential release date in late 2025, Apple aims to challenge Amazon and Google in the smart home market by prioritizing privacy and user experience.



[SOLVED / FIXED] node is not recognised as internal command

Posted in Technical Solutions on Jul 13, 2022

[SOLVED / FIXED] node is not recognised as internal command



Amazon Workers Strike During Peak Holiday Season

Posted in News on Dec 20, 2024

Amazon workers, represented by the Teamsters union, launched a strike at multiple facilities during the peak holiday season, demanding better pay and working conditions. The walkout, which impacts delivery stations in cities like New York, Atlanta, and San Francisco, threatens delays for holiday packages as the company faces mounting pressure over labor practices



[SOLVED / FIXED] dictionary update sequence element #0 has length 1; 2 is required

Posted in Technical Solutions on Aug 31, 2022

ERROR: ValueError at / dictionary update sequence element #0 has length 1; 2 is required SOLUTION: This has a simple solution.



How LinkedIn Became a Hub for AI-Generated Content

Posted in News on Nov 29, 2024

LinkedIn has always been a platform for professionals to network, find job opportunities, and share career-related content. However, over the past few years, it has evolved into something more, a place where thought leaders, influencers, and even job seekers have turned to AI-powered tools to help generate content. This shift has been a major factor in the rise of AI-generated posts, with over half of LinkedIn’s long-form posts being created by AI as of October 2024.



YouTube is Now Letting Creators Remix Songs through AI Prompting

Posted in News on Nov 13, 2024

YouTube has introduced an innovative feature for select creators, allowing them to remix songs using AI technology. By simply describing the style or mood they envision, creators can generate unique 30-second soundtracks with reimagined elements, making it perfect for short-form content like YouTube Shorts. This feature, known as Dream Track, leverages AI to modify vocals from artists such as Charlie Puth and Demi Lovato, all while ensuring that the core essence of the original song is preserved. With this tool, YouTube is enhancing creative possibilities while maintaining copyright compliance through partnerships with music labels like Universal Music Group. As this technology evolves, it promises to transform music use on social media, giving creators fresh ways to connect with their audiences



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




Other Blogs


How to Install Remote Desktop (RDP) on CentOS 7

Posted in Technical Solutions on Aug 26, 2022 and updated on Aug 26, 2022

The Ultimate Guide to Top Web Hosting Features in 2024

Posted in Uncategorized on Sep 19, 2024 and updated on Sep 19, 2024

Now hiring Wordpress PHP Developer (Remote / Office) - 2022

Posted in Jobs on Feb 28, 2022 and updated on Feb 28, 2022

Can Renewable Energy Really Fix the Global Energy Crisis?

Posted in News on Jan 10, 2025 and updated on Jan 10, 2025

New Look with the New Plans...

Posted on Jan 04, 2021 and updated on Aug 26, 2022

Everything You Need to Know About Meta Connect 2024

Posted in News on Sep 23, 2024 and updated on Sep 23, 2024

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

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

WordPress Cofounder Asks Court to Dismiss WP Engine’s Lawsuit

Posted in News on Nov 01, 2024 and updated on Nov 01, 2024

Amazon AWS Google Cloud Microsoft Azure Vultr port 25 killed

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

Apple Is Developing a Doorbell That Unlocks With Your Face, Report Says

Posted in News on Dec 24, 2024 and updated on Dec 24, 2024

[SOLVED / FIXED] node is not recognised as internal command

Posted in Technical Solutions on Jul 13, 2022 and updated on Jul 13, 2022

Amazon Workers Strike During Peak Holiday Season

Posted in News on Dec 20, 2024 and updated on Dec 20, 2024

How LinkedIn Became a Hub for AI-Generated Content

Posted in News on Nov 29, 2024 and updated on Nov 29, 2024

YouTube is Now Letting Creators Remix Songs through AI Prompting

Posted in News on Nov 13, 2024 and updated on Nov 13, 2024

New Look with the New Plans...

Posted on Jan 04, 2021

New Look with the New Plans...

Posted on Jan 04, 2021







Comments

Please sign in to comment!






Subscribe To Our Newsletter

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