In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
What are the three major scenarios of using server memory swapping to improve performance? in view of this question, this article introduces the corresponding analysis and solutions in detail. I hope it can help more partners who want to solve this problem to find a more simple and feasible method.
The Linux kernel uses active and inactive memory systems to manage the server's memory resources. If your Linux server is overloaded with resources, it may be caused by several reasons: not enough memory to load the application, caching all files that should be hidden, or relying too heavily on Linux memory swapping.
Then you can optimize the server based on Linux memory utilization best practices, such as moving inactive memory to the swap area. Of course, each separate load problem requires Linux memory analysis before solving the problem. Let's take a look at some scenarios and their solutions.
There is insufficient memory space to load the application
Let a server that does not have enough memory to load the application, which will lead to a shortage of memory. The server displays a relatively limited amount of memory in the buffer, and accordingly, more swap space is used. The easiest way is to add more memory. However, optimizing Linux memory swapping can also improve performance. Make sure that inactive memory pages are swapped out as soon as possible to make room for the required memory pages.
How do I get the server to start switching quickly? Use the following command: echo 80 > / proc/sys/vm/swappiness. At the same time, write the parameters to the / etc/systcl.conf file using the following statement: vm.swappiness = 80. If this doesn't give you more memory to load the application, then add more physical memory to the server.
Insufficient memory space when caching files
If you feel that the cache file may run out of memory, calculate as follows: if the available cache and cache memory is less than 30% of the total RAM, then the server may experience insufficient memory. Next check the contents of / proc/meminfo. If the amount of inactive (file) memory is significantly higher than the total cache, then the server does not have enough memory available to cache files. When releasing more caches, first find out what is causing the shortage.
If the program loaded by Linux requires too much memory, there is no choice but to add more physical RAM memory. However, other parts of the system that use memory can also cause cache shortages. For example, it may take a long time to commit a modified file to disk. If so, you will see a relatively high wa parameter in the drop program, and a relatively high value in the / proc/meminfo parameter Dirty. If so, modifying disk performance is the key to better memory performance.
Memory swapping is used too frequently
If too much swap is used, the vmstat monitoring tool will show high si and so (swap in and out) actions. The swap space is almost full and the server may have very little free memory.
To optimize Linux memory, first investigate the root causes of frequent swapping. In general, if there is only an inactive exchange area, then there should be no pressure. In / proc/meminfo, see if the swap is used more than the amount of inactive memory. If so, active memory pages are swapped well, even if the Linux kernel needs to access active memory pages frequently. The system needs more physical memory.
If the swap is under pressure and a large number of caches are allocated, the memory load on the server can be reduced by increasing the swappiness parameter. A higher swappiness value allows the kernel to put memory pages on disk faster, reducing the pressure from the cache and making more available memory for active memory.
Higher swappiness parameters actually reduce disk concussion, which is usually caused by frequent page swapping in and out. The additional swappiness simply ensures that the page is moved to the swap area where it should be, slowing down the swap on the server. However, to achieve this, you need to add more exchanges for the server.
This is the answer to the question about what are the three major scenarios of using server memory swapping to improve performance. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
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.