zhttty
V2EX  ›  问与答

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

  •  
  •   zhttty · Dec 26, 2013 · 8936 views
    This topic created in 4525 days ago, the information mentioned may be changed or developed.
    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 replies    2016-10-01 09:57:48 +08:00
    jiuzhe
        1
    jiuzhe  
       Dec 27, 2013
    关注,我的一个阿里云主机上的mysql也有类似的问题
    laodao
        2
    laodao  
       Mar 16, 2016
    楼主找到问题了吗
    MonkTang
        3
    MonkTang  
       Oct 1, 2016
    有同样的问题,楼主解决了吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2877 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 11:01 · PVG 19:01 · LAX 04:01 · JFK 07:01
    ♥ Do have faith in what you're doing.