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