High utilization of Linux swap partitions, refreshing the Swap partition method

Source: Internet
Author: User

Company a server to do the gateway, SSH and execute some commands are special card, looked under the system load is not high.

[Email protected] ~]# top-c

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5C/99/wKioL1UeQ1qyNVbqAAB4R6mWyGE557.gif "title=" Qq20150403153148.gif "width=" 725 "height=" 417 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:725PX;HEIGHT:417PX; "alt = "Wkiol1ueq1qynvbqaab4r6mwyge557.gif"/>

Iowait is not high, network card traffic is also normal.

Finally look at iostat-x 2 , found that the/sda2 occupancy rate is very high, the problem should be out here.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5C/9E/wKiom1UeQrWjgF_OAAA8u5A9Xzg098.gif "title=" Qq20150403153420.gif "width=" 725 "height=" 187 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:725PX;HEIGHT:187PX; "alt = "Wkiom1ueqrwjgf_oaaa8u5a9xzg098.gif"/>

fdisk-l View sda2 is a swap partition

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5C/99/wKioL1UeRG2C-_L1AABBvspMROE765.gif "title=" Qq20150403153646.gif "width=" 725 "height=" 382 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:725PX;HEIGHT:382PX; "alt = "Wkiol1uerg2c-_l1aabbvspmroe765.gif"/>

free-m , please.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5C/9E/wKiom1UeQ5bwuTAVAAARZgnTJi0612.gif "title=" Qq20150403153820.gif "width=" 725 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:725px;height:86px; "alt=" Wkiom1ueq5bwutavaaarzgntji0612.gif "/>

Physical memory is almost depleted, and swap occupies more than 50%.


Search online for the following methods:

During the use of Linux VPS, swap swap partition is a very important system cache partition. He does not have enough memory to temporarily separate a portion of the space system from the hard disk as memory usage. However, if the swap occupies more than 30% of the time, the performance of the system will be affected, it is necessary to refresh the swap.

Refresh Swap

You can execute a command to refresh the swap (the data in the swap is dumped back into memory and the data in the swap is emptied)

Swapoff-a && swapon-a

Execute the above command in SSH to flush the swap partition.

Close Swap

When memory is greater than 2G, you can normally turn off

Swapoff-a

Execute the above command in SSH to close the swap partition.

Open Swap

Swapon-a

Execute the above command in SSH to open the swap partition.


High utilization of Linux swap partitions, refreshing the Swap partition method

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.