myslq eat all ram

Discussion in 'Server Operation' started by yak983, Feb 21, 2008.

  1. yak983

    yak983 New Member

    mysql use all ram .. and after he take all crash and restart with normal usage

    this is the top then eat all memory

    top - 08:47:49 up 5 days, 22:32, 1 user, load average: 1.80, 5.43, 4.66
    Tasks: 132 total, 2 running, 130 sleeping, 0 stopped, 0 zombie
    Cpu(s): 42.2%us, 8.0%sy, 0.0%ni, 17.2%id, 32.3%wa, 0.2%hi, 0.2%si, 0.0%st
    Mem: 2857008k total, 2776912k used, 80096k free, 3688k buffers
    Swap: 2650684k total, 3412k used, 2647272k free, 1463688k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    27116 mysql 25 0 2325m 2.2g 2708 R 85 82.3 0:28.59 mysqld
    166 root 10 -5 0 0 0 S 7 0.0 3:56.87 kswapd0
    26924 apache 15 0 63856 25m 12m S 3 0.9 0:02.96 httpd
    27115 mysql 16 0 2325m 2.2g 2708 D 2 82.3 0:03.61 mysqld
    27114 mysql 15 0 2325m 2.2g 2708 S 2 82.3 0:11.25 mysqld
    26945 apache 15 0 63868 27m 14m S 1 1.0 0:05.55 httpd
    27002 apache 15 0 67008 29m 14m S 1 1.1 0:02.32 httpd
    24779 root 15 0 0 0 0 S 0 0.0 0:03.53 pdflush
    27112 mysql 16 0 2325m 2.2g 2708 S 0 82.3 0:05.98 mysqld
    28315 root 15 0 2228 1172 856 R 0 0.0 0:00.03 top
    1 root 15 0 1852 572 488 S 0 0.0 0:15.05 init
    2 root RT 0 0 0 0 S 0 0.0 0:00.04 migration/0
    3 root 34 19 0 0 0 S 0 0.0 0:00.05 ksoftirqd/0
    4 root RT 0 0 0 0 S 0 0.0 0:00.02 migration/1
    5 root 34 19 0 0 0 S 0 0.0 0:00.09 ksoftirqd/1
    6 root 10 -5 0 0 0 S 0 0.0 0:00.00 events/0
    7 root 10 -5 0 0 0 S 0 0.0 0:00.00 events/1
    8 root 10 -5 0 0 0 S 0 0.0 0:00.00 khelper
    9 root 10 -5 0 0 0 S 0 0.0 0:00.00 kthread
    13 root 10 -5 0 0 0 S 0 0.0 0:00.35 kblockd/0
    14 root 10 -5 0 0 0 S 0 0.0 0:00.34 kblockd/1
    15 root 15 -5 0 0 0 S 0 0.0 0:00.00 kacpid
    120 root 15 -5 0 0 0 S 0 0.0 0:00.00 kseriod
    167 root 15 -5 0 0 0 S 0 0.0 0:00.00 aio/0
    168 root 14 -5 0 0 0 S 0 0.0 0:00.00 aio/1
    313 root 15 0 0 0 0 S 0 0.0 0:00.15 kirqd
    634 root 17 -5 0 0 0 S 0 0.0 0:00.00 ata/0
    635 root 17 -5 0 0 0 S 0 0.0 0:00.00 ata/1
    636 root 17 -5 0 0 0 S 0 0.0 0:00.00 ata_aux


    srv02:~# mysql -V
    mysql Ver 14.12 Distrib 5.0.51a, for pc-linux-gnu (i686) using readline 5.0


    srv02:~# httpd -V
    Server version: Apache/2.2.6 (Unix)
    Server built: Oct 10 2007 02:10:59
    Server's Module Magic Number: 20051115:5
    Server loaded: APR 1.2.11, APR-Util 1.2.10
    Compiled using: APR 1.2.11, APR-Util 1.2.10
    Architecture: 32-bit
    Server MPM: Prefork
    threaded: no
    forked: yes (variable process count)
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D DYNAMIC_MODULE_LIMIT=128
    -D HTTPD_ROOT="/etc/httpd"
    -D SUEXEC_BIN="/usr/sbin/suexec"
    -D DEFAULT_PIDLOG="/var/logs/httpd.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="/var/logs/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="conf/mime.types"
    -D SERVER_CONFIG_FILE="conf/httpd.conf"


    my.cnf
    [mysqld]
    skip-locking
    skip-innodb
    query_cache_limit=1M
    query_cache_size=32M
    query_cache_type=1
    max_connections=500
    interactive_timeout=100
    wait_timeout=100
    connect_timeout=10
    thread_cache_size=128
    key_buffer=16M
    join_buffer=1M
    max_allowed_packet=16M
    table_cache=1024
    record_buffer=1M
    sort_buffer_size=2M
    read_buffer_size=2M
    max_connect_errors=10
    # Prova numero di CPU's*2 per thread_concurrency
    thread_concurrency=2
    myisam_sort_buffer_size=64M
    server-id=1

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    open_files_limit=8192

    [mysqldump]
    quick
    max_allowed_packet=16M

    [mysql]
    no-auto-rehash
    #safe-updates

    [isamchk]
    key_buffer=64M
    sort_buffer=64M
    read_buffer=16M
    write_buffer=16M

    [myisamchk]
    key_buffer=64M
    sort_buffer=64M
    read_buffer=16M
    write_buffer=16M

    [mysqlhotcopy]
    interactive-timeout


    i have try to make all mod possible to my.cnf but without any result..
    can help me ?
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Please try this in the [mysqld] section of your my.cnf:

    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
     
  3. yak983

    yak983 New Member

    ok i try... i write you if this problem go out !
     
  4. yak983

    yak983 New Member

    some problem... mysql use all ram .. and after minutes crash and restart normaly for about few hours
     
  5. falko

    falko Super Moderator Howtoforge Staff

    Are there any errors in your log files?
     

Share This Page