首先,我对网络开发相对较新。
在合理负载(500-700 Q / s)下,服务器经常重启(有时每小时一次),每次发生时我都会在syslog中得到以下内容。我没有得到任何输出到mysql.err或mysql / error.log
这是我的第一个真正的mysql设置,所以我确信有很多可以改进,但我很惊讶服务器实际上经常下降。这台机器有4GB的内存。感谢您的任何建议或帮助!
Ubuntu 10.04,mysql是来自清晰的软件包。 Ver 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 :(得分:0)
我看过mysql这样做几次,有很多可能的原因..:调查我会检查
1)您是否有任何可能是内存泄漏的自定义函数?我曾经看过一个中位函数,自定义写在mysql 5上,如果它是由两个同时运行的查询运行导致重启...
2)如果优化表格,这会降低重启频率吗?
3)数据库中是否存在任何损坏的表?