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.

Using secondary drive for MySql

Discussion in 'General Discussion' started by jeroman8, Feb 9, 2006.

  1. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    Is it possible to run Mysql server on a secondary drive instead of the primary where everything else is ? And cPanel will support this so phpmyadmin. create databas etc in cpanel will work for users.

    This is just an idea to reduce the load/iowait for CPU when it's always waiting for the disk
    to write stuff. Even if I restart httpd so RAM will be avalible it does not reduce the load very much so I don't think more RAM will fix this issue. Maybe if I could tweak it more it my.cnf
    using more RAM so CPU didn't have to wait so long for the disk.

    hm...

    any thoughts on this ?
     
  2. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    sure its possible and will to some extent lower your load

    stop mysql processes and copy /var/lib/mysql to a temp folder

    install the drive and format it ext2 or 3 depending on what file system your currently using

    then modify the /etc/fstab to mount the drive /dev/hd?, /dev/sd? to /var/lib/mysql

    issue the mount command using the proper drive label and copy the mysql folder to the new drive and restart mysql

    main thing i have found to reduce load is to have plenty of extra memory available as linux/unix loads everything to memory and only accesses the drives when it has to for data read/writes

    rule of thumb I use is 5x the amount of ram used when the box is first rebooted.

    if you have enough ram you can adjust the /etc/my.cnf to also reduce the disk load
     
  3. MMarko

    MMarko Well-Known Member

    Joined:
    Apr 18, 2005
    Messages:
    316
    Likes Received:
    0
    Trophy Points:
    16

    Much better performance gains are from additional RAM MB's.

    If you want real deal you can always take one PIV 1.6+ and dedicate it to mySQL only (you'll need about 200-500GB traffic so I think you can get it for $40 - $80 / month). This way you'll get best performance if you have a lot of mySQL sites.
     
  4. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    "Modify /etc/my.cnf to also reduce the disk load"

    Do you mean by adding more RAM to query cache ?
     
Loading...

Share This Page