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
- 凯发app官方网站 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
- 凯发app官方网站 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
- 凯发app官方网站 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。
阅读(5612) | 评论(0) | 转发(1) |