- 论坛徽章:
- 0
|
数据库服务器环境:
系统CentOS release 5.2 (Final
CPU: Xeon(R) E5405 @ 2.00GHz双 四核
MEM:4G
mysql:Ver 5.0.51b-log
my.cnf 配置
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
skip-name-resolve
back_log = 500
key_buffer = 384M
max_allowed_packet = 8M
thread_stack = 256K
table_cache = 1024
tmp_table_size = 128M
max_heap_table_size = 128M
sort_buffer_size = 4M
read_buffer_size = 6M
join_buffer_size = 8M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 64
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
set-variable=max_connections=800
max_connect_errors = 5000
wait_timeout = 10
long_query_time = 2
log-slow-queries = /tmp/mysql_slow.log
log-queries-not-using-indexes
[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 77824
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) 5000
open files (-n) 65535
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 20
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
# cat /etc/security/limits.conf 内容:
#* hard nofile 65535
#* soft nofile 65535
mysql> show variables like "%open%";
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| have_openssl | NO |
| innodb_open_files | 300 |
| open_files_limit | 4906 |
+-------------------+-------+
3 rows in set (0.00 sec)
状况:每当服务器流量高的时候 连接不上数据库,并在本地登录时候业报同样的错误:
FATAL: error 1135: Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug
使用 sysbac 测试:每次 --num-threads=12 值超过 12 个就报上面的错
# sysbench --debug=off --test=oltp --mysql-host=localhost --mysql-user=test --mysql-password=test --oltp-table-size=1000000 --mysql-db=test --oltp-table-name=stest --num-threads=13 --max-requests=10 --oltp-auto-inc=off --mysql-engine-trx=yes run
sysbench 0.4.12: multi-threaded system evaluation benchmark
No DB drivers specified, using mysql
FATAL: unable to connect to MySQL server, aborting...
FATAL: error 1135: Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug
FATAL: failed to connect to database server!
FATAL: thread#10: failed to connect to database server, aborting...
请高手帮忙 这问题
[ 本帖最后由 gron 于 2009-9-28 17:42 编辑 ] |
|