How to Set LINUX shared memory

Source: Internet
Author: User
Article Title: how to set LINUX shared memory. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

We can modify the shmmax kernel parameters so that SGA exists in a shared memory segment.

You can modify the/proc/sys/kernel/shmmax parameter to achieve this goal.

[Root @ neirong root] # echo 1073741824>/proc/sys/kernel/shmmax

[Root @ neirong root] # more/proc/sys/kernel/shmmax

1073741824 set it to 1 GB.

Changes to the shmmax file will be reset after the system restarts. You can change the duration by modifying/etc/sysctl. conf.

Add the following line of kernel. shmmax = 1073741824 in this file. This change takes effect after the system restarts.

1. Set SHMMAX

SHMMAX

The parameter defines the maximum size (in bytes) of the shared memory segment ). When setting SHMMAX, remember that the size of the SGA should be suitable for a shared memory segment. Insufficient SHMMAX settings may cause the following problems:

ORA-27123: unable to attach to shared memory segment

You can determine the value of SHMMAX by executing the following command:

# Cat/proc/sys/kernel/shmmax

33554432

The default value of SHMMAX is 32 MB. I generally use one of the following methods to set the SHMMAX parameter to 2 GB:

By directly changing the/proc file system, you can change the SHMMAX default settings without restarting the machine. I am using the following command to put it in the/etc/rc. local Startup file:

#> Echo "2147483648">/proc/sys/kernel/shmmax

You can also use the sysctl command to change the SHMMAX value:

# Sysctl-w kernel. shmmax = 2147483648

Finally, by inserting this Kernel Parameter into the/etc/sysctl. conf Startup File, you can make this change permanently valid:

# Echo "kernel. shmmax = 2147483648">/etc/sysctl. conf

2. Set SHMMNI

Now let's look at the SHMMNI parameter. This Kernel Parameter is used to set the maximum number of shared memory segments within the system range. The default value of this parameter is 4096. This value is sufficient and does not need to be changed.

You can determine the value of SHMMNI by executing the following command:

# Cat/proc/sys/kernel/shmmni

4096

3. Set SHMALL

Finally, let's look at the SHMALL shared memory kernel parameters. This parameter controls the total amount of shared memory that the system can use at one time (in pages ). In short, the value of this parameter should always be at least:

Ceil (SHMMAX/PAGE_SIZE)

The default SHMALL size is 2097152. You can use the following command to query the SHMALL:

# Cat/proc/sys/kernel/shmall

2097152

SHMALL's default settings should be sufficient for our Oracle9 I RAC installation.

Note: On the i386 platform, the page size of Red Hat Linux is 4096 bytes. However, you can use bigpages to configure a larger memory page size.

Related Article

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.