Linux 下 Oracle 内核参数优化
Linux 下 Oracle 内核参数优化
数据库的性能优化涉及到整个数据库运行环境的方方面面,诸如操作系统,Oracle自身,存储,网络等等几个大块。而操作系统则是Oracle稳定运行与最大化性能的基石。本文主要描述基于Linux系统下 Oracle 内核参数的配置。
校验下面的列表中显示的内核参数的值被设置为大于或等于下面所显示的最小值。
如果你的系统中下面的任意参数的当前值已经大于或高于下面列出的值,请不要做任何修改。
下面的步骤给出了如何去校验并设置这些参数的值。
通过执行下面的命令进行校验
/sbin/sysctl -a | egrep "kernel.shmall|kernel.shmmax|kernel.shmmn|kernel.sem"
然后比较下表所列出的值
注意:下表显示的是内核参数以及shell 限制所需的最小值。对于生产数据库,Oracle建议去调整这些值使得数据库性能达到最优。有关优化内核参数更多信息请参考操作系统相关文档。
Oracle 内核参数参考值
Parameter |
Minimum Value |
Recommended value |
File |
semmsl semmns semopm semmni |
250 32000 100 128 |
Set only if those that are set by OS or other applications are lower |
/proc/sys/kernel/sem |
shmall |
2097152 |
shmmax/page_size |
/proc/sys/kernel/shmall |
shmmax |
Minimum of the following values: · Half the size of the memory · 4GB - 1 byte Note: The minimum value required for shmmax is 0.5 GB. However, Oracle recommends that you set the value of shmmax to 2.0 GB for optimum performance of the system. |
Half of RAM or if swap file is less then half of RAM the size of swap file |
/proc/sys/kernel/shmmax |
shmmni |
4096 |
/proc/sys/kernel/shmmni |
|
file-max |
512 * PROCESSES |
/proc/sys/fs/file-max |
|
ip_local_port_range |
Minimum:9000 Maximum: 65000 |
/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 |
|
tcp_wmem |
262144 |
/proc/sys/net/ipv4/tcp_wmem |
|
tcp_rmem |
4194304 |
/proc/sys/net/ipv4/tcp_rmem |
校验内核参数
按照下面的步骤去查看指定参数的值,如果有必要的话对其进行修改
执行下表中相应的命令来显示这些内核参数的值,并标记该参数的值是否需要修改。
Parameter |
Command |
semmsl, semmns, semopm, and semmni |
# /sbin/sysctl -a | grep sem This command displays the value of the semaphore parameters in the order listed. |
shmall, shmmax, and shmmni |
# /sbin/sysctl -a | grep shm This command displays the details of the shared memory segment sizes. |
file-max |
# /sbin/sysctl -a | grep file-max This command displays the maximum number of file handles. |
ip_local_port_range |
# /sbin/sysctl -a | grep ip_local_port_range This command displays a range of port numbers. |
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 |
tcp_wmem |
# /sbin/sysctl -a | grep tcp_wmem |
tcp_rmem |
# /sbin/sysctl -a | grep tcp_rmem |
|
评论暂时关闭