The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySql overloads server

Discussion in 'General Discussion' started by traian20031, Jan 27, 2004.

  1. traian20031

    traian20031 Registered

    Joined:
    Aug 30, 2003
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    I have a server that currently runs WHM 8.6.0, cPanel 8.7.0-R26, and RH9.

    The problem is that the server is always overloaded (Server Load 2.21 (1 cpu) ) and I found it to be due to MySQL. Now I've update MySQL to the newest version (4.0.17) and it still overloads. I used it on two different servers and both seem to crash everyday or so...

    Both servers were/is P4 2.4GHz/1GB RAM. I have a huge forum that loads music and pictures constantly but it is not a reason to crash the server that often. This is what CPU Usage shows:
    789 root 0 99.9 0.1 /usr/local/apache/bin/httpd-DSSL

    913 mysql 0 99.9 1.5 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/server.XXXXXXXXXX.net.pid--skip-locking--socket=/var/lib/mysql/mysql.sock


    What I was thinking is that I should allow less resources to MySQL but I don't know how to do that.
    When I check my.cnf it shows the follwing:
    ________________________________
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
    _________________________________

    Anyhelp will be greatly appreciated...
     
  2. traian20031

    traian20031 Registered

    Joined:
    Aug 30, 2003
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
  3. JoehBloeh

    JoehBloeh Member

    Joined:
    Oct 22, 2003
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    I have that problem, also, but I don't think that it's a problem with Mysql, I think it's the reporting email.

    If I'm not mistaking the response, it's saying that 2.2% utilization is overloaded? :confused:
     
  4. RedFutura

    RedFutura Well-Known Member

    Joined:
    Jun 11, 2003
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    6
    Try to optimize mysql.

    Look for the file my-large.cnf or my-huge.cnf. Use the one which best uses your available mem. Large is for 512MB ang huge for 1GB-2GB.

    Simply replace my.cnf with one of those.
     
  5. Finkinstein

    Finkinstein Well-Known Member

    Joined:
    Mar 21, 2003
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    My my.cnf file is looking screwed:

    [mysqld]
    set-variable = max_connections=500
    safe-show-database

    Is that right or should it be changed at all?
     
  6. webrats

    webrats Active Member

    Joined:
    Feb 7, 2002
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    what server do ou have

    try this

    [mysqld]
    max_connections = 400
    key_buffer = 32M
    myisam_sort_buffer_size = 64M
    join_buffer_size = 1M
    read_buffer_size = 1M
    sort_buffer_size = 2M
    table_cache = 1024
    thread_cache_size = 64
    wait_timeout = 900
    connect_timeout = 10
    max_allowed_packet = 16M
    max_connect_errors = 10
    query_cache_limit = 1M
    query_cache_size = 32M
    query_cache_type = 1
    skip-innodb

    [mysqld_safe]
    open_files_limit = 8192
    [mysqldump]
    quick
    max_allowed_packet = 16M

    [myisamchk]
    key_buffer = 64M
    sort_buffer = 64M
    read_buffer = 16M
    write_buffer = 16M
     
  7. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    16
    What would be the best values for my.cnf when my server is 512MB RAM?
     
  8. Mo

    Mo Active Member

    Joined:
    Nov 21, 2001
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Goto > Tweak Settings
    DESELECT Exim Stats Daemon (required for smtp bandwidth logging)

    I had major problems on some of our servers with CPU load - this also seems to cure the mysterious HTTPD runaway process's on our server.

    From average of an overloaded CPU 3.00 - it went down to 0.10 average after de selecting that option, I think CPanel need to be made aware of that.
     
  9. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    16
    Ok, I just disabled this option. I will observe the server load and give you report :) Besides - anyone tried my-large.cnf for 512RAM servers?
     
Loading...

Share This Page