Swap partition settings in linux

Source: Internet
Author: User
Although the current memory is very low, reasonable planning of swap partitions can greatly improve the stability of system operation. The following describes the settings of swap partitions! [Root @ localhost ~] # Ddifdevzeroofdataswapfilebs1Mcount1010 + 0recordsin10 + 0recordsout10485760bytes (10 M

Although the current memory is very low, reasonable planning of swap partitions can greatly improve the stability of system operation. The following describes the settings of swap partitions!

[Root @ localhost ~] #DdIf =/dev/zero of =/data/swapFileBs = 1 M count = 10
10 + 0 records in
10 + 0 records out
10485760 bytes (10 MB) copiEd, 0.143459 seconds, 73.1 MB/s
[Root @ localhost ~] #Mkswap/Data/swapfile
Setting up swapspace version 1, size = 10481 kB
[Root @ localhost ~] #Free
Total uSedFree shared buffers cached
Mem: 444416 294176 150240 0 18432 198928
-/+ Buffers/cache: 76816 367600
Swap: 1048568 0 1048568
[Root @ localhost ~] #Swapon/Data/swapfile
[Root @ localhost ~] # Free
Total used free shared buffers cached
Mem: 444416 294176 150240 0 18448 198928
-/+ Buffers/cache: 76800 367616
Swap: 1058800 0 1058800
[Root @ localhost ~] #Swapoff/Data/swapfile
[Root @ localhost ~] # Free
Total used free shared buffers cached
Mem: 444416 294176 150240 0 18472 198928
-/+ Buffers/cache: 76776 367640
Swap: 1048568 0 1048568
This is the operation related to swap. However, if you want to restart the system, you still need to modify/etc/fastab to add the following statement.

/Data/swapfile none swap sw 0 0

Conclusion: This operation aims to understand the settings of swap.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.