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
This article example shares the specific code of ...
Preface This article mainly introduces the releva...
Table of contents 1. Prototype 2. Prototype point...
Today, I will answer these newbie questions: Build...
When using Docker containers, it is more convenie...
Preface Normally, if we want to delete certain li...
Preface I believe everyone is familiar with addin...
Are you still looking for a way to enable Hyper-v...
Table of contents 1. Definition of stack 2. JS st...
1. Install mysql Run the following command to upd...
There are two files a.htm and b.htm. In the same d...
Reminder: Whether it is planning, designing, or de...
<br />In the entire product design process, ...
Table of contents Install Dependencies Configurat...
(I) Basic concepts of web page color matching (1) ...