Add virtual memory swap partitions for Linux systems

Source: Internet
Author: User

AminLinuxThe study notesSwapPartitioning

First, the role:

Swap partitions are swap partitions that swap with swap When the system is out of physical memory and have a significant impact on the performance of the Web Server by adjusting the swap partition size to improve server performance and save on resource costs.

Second, step:

1. Create a swap file First

The command is as follows:

DD If=/dev/zero Of=/tmp/swap bs=1024k count=1000

To view the current system memory:

Free-m: '-M ' is showing the result in 'MB' form

2. Format the swap file we created

Command:

Mkswap-f/tmp/swap

3. Add Virtual Memory

Swapon/tmp/swap

The memory of the current swap partition has been increased by 1000MBcomparedto 1899MB.

4. Uninstalling virtual Memory

Command:swapoff/tmp/swap

OK Now after uninstalling, see only 899MB .

Add virtual memory swap partitions for Linux systems

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.