Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Mysql keep restarting

    Dear All,
    I have dedicated machine with 32G Ram and 16cpus and only running mysql.Below is my top during the day which is peak time and below is also the mysql config file. What I notice in between sometimes there is quite a number restarts happening. I dont get it why when I have so much of dedicated resources why does mysql goes down? Any reason for it? I am also looking into the slow query but I do have enough resources right?


    top - 12:54:21 up 1 day, 23:31, 2 users, load average: 2.36, 2.00, 2.34
    Tasks: 278 total, 3 running, 275 sleeping, 0 stopped, 0 zombie
    Cpu(s): 2.0%us, 0.8%sy, 0.0%ni, 94.6%id, 0.2%wa, 0.6%hi, 1.8%si, 0.0%st
    Mem: 33009800k total, 22447692k used, 10562108k free, 200920k buffers
    Swap: 35061752k total, 0k used, 35061752k free, 18498676k cached

    3011 mysql 20 0 9899m 1.8g 4148 R 127.3 5.8 105:13.53 mysqld
    8763 root 20 0 14876 1176 776 R 2.0 0.0 0:00.01 top
    1 root 20 0 4080 856 608 S 0.0 0.0 0:01.58 init


    max_connections = 1000
    key_buffer = 8192M
    myisam_sort_buffer_size = 64M
    join_buffer_size = 32M
    read_buffer_size = 2M
    sort_buffer_size = 4M
    table_cache = 2048
    thread_cache_size = 32
    wait_timeout = 200
    connect_timeout = 10
    max_allowed_packet = 16M
    max_connect_errors = 10
    query_cache_limit = 4096M
    query_cache_size = 1G
    query_cache_type = 1
    log-slow-queries = /var/log/mysql/mysql-slow.log
    long_query_time = 10
    log_warnings = 2

    open_files_limit = 10000

    max_allowed_packet = 16M

    key_buffer = 64M
    sort_buffer = 64M
    read_buffer = 16M
    write_buffer = 16M

    key_buffer = 64M
    sort_buffer = 64M
    read_buffer = 16M
    write_buffer = 16M


  2. #2
    What I notice in between sometimes there is quite a number restarts happening.
    How do you know this? Have you looked at the MySQL *LOGS*? Have you looked at the MySQL documentation on *increasing* logging if you need to look deeper? Why would you think system resources has anything to do with your MySQL restarts?

    I am also looking into the slow query but I do have enough resources right?
    Enough resources for what? No one knows how much data you have, what kind of tables you have configured, what kind of load MySQL is under, how your database is being used (data mining, web app backend, etc.)...

  3. #3
    You have PLENTY of resources. MySQL is not the system hog MS SQL server is. Unless you are running a pretty heavily hit DB you could run quite a few other applications on that server. Install something like Nagos to check just how busy that machine is over a month. I'm betting you are barely touching the resources.

    As for the restarts. Do you have have space free on the partition MySQL is running on?
    df -h
    will tell you how much free space you have on various partitions. Unless you specifically created partitions for /var or /usr (depends on which distro and or how you installed) then by default in any distro MySQL is on your root partition. Logs or a surge in data or an endless loop or 100 other problems could cause MySQL to fill up your drive which will cause the system to become flaky and unstable.

    Check your MySQL logs. You may have a buggy version of Unix ODBC or some other driver/add on for MySQL which is causing it too crash. If you see a specific query and then a crash repeated it might well give you a clue.

    Is your server exposed to the outside? (as in you opened the MySQL ports in your firewall) Somebody might be attacking your server.

    Are there any other apps which are being erratic?

    Check the system logs and make sure your not having disk errors. The hard drive might be failing and thus showing bad sectors.

    What file system (ie ext3, lvm, ext4) is the database files located on? There may be problems with LVM for example. You might need to reboot or run some LVM diagnostics to fix problems.

    You might have a bad ram chip. It likely wouldn't hurt to run a memtest on the system.

    Are there any possible cron scripts which might take the server down such as automatic backups of the MySQL DB which might be incorrectly configured?

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts