How to set LINUX shared memory

Source: Internet
Author: User
The following error occurs when installing ipvsdb for LINUX shared memory: [IPVs @ localhost ~] $/Usr/local/pgsql/bin/postmaster-D/usr/local/pgsql/dataFATAL: couldnotcreatesharedmemorysegment: invalid...
The following error occurs when installing ipvsdb for LINUX shared memory: [IPVs @ localhost ~] $/Usr/local/pgsql/bin/postmaster-D/usr/local/pgsql/dataFATAL: cocould not create shared memory segment: invalid parameter DETAIL: failed system call was shmget (key = 5432001, size = 38076416,036 00 ). HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. you can either reduce the request size or reconfigure the kernel with larger SHMMAX. to redu Ce the request size (currently 38076416 bytes), reduce PostgreSQL's shared_buffers parameter (currently 4096) and/or its max_connections parameter (currently 100 ). www.2cto.com If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or recycling SHMMIN is called. the PostgreSQL documentation contains mo Re information about shared memory configuration. Solution: www.2cto.com 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 @ neirongroot] # echo 1073741824>/proc/sys/kernel/shmmax [root @ neirongroot] # more/proc/sys/kernel/shmmax 1073741824 is set 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 to the file. shmmax = 1073741824 this change takes effect after the system is restarted. 1. set the SHMMAX parameter to define 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. ORA-27123: unableto attach to shared memory segment you can determine the value of SHMMAX by executing the following command: # The default value of cat/proc/sys/kernel/shmmax www.2cto.com 33554432 SHMMAX is 32 MB. I generally set the SHMMAX parameter to 2 GB using one of the following methods: by directly changing the/proc file system, you can change the SHMMAX default setting without restarting the machine. The method I use is to put the following command into/etc/rc. in the local startup File: #> echo "2147483648">/proc/sys/kernel/shmmax, you can also use the sysctl command to change the value of SHMMAX: # sysctl-w kernel. shmmax = 2147483648 last, insert the kernel parameter to/etc/sysctl. in the 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 run the following command to determine the SHMMNI value: # 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 www.2cto.com ceil (SHMMAX/PAGE_SIZE) SHMALL. the default size is 2097152. you can use the following command to query: # The default settings of cat/proc/sys/kernel/shmall 2097152 SHMALL 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.
 

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.