Adjust the FreeBSD virtual memory system

Source: Internet
Author: User
Tags file system range

The developer's collaborative effort allows FreeBSD to dynamically adjust the kernel itself. In general, you don't need to do anything messy except for the kernel configuration options maxusers and Nmbclusters. These kernel compilation configuration options (general) are specified in/usr/src/sys/i386/conf/config_file. A description of all available kernel configuration options can be found in/usr/src/sys/i386/conf/lint. In the configuration of a large system, you may need to increase the value of maxusers. The range of values is usually 10 to 128. Note that excessively increasing the value of maxusers may cause the system to overflow from the actual available KVM, causing unpredictable operations. It is a good idea to set the maxusers to a reasonable value and add other options, such as nmbclusters, to increase the specific resources.

If your system is going to be heavily loaded using the network, you need to increase the value of the nmbclusters. The range of values is usually 1024 to 4096. Nbuf is also the parameter of the traditional planning system. This parameter determines the number of KVM systems that the system can use to map file system input/output caching. Note: This parameter has nothing to do with the unified cache. This parameter can be dynamically adjusted in the 3.0-current and later cores and should not normally be manually adjusted. We recommend that you do not specify NBUF. Let the system determine it by itself. Too small values can cause very inefficient file system operations; too large values use pages in the page queue, and a large number of pages are in the thread state. By default, the FreeBSD kernel is not optimized when compiled. You can use Makeoptions to specify error (debugging) and optimization flags in the kernel configuration file. Note that you should not normally use-G unless you are able to cope with the resulting large kernel (typically 7MB or more).

Makeoptions debug= "-G"

Makeoptions coptflags= "-o-pipe"

SYSCTL provides a way to adjust the kernel at run time. You don't usually need to specify any sysctl variables, especially those associated with the VM. The impact of runtime VM and system tuning is relatively straightforward. First, soft Updates should be used on the Ufs/ffs file system whenever possible. There are instructions on how to configure the/usr/src/sys/ufs/ffs/readme.softupdates.

Second, there should be a sufficient number of swap spaces to be configured. You should configure a swap partition on each physical disk, up to 4, even on your "work" disk. You should have at least twice times the swap space of the main memory, and if you don't have enough memory, swap the partition more. You should also decide the size of the swap partition according to the maximum memory configuration you expect, so that you no longer need to repartition the disk. If you deal with the memory dump (crash dump) After the system crashes, the first swap partition must be at least as large as the main memory, and the/var/crash must have enough space to load the dump. Swap partitions on NFS can be well used by 4.X or later systems, but you must understand that the NFS server will suffer a strong impact on the page load operation.

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.