免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: lys0212linux
打印 上一主题 下一主题

mysql无故重启 [复制链接]

论坛徽章:
9
每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00数据库技术版块每周发帖之星
日期:2016-03-07 16:30:25
11 [报告]
发表于 2010-09-09 13:01 |只看该作者
1、解决这样的问题,需要很扎实的mysql基础知识。

2、定期做个mysql性能监控报告,如mysqlreport mysql ...
todayhero 发表于 2010-09-09 10:17



    max_used_connection 414 只是历史最大并存连接数,并不能说明这个值是在崩溃的时候发生的。也不能用来作为认定大压力造成重启的依据。而且压力一大就重启,那mysql也太不可靠了。。
我的感觉是某种操作触发了mysql的一个bug,导致重启。

论坛徽章:
0
12 [报告]
发表于 2010-09-09 14:17 |只看该作者
本帖最后由 lys0212linux 于 2010-09-09 14:20 编辑

回复 10# todayhero


    [root@localhost data]# top

top - 14:16:43 up 180 days, 21:43,  1 user,  load average: 7.84, 7.98, 6.96
Tasks: 507 total,   4 running, 502 sleeping,   0 stopped,   1 zombie
Cpu(s): 29.0%us, 24.8%sy,  0.0%ni, 23.3%id, 21.3%wa,  0.2%hi,  1.4%si,  0.0%st
Mem:  16461432k total, 15897960k used,   563472k free,   105740k buffers
Swap: 16779852k total,   775344k used, 16004508k free, 12435324k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                
21620 mysql     20   0 2665m 1.0g 4936 S 64.9  6.3 149:48.04 mysqld            

top的情况如上。请教下有什么需要改进的地方?
再请教下,如何获取比较好的MYSQL检测报告?

论坛徽章:
0
13 [报告]
发表于 2010-09-09 22:29 |只看该作者
问题:
1、mysql只用了内存的6.3%?但是内存基本用满,把占内存的程序踢出数据库服务器,加大数据库缓存
2、mysql占用cpu过高,查询语句有问题

