TimesTen专题:TimesTen邂逅925错误 :
开发人员反映说TimesTen的DataStore突然连不上了, 查看日志,发现一直在报错:
TT0925: Cannot create data store semaphores (Invalid argument)
查看TT配置文件,发现sys.odbc.info中的连接参数为默认值64.是有点小,不能真正发挥TT的强大功能。
于是想通过增加TT的并发连接数来提高TT的处理性能,将默认连接数修改为100后,执行如下命令:
- [timesten@db_test info]$ ttDaemonAdmin -stop
- [timesten@db_test info]$ ttDaemonAdmin -start
- [timesten@db_test info]$ ttisql tt_utf8db
- Copyright (c) 1996-2011, Oracle. All rights reserved.
- Type ? or "help" for help, type "exit" to quit ttIsql.
- connect "DSN=tt_utf8db";
- 925: Cannot create data store semaphores (Invalid argument)
- The command failed.
- Done.
|
第一反应,可能是kernel的一些配置不对了,但是查看 kernel.shmmax, kernel.shmall都正常。
然后开始搜索有关linux的kernel配置, 发现semaphores跟kernel.sem有关。
查看本机的 kernel.sem, 配置是 kernel.sem="250 32000 100 128"
将其修改为kernel.sem="512 32000 100 256"
同时修改 /etc/sysctl.conf, 保存。
再执行ttisql, 能够正常连接, 问题解决。
- [timesten@db_test info]$ ttisql tt_utf8db
- Copyright (c) 1996-2011, Oracle. All rights reserved.
- Type ? or "help" for help, type "exit" to quit ttIsql.
- connect "DSN=tt_utf8db";
- Connection successful: DSN=tt_utf8db;UID=timesten;DataStore=/data0/timesten/datastore/utf8db/utf8db;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;DRIVER=/data0/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=100;TempSize=32;Connections=357;CkptFrequency=120;CkptLogVolume=0;TypeMode=0;OracleNetServiceName=utf8db;
- (Default setting AutoCommit=1)
- Command> quit
- Disconnecting...
- Done.
|
当把参数设置为kernel.sem = 4096 524288 200 256进行连接测试,TT可支持的最大并发连接数为Connections=2000.
- # sysctl -p
- net.ipv4.ip_forward = 0
- net.ipv4.conf.default.rp_filter = 1
- net.ipv4.conf.default.accept_source_route = 0
- kernel.sysrq = 0
- kernel.core_uses_pid = 1
- net.ipv4.tcp_syncookies = 1
- kernel.msgmnb = 65536
- kernel.msgmax = 65536
- kernel.shmmax = 4294967295
- kernel.shmall = 268435456
- fs.file-max = 6815744
- fs.aio-max-nr = 1048576
- kernel.shmall = 2097152
- kernel.shmmax = 2147483648
- kernel.shmmni = 4096
- kernel.sem = 4096 524288 200 256
- net.ipv4.ip_local_port_range = 9000 65500
- net.core.rmem_default = 4194304
- net.core.rmem_max = 4194304
- net.core.wmem_default = 262144
- net.core.wmem_max = 1048576
|
执行如下命令:
- $ ttisql tt_workshop
- Copyright (c) 1996-2011, Oracle. All rights reserved.
- Type ? or "help" for help, type "exit" to quit ttIsql.
- connect "DSN=tt_workshop";
- Connection successful: DSN=tt_workshop;UID=timesten;DataStore=/data0/timesten/datastore/tt_workshop/;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=US7ASCII;DRIVER=/data0/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=100;TempSize=32;Connections=2000;CkptFrequency=120;CkptLogVolume=0;TypeMode=0;OracleNetServiceName=mytest;
- (Default setting AutoCommit=1)
- Command>
|
kernel.sem的几个值的具体含义如下:
- kernel.sem = SEMMSL SEMMNS SEMOPM SEMMNI
-
- SEMMSL :Maximum number of semaphores per set
- 每个信号对象集的最大信号对象数;
- SEMMNS :Maximum number of semaphores system-wide
- 系统范围内最大信号对象数;
- SEMOPM :Maximum number of operations per set
- 每个信号对象支持的最大操作数;
- SEMMNI :Maximum number of semaphore identifiers
- 系统范围内最大信号对象集数。
- 其中 SEMMNS的值等于 SEMMSL*SEMMNI。
|