oracle11g-RHEL5.8-Kernel Parameters and Resource Limits
Configuring Kernel Parameters and Resource Limits
1、内核参数修改:
Verify that the kernel parameters shown in the following table are set to values greater than or equal to the minimum value shown. The procedure following the table describes how to verify and set the values.
Note:(最小参数值参考)
The kernel parameter and shell limit values in this section are minimum values only. For production database systems, Oracle recommends that you tune these values to optimize the performance of the system. Refer to your operating system documentation for more information about tuning kernel parameters.Parameter | Minimum Value | File |
---|---|---|
semmsl
|
250
32000 100 128 |
/proc/sys/kernel/sem |
shmall |
2097152 | /proc/sys/kernel/shmall |
shmmax |
Minimum: 536870912
Maximum: A value that is 1 byte less than the physical memory Recommended: More than half the physical memory See My Oracle Support Note 567506.1 for additional information about configuring |
/proc/sys/kernel/shmmax |
shmmni |
4096 | /proc/sys/kernel/shmmni |
file -max |
6815744 | /proc/sys/fs/file-max |
ip_local_port_range |
Minimum: 9000
Maximum: 65500 |
/proc/sys/net/ipv4/ip_local_port_range |
rmem_default |
262144 | /proc/sys/net/core/rmem_default |
rmem_max |
4194304 | /proc/sys/net/core/rmem_max |
wmem_default |
262144 | /proc/sys/net/core/wmem_default |
wmem_max |
1048576 | /proc/sys/net/core/wmem_max |
aio-max-nr |
1048576
Note: This value limits concurrent outstanding requests and should be set to avoid I/O subsystem failures. |
/proc/sys/fs/aio-max-nr |
Note:
If the current value of any parameter is higher than the value listed in this table, then do not change the value of that parameter.To view the current value specified for these kernel parameters, and to change them if necessary:
-
Enter commands similar to the following to view the current values of the kernel parameters:
Note:(使用下面的命令查看当前系统的内核参数值)
Make a note of the current values and identify any values that you must change.Parameter Command semmsl
,semmns
,semopm
, andsemmni
# /sbin/sysctl -a | grep sem
This command displays the value of the semaphore parameters in the order listed.
shmall
,shmmax
, andshmmni
# /sbin/sysctl -a | grep shm
file-max
# /sbin/sysctl -a | grep file-max
ip_local_port_range
# /sbin/sysctl -a | grep ip_local_port_range
rmem_default
# /sbin/sysctl -a | grep rmem_default
rmem_max
# /sbin/sysctl -a | grep rmem_max
wmem_default
# /sbin/sysctl -a | grep wmem_default
wmem_max
# /sbin/sysctl -a | grep wmem_max
If the value of any kernel parameter is different from the recommended value, then complete the following steps:
(如果你当前系统的内核参数值与列表中的参考值不一致,则需要按下列步骤修改)
-
Using any text editor, create or edit the
/etc/sysctl.conf
file, and add or edit lines similar to the following:Note:
Include lines only for the kernel parameter values to change. For the semaphore parameters (kernel.sem
), you must specify all four values. However, if any of the current values are larger than the minimum value, then specify the larger value.按下列值修改系统参数,如果参数值高于下面给定的值,则不用修改,没有的值需要手动添加进去)。
fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576
-
By specifying the values in the
/etc/sysctl.conf
file, they persist when you restart the system. However, on SUSE Linux Enterprise Server systems, enter the following command to ensure that the system reads the/etc/sysctl.conf
file when it restarts:(修改的sysctl.conf在系统启动后也生效,但是在SUSE Linux下需要执行下面的命令来保证系统启动时去读取该文件)# /sbin/chkconfig boot.sysctl on
-
Enter the following command to change the current values of the kernel parameters:
# /sbin/sysctl -p(执行该命令以使上述配置文件生效,不需要重启系统)
Review the output from this command to verify that the values are correct. If the values are incorrect, edit the /etc/sysctl.conf file, then enter this command again.
-
Enter the command
/sbin/sysctl -a
to confirm that the values are set correctly.(使用该命令以确定内核参数值正确无误) -
On SUSE systems only, enter the following command to cause the system to read the
/etc/sysctl.conf
file when it restarts:# /sbin/chkconfig boot.sysctl on(在SUSE Linux系统下需要执行该命令)
-
On SUSE systems only, you must enter the GID of the oinstall group as the value for the parameter
/proc/sys/vm/hugetlb_shm_group
. Doing this grants members of oinstall a group permission to create shared memory segments.For example, where the oinstall group GID is 501:
# echo 501 > /proc/sys/vm/hugetlb_shm_group
After running this command, use
vi
to add the following text to/etc/sysctl.conf
, and enable theboot.sysctl
script to run on system restart:vm.hugetlb_shm_group=501
Note:
Only one group can be defined as thevm.hugetlb_shm_group
. -
After updating the values of kernel parameters in the
/etc/sysctl.conf
file, either restart the computer, or run the commandsysctl -p
to make the changes in the/etc/sysctl.conf
file available in the active kernel memory.
2、检查资源限定
Check Resource Limits for the Oracle Software Installation Users
For each installation software owner, check the resource limits for installation, using the following recommended ranges:
Table 1 Installation Owner Resource Limit Recommended Ranges(参数值列表)
Resource Shell Limit | Resource | Soft Limit | Hard Limit |
---|---|---|---|
Open file descriptors |
nofile |
at least 1024 |
at least 65536 |
Number of processes available to a single user |
nproc |
at least 2047 |
at least 16384 |
Size of the stack segment of the process |
stack |
at least 10240 KB |
at least 10240 KB, and at most 32768 KB |
To check resource limits:
-
Log in as an installation owner.(按下列步骤使用相关命令来检查资源限定值)
-
Check the soft and hard limits for the file descriptor setting. Ensure that the result is in the recommended range. For example:
$ ulimit -Sn 4096 $ ulimit -Hn 65536
-
Check the soft and hard limits for the number of processes available to a user. Ensure that the result is in the recommended range. For example:
$ ulimit -Su 2047 $ ulimit -Hu 16384
-
Check the soft limit for the stack setting. Ensure that the result is in the recommended range. For example:
$ ulimit -Ss 10240 $ ulimit -Hs 32768
-
Repeat this procedure for each Oracle software installation owner.
If necessary, update the resource limits in the /etc/security/limits.conf
configuration file for the installation owner. However, note that the configuration file is distribution specific. Contact your system administrator for distribution specific configuration file information.
Note:
If thegrid
or oracle
users are logged in, then changes in the limits.conf file do not take effect until you log these users out and log them back in. You must do this before you use these accounts for installation.