Many people do not understand the swap swap partition of Linux, do not know what is the swap swap partition, the following small series will give you a simple introduction to what is the swap partition and swap partition settings, want to set the swap partition Friends may wish to understand.
First, what is the swap partition
swap but seen as part of memory, but it's carved out from the hard disk, it's like virtual memory in windows, it The role is to cache data, when it is divided, the size is set to twice the size of your physical memory.
Second, set the swap swap partition
Recommended rules for the size of the swap partition
When the memory is less than 4GB, it is recommended to be no less than 2GB of swap space;
Memory 4GB~16GB, recommended not less than 4GB swap space;
Memory 16GB~64GB, recommended not less than 8GB swap space;
Memory 64GB~256GB, recommended not less than 16GB of swap space.
1. Log in to SSH as root and type the following command to create a 512M swap file (1024 * 512MB = 524288).
dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
2, create a Linux swap file
mkswap /swapfile1
3. Activate the /swapfile1 swap file immediately.
swapon /swapfile1
4. Set the system to activate the swap file. Edit the /etc/fstab file and add the second line of code below.
vi /etc/fstab
/swapfile1 swap swap defaults 0 0
5. Restart the system and use free -m to view the swap size.
Third, the Linux view of the swap command
You can use the "ld /cat /proc /swaps & rdquo;, "swapon - s" and "free" and other orders to view the Swap partition.
[root@jay-linux ~]# swapon -s
Filename Type Size Used Priority
/dev/sda3 partition 2096120 840 -1
[root@jay-linux ~]# cat /proc/swaps
Filename Type Size Used Priority
/dev/sda3 partition 2096120 840 -1
[root@jay -linux ~]# free -m
total used free shared buffers cached
Mem: 7872 7280 592 0 429 5964
-/+ buffers/cache: 886 6986< Br>
Swap: 2046 0 2046
According to the above example, I should actually allocate 4GB of Swap space, here is 2GB (may not meet Redhat's recommended value, because this machine uses memory The amount is not too big, almost no use of Swap). Previous123Next page Total 3 pages
Modify the IP address under Linux usually use ifconfig to modify, but this modification is very trou
I accidentally deleted Ubuntus Grub boot under UEFI, so I cant boot into Ubuntu aut
Steam Music is a music player. The biggest highlight of this player is that it can play music during
Some compilers under the Linux system need root privileges to run if they use raw s
How to install and upgrade VMware Tools in Fedora
What should I do if I want to enter a password every time git is submitted in Ubuntu?
What shortcuts do Linux systems use with Visual Studio?
How Linux uses ssh to transfer files to FTP space
Linux uses KSysguard to monitor remote hosts
CentOS batch compression image size operation example
What should I do if the Linux server is attacked by a rootkit?
Linux how to install and configure MariaDB database
The role of the -exec parameter in the Linux find command
Ubuntu desktop version to open the Bluetooth headset step
Where is the WeChat sound lock? How to set up WeChat sound lock login settings tutorial
Using XP SP2 imitation 2003 remote multi-user login
How to do the exclamation mark after the Win7 system wifi signal
Tencent computer housekeeper how to set the word search function for the qq browser
Win8.1 Update how to install Simplified Chinese language package
How does the Win8.1 system display the taskbar in the Modern application?
Windows8 can't update the driver solution (graphic tutorial)
How to solve the problem of "dwm.exe damaged image" prompt window after Win7 boot