我的mysql 常常當了...救救我

這個版面主要討論 debian 在 server 端的應用問題, server 種類繁多..舉凡 Web Server 、 File Server、 DHCP Server..等等。

版主: 阿信

我的mysql 常常當了...救救我

文章kelyiu3000 » 週三 1月 30, 2008 5:43 pm

不知道是不是太多人在使用mysql
我的mysql server 常當了
是我的ram 不足嗎?
我的是cpu 2.4g 1g ram
沒開swap..
多人在線後的一段時間便會當了
我的my.cnf

query_cache_type = 3
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log = /var/log/mysql.log
#log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
#log-slow-queries = /var/log/mysql/mysql-slow.log
#
# The following can be used as easy to replay backup logs or for replication.
#server-id = 1
log-bin = /var/log/mysql/mysql-bin.log
# See /etc/mysql/debian-log-rotate.conf for the number of files kept.
max_binlog_size = 104857600
#binlog-do-db = include_database_name
#binlog-ignore-db = include_database_name
#
# * BerkeleyDB
#
# According to an MySQL employee the use of BerkeleyDB is now discouraged
# and support for it will probably cease in the next versions.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# If you want to enable SSL support (recommended) read the manual or my
# HOWTO in /usr/share/doc/mysql-server/SSL-MINI-HOWTO.txt.gz
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet = 16M
default-character-set = big5

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
default-character-set = big5

[isamchk]
key_buffer = 160M
kelyiu3000
可愛的小學生
可愛的小學生
 
文章: 19
註冊時間: 週二 5月 08, 2007 6:16 pm

文章redjoe » 週三 1月 30, 2008 7:01 pm

要看mysql的訊息

/var/log/mysql.err
/var/log/mysql.log
redjoe
快樂的大學生
快樂的大學生
 
文章: 518
註冊時間: 週一 4月 07, 2003 10:15 pm
來自: Taiwan

文章kelyiu3000 » 週三 1月 30, 2008 10:51 pm

/var/log/mysql.err
/var/log/mysql.log

都是0kb.....= =
kelyiu3000
可愛的小學生
可愛的小學生
 
文章: 19
註冊時間: 週二 5月 08, 2007 6:16 pm

文章ulbt » 週四 1月 31, 2008 2:12 am

你 po 的 my.cnf...

代碼: 選擇全部
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log = /var/log/mysql.log
#log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)


#log = /var/log/mysql.log
#log = /var/log/mysql/mysql.log
log 是關掉的。(因為影響效能, Debian 預設是關閉的)

然後下一句 "Error logging goes to syslog."
So, check /var/log/syslog
I know that I don't know.
頭像
ulbt
活潑的高中生
活潑的高中生
 
文章: 255
註冊時間: 週一 2月 17, 2003 12:55 pm
來自: Nei-Hu, Taipei.

文章kelyiu3000 » 週四 1月 31, 2008 7:19 pm

Jan 31 19:02:41 proita mysqld_safe[18060]: started
Jan 31 19:02:41 proita mysqld[18063]: 080131 19:02:41 InnoDB: Database was not shut down normally!
Jan 31 19:02:41 proita mysqld[18063]: InnoDB: Starting crash recovery.
Jan 31 19:02:41 proita mysqld[18063]: InnoDB: Reading tablespace information from the .ibd files...
Jan 31 19:02:41 proita mysqld[18063]: InnoDB: Restoring possible half-written data pages from the doublewrite
Jan 31 19:02:41 proita mysqld[18063]: InnoDB: buffer...
Jan 31 19:02:41 proita mysqld[18063]: 080131 19:02:41 InnoDB: Starting log scan based on checkpoint at
Jan 31 19:02:41 proita mysqld[18063]: InnoDB: log sequence number 0 2555949.
Jan 31 19:02:41 proita mysqld[18063]: InnoDB: Doing recovery: scanned up to log sequence number 0 2555995
Jan 31 19:02:41 proita mysqld[18063]: InnoDB: Last MySQL binlog file position 0 79, file name /var/log/mysql/mysql-bin.042991
Jan 31 19:02:41 proita mysqld[18063]: 080131 19:02:41 InnoDB: Flushing modified pages from the buffer pool...
Jan 31 19:02:41 proita mysqld[18063]: 080131 19:02:41 InnoDB: Started; log sequence number 0 2555995
Jan 31 19:02:41 proita mysqld[18063]: /usr/sbin/mysqld: ready for connections.
Jan 31 19:02:41 proita mysqld[18063]: Version: '4.1.11-Debian_4sarge8-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Source distribution
Jan 31 19:02:42 proita /etc/mysql/debian-start[18096]: Checking for crashed MySQL tables.
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: WARNING: mysqlcheck has found corrupt tables
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita.cdb_client
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita.cdb_failedlogins
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita.cdb_members
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita.cdb_onlinetime
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita.cdb_rndevent
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita.cdb_stats
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita.cdb_stock
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita_host.phpstat_alexa
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita_host.phpstat_day_data
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita_host.phpstat_ip
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita_host.phpstat_ip_limit
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita_upload.cronlogs
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita_upload.crontabs
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita_upload.files
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: proita_upload.users
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: vhcs2.domain_traffic
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: vhcs2.server_traffic
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: warning : 1 client is using or hasn't closed the table properly
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]:
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: Improperly closed tables are also reported if clients are accessing
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: the tables *now*. A list of current connections is below.
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]:
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: +----+------------------+-----------+----+---------+------+-------+------------------+
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: | Id | User | Host | db | Command | Time | State | Info |
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: +----+------------------+-----------+----+---------+------+-------+------------------+
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: | 5 | debian-sys-maint | localhost | | Query | 0 | | show processlist |
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: +----+------------------+-----------+----+---------+------+-------+------------------+
Jan 31 19:02:48 proita /etc/mysql/debian-start[18114]: Uptime: 7 Threads: 1 Questions: 611 Slow queries: 0 Opens: 586 Flush tables: 1 Open tables: 64 Queries per second avg: 87.286
kelyiu3000
可愛的小學生
可愛的小學生
 
文章: 19
註冊時間: 週二 5月 08, 2007 6:16 pm

文章damon » 週五 2月 01, 2008 1:53 pm

沒開swap,有一些怪現象也是很正常的
damon
活潑的高中生
活潑的高中生
 
文章: 358
註冊時間: 週二 9月 10, 2002 5:42 pm

文章kelyiu3000 » 週五 2月 01, 2008 11:55 pm

是swap 的問題?? :-o
開swap會損耗硬碟.....
kelyiu3000
可愛的小學生
可愛的小學生
 
文章: 19
註冊時間: 週二 5月 08, 2007 6:16 pm

文章一粒米 » 週三 2月 27, 2008 11:00 am

我的 mysql 也是常常 hang 住...
該怎麼解決呢...
是不是跑到休眠模式
叫不起來呀...
一粒米
可愛的小學生
可愛的小學生
 
文章: 4
註冊時間: 週三 2月 27, 2008 10:50 am

文章redjoe » 週五 2月 29, 2008 6:16 am

看log有開 InnoDB

InnoDB 是用在 10MB 的檔案,檔案大了可考慮關了,以減少mysql process。
redjoe
快樂的大學生
快樂的大學生
 
文章: 518
註冊時間: 週一 4月 07, 2003 10:15 pm
來自: Taiwan


回到 debian server

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客