Management of UNIX system swap zone (1)

Source: Internet
Author: User

A swap is an area of high-speed storage devices and an important part of the virtual memory system. Through the swap zone, we are no longer limited to limited physical memory space. Theoretically, we can infinitely expand the virtual memory system to run more programs and conduct more business transactions, make full use of hardware resources. The swap zone uses the swap-in and swap-out technology and the memory exchange processes or data pages. According to certain scheduling principles, Some uncommon processes or data pages in the memory are regularly exchanged to the swap area, so as to leave more available space for the programs to run. Exchange processes or data pages as needed. This allows you to manage a large number of concurrent processes. Improper Page Swap settings not only make the Page Swap daemon busy switching page access and consume time, but also greatly reduce the process running speed and system efficiency, the performance of the operating system is greatly affected. Currently, applications are growing and business operations are increasing rapidly. High-Performance databases such as the shared memory technology used by Informix Online Dynamic Server to respond to fast data access, they all put forward higher requirements for limited physical memory space, so implementation plays an important role in effective management of swap areas.

Calculation of swap Zone capacity

Generally, the swap zone must be set during the initial installation of the operating system. Most programs require the minimum required swap Zone capacity for normal operation. Generally, when the physical memory does not exceed MB, the primary swap Zone capacity is set to twice the memory size. If the memory size exceeds MB, select the same capacity as the physical memory. After the operating system is installed, with the increasing number of applications and business changes, the original swap zone settings may not meet the requirements and affect the system performance, the system administrator can add a new swap area as a secondary swap area for use with the primary swap area. Administrators should also constantly monitor the use of swap areas and make necessary adjustments as needed.

Type of the SWAp Zone

There are four main types of switch differentiation:

1. device switching

That is, the entire disk or part of the Disk Area of the continuous physical space is used as the swap zone, which is faster. Using advanced logical volume Technology in HP-UX enables dynamic and scalable management of physical disks, allowing administrators to use one or more logical volumes as device exchanges, while in SCO OpenServer, the block device that occupies a certain disk space area is used as the device switch.

2. File System Switching

File System switching is a complementary exchange. It is considered only when the device switching is not applied to meet the page changing requirements. It is characterized by simple configuration and dynamic settings. Because file system exchange only uses some of the file systems it requires, the size of the space used changes. At the same time, many applications and data in the file system need to be frequently accessed, therefore, the system operation efficiency is greatly reduced. The administrator can restrict the file system swap to a fixed range to prevent it from occupying unnecessary space, and it is best to establish it on a rarely used file system.

For UNIX systems, when file system switching is started, the "/paging" Directory will be created under the root directory of the file system, the file system creates a file for each used swap block. The swap block is 2 MB by default.

3. Master Switch

At least one device must be available when the system starts. This is the primary swap region. By default, the system and the root file system coexist in the same disk.

4. Secondary exchange

It refers to other exchanges except the primary switch. File System swap is always secondary swap. If you use device swap as the secondary swap, try to set it on a non-root file system disk for better performance. Secondary switches can be automatically enabled when UNIX is started or dynamically increased when the system is running.

Dynamic settings in the SWAp Area

In reality, we often encounter that the swap zone cannot meet the growing application requirements due to improper configuration during operating system installation. reinstalling the operating system is not only time-consuming, but also causes a certain degree of business risks, so it is not advisable. Most UNIX systems provide methods for dynamically setting swap areas through command lines. The Administrator should be familiar with this. The Command Used in the HP-UX is swapon, and the Command Used in the SCO OpenServer is swap. The following is an example:


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.