2011-10-10 46 views
1

首先,我对web开发比较陌生。mysqld在负载下间歇重启

在合理的负载(500-700 Q/S)的服务器频繁重启(有时是每小时),并且每次发生时,我得到了按照我的系统日志。我没有得到任何输出到mysql.err或mysql/error.log

这是我第一次真正的mysql设置,所以我确定有很多可以改进,但我很惊讶,服务器实际上是经常下降。该机器有4GB的RAM。感谢您的任何建议或帮助!

的Ubuntu 10.04中,MySQL是从清醒包。 版14.14 DISTRIB 5.1.41,为Debian的Linux-GNU(x86_64的)使用readline的6.1

Oct 10 01:45:33 host init: mysql main process (1199) terminated with status 1 
Oct 10 01:45:33 host init: mysql main process ended, respawning 
Oct 10 01:45:42 host /etc/mysql/debian-start[1644]: Upgrading MySQL tables if necessary. 
Oct 10 01:45:42 host /etc/mysql/debian-start[1648]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored 
Oct 10 01:45:42 host /etc/mysql/debian-start[1648]: Looking for 'mysql' as: /usr/bin/mysql 
Oct 10 01:45:42 host /etc/mysql/debian-start[1648]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck 
Oct 10 01:45:42 host /etc/mysql/debian-start[1648]: This installation of MySQL is already upgraded to 5.1.41, use --force if you still need to run mysql_upgrade 
Oct 10 01:45:42 host /etc/mysql/debian-start[1656]: Checking for insecure root accounts. 
Oct 10 01:45:43 host /etc/mysql/debian-start[1672]: Triggering myisam-recover for all MyISAM tables 

这里是我的my.cnf:

[client] 
port   = 3306 
socket   = /var/run/mysqld/mysqld.sock 
[mysqld] 

user   = mysql 
socket   = /var/run/mysqld/mysqld.sock 
port   = 3306 
basedir   = /usr 
datadir   = /var/lib/mysql 
tmpdir   = /tmp 
skip-external-locking 
bind-address   = host 
back_log = 50 
max_connections = 100 
max_connect_errors = 10 
table_open_cache = 2048 
max_allowed_packet = 16M 
binlog_cache_size = 1M 
max_heap_table_size = 64M 
sort_buffer_size = 8M 
join_buffer_size = 8M 
thread_cache_size = 8 
thread_concurrency = 8 
query_cache_size = 64M 
query_cache_limit = 2M 
ft_min_word_len = 4 
default-storage-engine = innodb 
default-character-set = utf8 
thread_stack = 192K 
transaction_isolation = REPEATABLE-READ 
tmp_table_size = 32M 
log-bin=trent-bin 
binlog_format=mixed 
slow_query_log 
long_query_time = 2 
server-id = 1 
key_buffer_size = 32M 
read_buffer_size = 2M 
read_rnd_buffer_size = 16M 
bulk_insert_buffer_size = 64M 
myisam_sort_buffer_size = 128M 
myisam_max_sort_file_size = 10G 
myisam_repair_threads = 1 
myisam_recover 
innodb_additional_mem_pool_size = 16M 
innodb_buffer_pool_size = 2800M 
innodb_data_file_path = ibdata1:100M:autoextend 
innodb_file_per_table 
innodb_file_io_threads = 4 
innodb_thread_concurrency = 8 
innodb_flush_log_at_trx_commit = 2 
innodb_log_buffer_size = 4M 
innodb_log_file_size = 256M 
innodb_log_files_in_group = 3 
innodb_max_dirty_pages_pct = 90 
innodb_flush_method=O_DIRECT 
innodb_lock_wait_timeout = 50 

ssl-ca=/etc/mysql/cacert.pem 
ssl-cert=/etc/mysql/server-cert.pem 
ssl-key=/etc/mysql/server-key.pem 

[mysqldump] 

quick 

max_allowed_packet = 16M 

[mysql] 
no-auto-rehash 

[myisamchk] 
key_buffer_size = 512M 
sort_buffer_size = 512M 
read_buffer = 8M 
write_buffer = 8M 

[mysqlhotcopy] 
interactive-timeout 

[mysqld_safe] 
open-files-limit = 8192 
+0

您可能在[服务器故障](http://serverfault.com/)上的这个问题上运气更好。 –

+0

你看过'cat/var/log/syslog | grep mysql'? – methodin

+0

更新 - 问题是由客户端和服务器之间的SSL造成的。我假设如果要求cpus,这将是一个非常稳定的事情,但显然不是这种情况。如果我们找出永久性修复,我会更新。感谢指向服务器故障的指针。 – mike

回答

0

我已经看到mysql的行为这种方式几次也有很多潜在的原因..:到investigatem我会检查

1)那里,你已经写了,可能是内存泄漏的任何自定义的功能呢?我曾经看到一个中间功能,自定义编写的关于MySQL 5,导致重新启动,如果它是由两个同时运行查询...

2)如果你优化的表,这是否减少重启次数?

3)在DB therea纽约被破坏的表?