V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zhttty
V2EX  ›  问与答

求助:mysql每用一段时间就会挂掉,是怎么回事?

  •  
  •   zhttty · 2013-12-26 10:10:20 +08:00 · 8090 次点击
    这是一个创建于 3767 天前的主题,其中的信息可能已经有所发展或是发生改变。
    centos6.4 32位 lamp架构

    # service mysqld status
    查看mysqld状态时候提示:mysqld 已死,但是 subsys 被锁

    tail -n 10 /var/log/mysqld.log
    查看mysqld日志里边:InnoDB: Error: pthread_create returned 11

    已改my.cnf的配置如下:
    [client]
    port = 3306
    socket = /var/lib/mysql/mysql.sock

    [mysqld]
    port = 3306
    socket = /var/lib/mysql/mysql.sock
    skip-locking
    key_buffer_size = 256M
    max_allowed_packet = 1M
    table_open_cache = 256
    sort_buffer_size = 1M
    read_buffer_size = 1M
    read_rnd_buffer_size = 4M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size= 16M
    thread_concurrency = 8

    log-bin=mysql-bin

    binlog_format=mixed

    server-id = 1

    [mysqldump]
    quick
    max_allowed_packet = 16M

    [mysql]
    no-auto-rehash

    [myisamchk]
    key_buffer_size = 128M
    sort_buffer_size = 128M
    read_buffer = 2M
    write_buffer = 2M

    [mysqlhotcopy]
    interactive-timeout

    已改limits.conf配置如下:
    * soft nofile 65536
    * hard nofile 65536

    已经在 /etc/rc.local 添加:
    echo 8061540 > /proc/sys/fs/file-max

    /proc/sys/vm/max_map_count 的值是65530

    但是,一样会不定期的出现:
    mysqld 已死,但是 subsys 被锁;
    Error: pthread_create returned 11;
    一旦出现后,简单的service mysqld restart可以使mysql正常使用大概几分钟,然后不一会又重复这个错误,只有重启服务器后才能稳定运行几天,接着又不定期出现上面错误。
    3 条回复    2016-10-01 09:57:48 +08:00
    jiuzhe
        1
    jiuzhe  
       2013-12-27 13:46:45 +08:00
    关注,我的一个阿里云主机上的mysql也有类似的问题
    laodao
        2
    laodao  
       2016-03-16 23:11:38 +08:00
    楼主找到问题了吗
    MonkTang
        3
    MonkTang  
       2016-10-01 09:57:48 +08:00
    有同样的问题,楼主解决了吗?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2452 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 01:07 · PVG 09:07 · LAX 18:07 · JFK 21:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.