cpu load 100% mysql

Discussion in 'Server Operation' started by mesti, Dec 5, 2007.

  1. mesti

    mesti New Member

    I have a debian server with mysql 4.1
    1 gb ddr2 ram, intel 3.200 cpu
    cpu load always 100%

    please help..:)

    sorry for bad english.....
     
    Last edited: Dec 5, 2007
  2. mesti

    mesti New Member

    hmm

    my.cnf:
    Code:
    # * Basic Settings
    #
    user		= mysql
    pid-file	= /var/run/mysqld/mysqld.pid
    socket		= /var/run/mysqld/mysqld.sock
    port		= 3306
    basedir		= /usr
    datadir		= /var/lib/mysql
    tmpdir		= /tmp
    language	= /usr/share/mysql/english
    skip-external-locking
    #
    # localhost which is more compatible and is not less secure.
    #bind-address		= 127.0.0.1
    #
    # * Fine Tuning
    #
    key_buffer		= 32M
    max_allowed_packet	= 1G
    thread_stack		= 256K
    thread_cache_size	= 8
    max_connections        = 300
    table_cache            = 512
    thread_concurrency     = 20
    #
    # * Query Cache Configuration
    #
    query_cache_limit       = 16M
    query_cache_size        = 100K
    #
    # * Logging and Replication
    #
    # Both location gets rotated by the cronjob.
    # Be aware that this log type is a performance killer.
    #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
    long_query_time = 4
    log-queries-not-using-indexes
    #
    # The following can be used as easy to replay backup logs or for replication.
    # note: if you are setting up a replication slave, see README.Debian about
    #       other settings you may need to change.
    #server-id		= 1
    log_bin			= /var/log/mysql/mysql-bin.log
    # WARNING: Using expire_logs_days without bin_log crashes the server! See README.Debian!
    expire_logs_days	= 5
    max_binlog_size         = 100M
    #binlog_do_db		= include_database_name
    #binlog_ignore_db	= include_database_name
    
    mysqldump]
    quick
    quote-names
    max_allowed_packet	= 612M
    
    [mysql]
    #no-auto-rehash	# faster start of mysql but no tab completition
    
    [isamchk]
    key_buffer		= 128M
    
     
  3. mesti

    mesti New Member

    hmmm

    mysql> SHOW GLOBAL VARIABLES;
     

    Attached Files:

    Last edited: Dec 5, 2007
  4. falko

    falko Super Moderator Howtoforge Staff

    Please run
    Code:
    top
    and try to find out what's causing the load.
     
  5. mesti

    mesti New Member

    re

    mysql 100%
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Please try this:

    Code:
    key_buffer              = 512M
    max_allowed_packet      = 2M
    thread_stack            = 128K
    table_cache = 512
    sort_buffer_size = 2M
    read_buffer_size = 2M
    read_rnd_buffer_size = 8M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    thread_concurrency = 4
    wait_timeout = 180
    #
    # * Query Cache Configuration
    #
    query_cache_limit       = 1048576
    query_cache_size        = 128M
    query_cache_type        = 1
     
  7. mesti

    mesti New Member

    re

    somewhat better ,but yet not perfect the load
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Play around with the values a little bit to find out which ones are working best.
     

Share This Page