How to modify shared memory in linux

Source: Internet
Author: User
Article Title: a simple way to modify shared memory in linux. 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.

Recently, when optimizing oracle, I encountered that the size of oracle's SGA is much larger than the maximum shared memory in linux, so that when I run the ipcs command to view it, oracle's SGA partition is divided into 10 segments, which greatly affects the response speed of oracle. Later, after reading the materials, I found a simple way to modify the shared memory and share it with you.

Generally, it is very troublesome to modify the kernel program to modify the shared memory of the system and then make the program. In fact, you only need to add something to rc. local to save the trouble of modifying the kernel. Modify the/etc/rc. d/rc. local file as follows.

Add the following lines to the front comment of the file:

# Modify the Kernel shared memory size;

Echo 134217728>/proc/sys/kernel/shmmax;

# Note: The value here is half of the memory;

# If the system memory is 256 MB, the value is 134217728;

# If the system memory is 512 MB, the value is 268435456;

After modification, restart the machine.

By default, linxu's shared memory size seems to be 32 MB. I used ipcs to check the size of my machine before modification. There are 10 oracle segments. After modification, there will be only one. Oracle improves the data exchange speed in a memory segment.

 

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.