论坛徽章:
0
14 [报告]
发表于 2010-09-10 09:31 |只看该作者
我把sort_buffer_size和 read_buffer_size有原来的8M调为4M,key_buffer_size为512M,还是出现自动重启:再次贴出日志:
100910  5:10:25 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=536870912
read_buffer_size=4194304
max_used_connections=161
max_threads=1800
threads_connected=82
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 15288478 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x2a5e4000
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x457bf0e0 thread_stack 0x40000
/web/software/mysql/libexec/mysqld(my_print_stacktrace+0x24) [0x92cafd]
/web/software/mysql/libexec/mysqld(handle_segfault+0x2f3) [0x62ca0b]
/lib64/libpthread.so.0 [0x394d40e7c0]
/usr/local/lib/libunwind.so.7 [0x7fa6c612ceb6]
/usr/local/lib/libunwind.so.7 [0x7fa6c6129939]
/usr/local/lib/libunwind.so.7 [0x7fa6c6129794]
/usr/local/lib/libunwind.so.7 [0x7fa6c6129d11]
/usr/local/lib/libunwind.so.7 [0x7fa6c612a94d]
/usr/local/lib/libunwind.so.7(_ULx86_64_step+0x1d) [0x7fa6c612dc4d]
/usr/local/lib/libtcmalloc.so.0(GetStackTrace(void**, int, int)+0x92) [0x7fa6c636fa0e]
/usr/local/lib/libtcmalloc.so.0 [0x7fa6c635496c]
/usr/local/lib/libtcmalloc.so.0(malloc+0x29f) [0x7fa6c63710e5]
/web/software/mysql/libexec/mysqld(my_malloc+0x24) [0x91a91f]
/web/software/mysql/libexec/mysqld(alloc_root+0x77) [0x91afc7]
/web/software/mysql/libexec/mysqld(Item:perator new(unsigned long, st_mem_root*)+0x1d) [0x5812f9]
/web/software/mysql/libexec/mysqld(MYSQLparse(void*)+0x1d4f0) [0x67686a]
/web/software/mysql/libexec/mysqld(parse_sql(THD*, Parser_state*, Object_creation_ctx*)+0x4c) [0x634c86]
/web/software/mysql/libexec/mysqld(Prepared_statement::prepare(char const*, unsigned int)+0x32b) [0x6d91a3]
/web/software/mysql/libexec/mysqld(mysql_sql_stmt_prepare(THD*)+0x159) [0x6db9f3]
/web/software/mysql/libexec/mysqld(mysql_execute_command(THD*)+0x7c5) [0x63b389]
/web/software/mysql/libexec/mysqld(sp_instr_stmt::exec_core(THD*, unsigned int*)+0x1d) [0x7c51d3]
/web/software/mysql/libexec/mysqld(sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*)+0x112) [0x7c5a48]
/web/software/mysql/libexec/mysqld(sp_instr_stmt::execute(THD*, unsigned int*)+0x146) [0x7c5f46]
/web/software/mysql/libexec/mysqld(sp_head::execute(THD*)+0x3ee) [0x7c7692]
/web/software/mysql/libexec/mysqld(sp_head::execute_procedure(THD*, List<Item>*)+0x5fd) [0x7c807d]
/web/software/mysql/libexec/mysqld(mysql_execute_command(THD*)+0x69f6) [0x6415ba]
/web/software/mysql/libexec/mysqld(mysql_parse(THD*, char*, unsigned int, char const**)+0x27f) [0x64347f]
/web/software/mysql/libexec/mysqld(dispatch_command(enum_server_command, THD*, char*, unsigned int)+0xcab) [0x644aa7]
/web/software/mysql/libexec/mysqld(do_command(THD*)+0x146) [0x645d20]
/web/software/mysql/libexec/mysqld(handle_one_connection+0x156) [0x63469e]
/lib64/libpthread.so.0 [0x394d4064a7]
/lib64/libc.so.6(clone+0x6d) [0x394ccd3c2d]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x2b5b8f38 = REPLACE INTO tb_snatch_position_info_29  
                                                                 thd->thread_id=475431
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
mysqld: misc.cpp:103: int __cxa_pure_virtual(): Assertion `!"Aborted: pure virtual method called."' failed.
Fatal signal 6 while backtracing
100910 05:10:27 mysqld_safe Number of processes running now: 0
100910 05:10:27 mysqld_safe mysqld restarted
100910  5:10:27 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.
100910  5:10:27 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
100910  5:10:27  InnoDB: Started; log sequence number 0 44233
100910  5:10:27 [Warning] Storage engine 'SPHINX' has conflicting typecode. Assigning value 42.
100910  5:10:27 [Note] Recovering after a crash using mysql-bin
100910  5:10:32 [Note] Starting crash recovery...
100910  5:10:32 [Note] Crash recovery finished.
100910  5:10:32 [Warning] 'user' entry '@mysql.baicai.com' ignored in --skip-name-resolve mode.
100910  5:10:32 [Warning] 'user' entry 'ftpusers@*' ignored in --skip-name-resolve mode.
100910  5:10:32 [Warning] 'user' entry 'ftpusers@192.168.2.135,192.168.2.134,192.168.2.133' ignored in --skip-name-resolve mode.
100910  5:10:32 [Warning] 'db' entry 'ftpusers ftpusers@*' ignored in --skip-name-resolve mode.
100910  5:10:32 [Warning] 'db' entry 'ftpusers ftpusers@192.168.2.135,192.168.2.134,192.168.2.133' ignored in --skip-name-resolve mode.
100910  5:10:33 [Note] Event Scheduler: Loaded 0 events
100910  5:10:33 [Note] /web/software/mysql/libexec/mysqld: ready for connections.
Version: '5.1.50-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
100910  6:58:09 [ERROR] Got error 134 when reading table './jobui_snatch/tb_snatch_position_info_04'
100910  6:58:09 [ERROR] Got error 134 when reading table './jobui_snatch/tb_snatch_position_info_04'
100910  6:58:09 [ERROR] Got error 134 when reading table './jobui_snatch/tb_snatch_position_info_04'
100910  6:58:09 [ERROR] Got error 134 when reading table './jobui_snatch/tb_snatch_position_info_04'
100910  6:58:09 [ERROR] Got error 134 when reading table './jobui_snatch/tb_snatch_position_info_04'
100910  6:58:09 [ERROR] Got error 134 when reading table './jobui_snatch/tb_snatch_position_info_04'
100910  6:58:09 [ERROR] Got error 134 when reading table './jobui_snatch/tb_snatch_position_info_04'
100910  6:58:09 [ERROR] Got error 134 when reading table './jobui_snatch/tb_snatch_position_info_04'
100910  6:58:09 [ERROR] Got error 134 when reading table './jobui_snatch/tb_snatch_position_info_04'
100910  6:58:09 [ERROR] Got error 134 when reading table './jobui_snatch/tb_snatch_position_info_04'

论坛徽章:
0
15 [报告]
发表于 2010-09-10 11:12 |只看该作者
感觉是bug,因为压力大crash掉的错误跟这个不同,是不是压力大引发的bug,倒是有可能。建议仔细读slow log让他们都不slow了,使之压力不再大,看看还crash不。还有show processlist定时抓抓,看看crash之前到底数据库内部什么个状况。

论坛徽章:
0
16 [报告]
发表于 2010-09-10 12:04 |只看该作者
重启前那段时间mysql在进行一些压力大的操作,不知是不是这个问题引起的。slow log和show processlist还有什么办法?

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
17 [报告]
发表于 2010-09-10 12:32 |只看该作者
重启前那段时间mysql在进行一些压力大的操作
---------------------------------------------------压力大的时间或者重启的时间有规律么?如果有规律就利用一些脚本多收集点信息

论坛徽章:
0
18 [报告]
发表于 2010-09-10 14:33 |只看该作者
一般0点到早上6点都会进行一些压力大的操作,重启也多发生在0点到6点之间的某一个时间点

论坛徽章:
0
19 [报告]
发表于 2010-09-10 15:46 |只看该作者
如果用mysqlreport每隔10分钟采集一次mysql的信息,那么会生成大量的文档,如果处理这些文档的数据?
比如将数据提取出来制作成excel表,哪位有没有现成可用的脚本贡献出来?

论坛徽章:
0
20 [报告]
发表于 2010-09-13 18:18 |只看该作者
楼主的问题解决了吗
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP