In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about what the SWAP exchange area in the CentOS7 server is like. The article is rich in content and analyzes and describes it from a professional point of view. I hope you can get something after reading this article.
By default, Tencent Cloud does not have a swap area, which is equivalent to virtual memory. Even if the hard disk is used as spare memory, some less commonly used data in the memory is put on the hard disk to increase the memory. If there is not enough physical memory, data will be frequently written and read out of the swap area, which will greatly reduce system performance and even errors. Therefore, the editor does not recommend the use of swap areas to encourage people to buy more physical memory.
Some swap areas can be used properly in practical use. After all, poor performance is better than memory overflow.
Self-built servers can select a swap exchange zone when formatting partitions, while Tencent Cloud needs to create a swap exchange zone with commands.
Free-h # create swap partition file 4G, generally 1 times physical memory dd if=/dev/zero of=/swapfile bs=4096 count=1024000# change permissions chmod 600 / swapfile# set swap partition file mkswap / swapfile# enable swap partition file swapon / swapfile
Vim / etc/fstab
Add the following code
/ swapfile swap swap defaults 0 0
To enable self-enabling at boot time, modify the swap line echo "LABEL=SWAP-sda / swapfile swap swap defaults 00" > > / etc/fstab in the file / etc/fstab
# check the swap usage policy. The default is 30, that is, when the physical memory is used to 70%, the exchange area cat / proc/sys/vm/swappiness# is used to temporarily set the sysctl vm.swappiness=5 permanent setting vim / etc/sysctl.conf.
Add the following:
Vm.swappiness=5
Delete swap:
Swapoff / swapfile; rm-f / Application/swap above is what the SWAP exchange area in the CentOS7 server shared by Xiaobian is like. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.