linux主机一直tailf /var/log/message


Jun 24 11:36:59 localhost Server Administrator (Shared Library): 14691 0 - Data Engine  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded
Jun 24 11:36:59 localhost Server Administrator (Shared Library): 14697 0 - Data Engine  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded
Jun 24 11:36:59 localhost Server Administrator (Shared Library): 14703 0 - Data Engine  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded
Jun 24 11:36:59 localhost Server Administrator (Shared Library): 14709 0 - Data Engine  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded
Jun 24 11:36:59 localhost Server Administrator (Shared Library): 14715 0 - Data Engine  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded
Jun 24 11:37:00 localhost Server Administrator (Shared Library): 14721 0 - Data Engine  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded
Jun 24 11:37:00 localhost Server Administrator (Shared Library): 14726 0 - Data Engine  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded
Jun 24 11:37:00 localhost Server Administrator (Shared Library): 14726 0 - Data Engine  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded
Jun 24 11:37:00 localhost Server Administrator (Shared Library): 14732 0 - Data Engine  A semaphore set has to be created 
 

怀疑信号量内核参数有问题

[root@localhost ~]# cat /proc/sys/kernel/sem
250     32000   100     250

改成

[root@localhost ~]# cat /proc/sys/kernel/sem
1024    32000   100     2048

vim /etc/sysctl.conf

最后添加一行

kernel.sem =1024     32000   100     2048

然后sysctl -p生效cat /proc/sys/kernel/sem查看

 

man proc

/proc/sys/kernel/sem (since Linux 2.4)
              This file contains 4 numbers defining limits for System V IPC semaphores.  These fields are, in order:


              SEMMSL  The maximum semaphores per semaphore set.


              SEMMNS  A system-wide limit on the number of semaphores in all semaphore sets.


              SEMOPM  The maximum number of operations that may be specified in a semop(2) call.


              SEMMNI  A system-wide limit on the maximum number of semaphore identifiers.

 

 

[root@web147 ~]# cat /proc/sys/kernel/sem 
250     32000   32      128
我的是这样,仅供参考
第一列,表示每个信号集中的最大信号量数目。
第二列,表示系统范围内的最大信号量总数目。
第三列,表示每个信号发生时的最大系统操作数目。
第四列,表示系统范围内的最大信号集总数目。

 

 

信号量(Semaphore),有时被称为信号灯,是在多线程环境下使用的一种设施,它负责协调各个线程, 以保证它们能够正确、合理的使用公共资源。Semaphore就像可以容纳N人的房间,如果人不满就可以进去,如果人满了,就要等待有人出来。Semaphore的属性如下:

SEMMSL

含义:每个信号量set中信号量最大个数 设置:最小250;对于processes参数设置较大的系统建议设置为processes+10

SEMMNI

含义:linux系统信号量set最大个数 设置:最少128

SEMMNS

含义:linux系统中信号量最大个数 设置:至少32000;SEMMSL * SEMMNI

SEMOPM

含义:semop系统调用允许的信号量最大个数设置:至少100;或者等于SEMMSL

 

 

 

 

参考:

 


http://yusy1116.blog.163.com/blog/static/6467259220106821116449/


http://blog.csdn.net/leshami/article/details/8766256


 


sem其实是semaphores的缩写,查看当前设置
[Oracle@test oracle]$ cat /proc/sys/kernel/sem
250 32000 100 128
4个数据分别对应
SEMMSL SEMMNS SEMOPM SEMMNI


 


当oracle DB初始化参数文件中PROCESSES参数设置较大时,需要调整SEMAPHORES设置SEMMSL应该设置为服务器中各个实例中最大的PROCESSES参数+10,例如,当最大的PROCESSES参数为5000时,SEMMSL应设置为5010。




SEMMNS参数应设置为SEMMSL*SEMMNI,接上例SEMMSL为5010,SEMMNS参数应为(5010*128)=641280。


SEMOPM参数应设置与SEMMSL参数相同,接上例此处应设置为5010
更改当前SEMAPHORES参数设置:


vim /etc/sysctl.conf --开机启动加载内核参数


kernel.sem =5010 641280 5010 128
#sysctl -p    --加载生效




btw : 查看oracle 的最大连接数


select * from v$license;
自从实例启动以来,连接数据库的用户session的最大值(SESSIONS_HIGHWATER)和当前值(SESSIONS_CURRENT )

 

 

 

 

semaphore 超过限制导致 omsa 无法正常运行

近来遇到好几起硬件故障报警,原因是semaphore的使用超过系统限制,日志中出现大量的报错
"Server Administrator (Shared Library): 27260 0 - Data Engine A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded"
我使用 ipcs -s 列出正在使用的 semaphore, 然后使用 ipcs -s -i <id> 查看改 semaphore 被哪个进程占用了 (pid),然后 ps -ef | grep <pid>, 发现该进程不存在,换了好几个 semaphore id 都发现对应的pid不存在,显然是 semaphore 泄漏,进程死了,其使用的 semaphore 没有被释放。

在网上搜不到多少相关资料,想知道大家是否有遇到过同样的问题,有什么线索没有,因为我们很多机器都部署了 omsa 用来监控,但是大部分机器上都不会出现这种问题,想知道原因

 

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