TimesTen专题:TimesTen邂逅925错误

TimesTen专题:TimesTen邂逅925错误 :
 
开发人员反映说TimesTen的DataStore突然连不上了, 查看日志,发现一直在报错:
TT0925: Cannot create data store semaphores (Invalid argument)
 
查看TT配置文件,发现sys.odbc.info中的连接参数为默认值64.是有点小,不能真正发挥TT的强大功能。
于是想通过增加TT的并发连接数来提高TT的处理性能,将默认连接数修改为100后,执行如下命令:

  1. [timesten@db_test info]$ ttDaemonAdmin -stop
  2. [timesten@db_test info]$ ttDaemonAdmin -start
  3. [timesten@db_test info]$ ttisql tt_utf8db
  4. Copyright (c) 1996-2011, Oracle. All rights reserved.
  5. Type ? or "help" for help, type "exit" to quit ttIsql.
  6. connect "DSN=tt_utf8db";
  7. 925: Cannot create data store semaphores (Invalid argument)
  8. The command failed.
  9. 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, 能够正常连接, 问题解决。

  1. [timesten@db_test info]$ ttisql tt_utf8db
  2. Copyright (c) 1996-2011, Oracle. All rights reserved.
  3. Type ? or "help" for help, type "exit" to quit ttIsql.
  4. connect "DSN=tt_utf8db";
  5. 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;
  6. (Default setting AutoCommit=1)
  7. Command> quit
  8. Disconnecting...
  9. Done.

 

当把参数设置为kernel.sem = 4096 524288 200 256进行连接测试,TT可支持的最大并发连接数为Connections=2000.

  1. # sysctl -p
  2. net.ipv4.ip_forward = 0
  3. net.ipv4.conf.default.rp_filter = 1
  4. net.ipv4.conf.default.accept_source_route = 0
  5. kernel.sysrq = 0
  6. kernel.core_uses_pid = 1
  7. net.ipv4.tcp_syncookies = 1
  8. kernel.msgmnb = 65536
  9. kernel.msgmax = 65536
  10. kernel.shmmax = 4294967295
  11. kernel.shmall = 268435456
  12. fs.file-max = 6815744
  13. fs.aio-max-nr = 1048576
  14. kernel.shmall = 2097152
  15. kernel.shmmax = 2147483648
  16. kernel.shmmni = 4096
  17. kernel.sem = 4096 524288 200 256
  18. net.ipv4.ip_local_port_range = 9000 65500
  19. net.core.rmem_default = 4194304
  20. net.core.rmem_max = 4194304
  21. net.core.wmem_default = 262144
  22. net.core.wmem_max = 1048576

 

执行如下命令:

  1. $ ttisql tt_workshop
  2. Copyright (c) 1996-2011, Oracle. All rights reserved.
  3. Type ? or "help" for help, type "exit" to quit ttIsql.
  4. connect "DSN=tt_workshop";
  5. 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;
  6. (Default setting AutoCommit=1)
  7. Command>

 

kernel.sem的几个值的具体含义如下:

  1. 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。

你可能感兴趣的:(配置文件,create,store,专题,邂逅)