The Swap partition of the Linux system, that is, the swap partition, is also commonly called virtual memory. The role of the Swap space can be simply described as: when the system's physical memory is insufficient, it is necessary to release part of the physical memory for use by the currently running program. The released space may come from some programs that have not been operated for a long time. The released space is temporarily saved in the Swap space. When those programs are to be run, the saved data is restored from the Swap to the memory. In this way, the system will only perform swap when the physical memory is insufficient. In fact, Swap adjustment is crucial to the performance of Linux servers, especially Web servers. By adjusting Swap, you can sometimes overcome system performance bottlenecks and save system upgrade costs. 1. Create a swap partition file [root@devsz wxadmin]# dd if=/dev/zero of=/opt/swapfile bs=1M count=4096 4096+0 records in 4096+0 records out 4294967296 bytes (4.3 GB) copied, 20.789 s, 207 MB/s 2. Authorize the file [root@devsz wxadmin]# chmod 600 /opt/swapfile 3. Format the swap partition [root@devsz wxadmin]# mkswap /opt/swapfile Setting up swapspace version 1, size = 4194300 KiB no label, UUID=bfe83644-0fa0-43f9-bf7e-69f9e24b391f 4. Enable swap partition [root@devsz wxadmin]# swapon /opt/swapfile 5. Check the swap partition status [root@devsz wxadmin]# free -m total used free shared buff/cache available Mem: 3789 2682 208 280 898 586 Swap: 4095 0 4095 [root@devsz wxadmin]# The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Practical method of deleting a row in a MySql table
>>: Solution to elementui's el-popover style modification not taking effect
Overview MySQL also has its own event scheduler, ...
Preface The three-column layout, as the name sugg...
I don't know if you have ever encountered suc...
At the beginning of the new year, I would like to...
1. Development environment vue+vant 2. Computer s...
Effect picture: 1. Introduction Your own applet n...
Nginx is developed in C language and is recommend...
Table of contents Principle Source code analysis ...
Suppose a user management system where each perso...
Table of contents Problem Description Scenario In...
Table of contents 1. Data Manipulation Language (...
Windows Server 2012 and Windows Server 2008 diffe...
This command modifies the data table ff_vod and a...
js execution Lexical analysis phase: includes thr...
Table of contents What is MySQL NDB Cluster Preli...