Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Aug 2008
    Posts
    73

    Default MySQL gone crazy

    I have been looking at my shared server's "top" or "Show Current CPU Usage" for quite sometime now and the one thing that is always on top is the MySQL error pid. which is something like this


    Code:
     /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/etc/httpd/logs/mysqld.err --pid-file=/var/lib/mysql/server.server.com.pid
    Here is my my.cnf

    Code:
    [mysqld]
    max_allowed_packet=100M
    set-variable = max_connections=600
    safe-show-database
    # Connection timeout
    connect_timeout                   = 20
    
    # Timeout for inactive connections
    wait_timeout                      = 60
    
    # Network buffer length (I think this is the linux default)
    net_buffer_length                 = 16K
    log-error                         = /etc/httpd/logs/mysqld.err
    binlog_cache_size                 = 2M
    table_cache                       = 6588
    join_buffer_size                  = 320M
    tmp_table_size                    = 512M
    sort_buffer_size                  = 128M
    thread_cache_size                 = 6
    max_heap_table_size               = 320M
    query_cache_size                  = 312M
    key_buffer_size                   = 128M
    [client]
    socket=/var/lib/mysql/mysql.sock

    How can I optimize mySQL so that it doesnt end up using a lot of my CPU resources and slowing down a lot of work for my users?

    Thanks a lot for anyone who helps.

  2. #2
    Member
    Join Date
    Apr 2009
    Location
    United States
    Posts
    112
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: MySQL gone crazy

    Run MYSQL Tuner
    MySQLTuner

  3. #3
    Member
    Join Date
    Jun 2006
    Posts
    214

    Default Re: MySQL gone crazy

    And / or


    tuning-primer.sh
    Sundry MySQL Scripts and Docs

  4. #4
    Member
    Join Date
    Aug 2008
    Posts
    73

    Default Re: MySQL gone crazy

    Quote Originally Posted by johnburk View Post
    And / or


    tuning-primer.sh
    Sundry MySQL Scripts and Docs
    Thank you. That script is really awesome.

    How can I fix this? I got everything else working fine now.

    Code:
    MEMORY USAGE
    Max Memory Ever Allocated : 11.39 G
    Configured Max Per-thread Buffers : 262.86 G
    Configured Max Global Buffers : 450 M
    Configured Max Memory Limit : 263.30 G
    Physical Memory : 7.78 G
    
    nMax memory limit exceeds 90% of physical memory

  5. #5
    Member
    Join Date
    May 2010
    Posts
    321

    Default Re: MySQL gone crazy

    Quote Originally Posted by desiguru View Post
    Thank you. That script is really awesome.

    How can I fix this? I got everything else working fine now.

    Code:
    MEMORY USAGE
    Max Memory Ever Allocated : 11.39 G
    Configured Max Per-thread Buffers : 262.86 G
    Configured Max Global Buffers : 450 M
    Configured Max Memory Limit : 263.30 G
    Physical Memory : 7.78 G
    
    nMax memory limit exceeds 90% of physical memory
    Lower your max connections, That will remove the error, Its cause each connection is allocated a set amount of memory and your exceeding that.

Similar Threads & Tags
Similar threads

  1. mod security gone crazy after /var/lib/mysql restore
    By Silver_2000 in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 11-02-2009, 06:16 PM
  2. crazy mysql overload
    By Secret Agent in forum cPanel and WHM Discussions
    Replies: 11
    Last Post: 01-29-2007, 10:01 AM
  3. whm gone crazy! HELP
    By ephekt in forum New User Questions
    Replies: 9
    Last Post: 07-02-2006, 12:04 PM
  4. MySQL update goes crazy
    By anton_latvia in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-09-2005, 06:45 AM
  5. Mysql Character Error - Driving me CRAZY!
    By alrock in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-27-2004, 02:52 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube