Opinions, Expertise, Passion.

Information in black and white, and sometimes some color.

Dec
05

Optimal OS Partitions

Link to this post

What is the optimal OS partition layout for a database server?

I’ve seen so many different configurations for OS partitions of recent time, none to my satisfaction.
Historically, in Unix days 20 years agao, long before RAID and SAN’s all my experiences were for strongly defined partitions.
That is separate partitions for the OS /, /boot, /tmp, /usr, /var and then seperate partitions for effectively application and data with /home and /opt

Today what is optimal for an OS configuration on a database server.
I’m seeking the input and experiences of the community. I’m making the assumption of at least RAID 1 or better for all disks.

It’s obvious that the database partition must be separate, and given snapshot capabilities both the data and binary logs should be specified on the same partition for consistency.
It’s also obvious the /tmp filesystem should not be with the / file system. You never want anything stupid that is using the /tmp filesystem to affect your operational system.

I’ll make the following assumptions.

  • Is a production database server
  • You are not installing new software often, therefore /usr should remain relatively static.
  • You have correctly configured MySQL not to place an data in /var.

This leaves /boot, /usr and /var for the OS. Do these require separate partitions? I would like to see it but do people care. With the amount of disk space available does a large amount bypass the need?

Any comments would be appreciated.

Posted under Databases, MySQL, Professional on 05 Dec 2007

7 Comments »

  1. We currently do it in the following fashion:

    /
    /boot
    /var
    /tmp
    /mymadeupdirectory/logs/mysql
    /mymadeupdirectory/mysql

    Each being a seperate partition, this makes it so that the innodb (which we use) tablespace is on a seperate disk and the iblog files are on seperate disks. The operation system itself is on a different disk as well.

    Optionally you could make it so every ibdata file is on a different disk.

    My 5 cents :)

    Ivo

    Comment by CaliMonk — December 5, 2007 @ 1:43 am

  2. 1) I like RAID 5 - that seems to cover most uses;
    2) Yes, database partition is separate;
    3) I like to have logging separate, although it is not a definite. If you would like to have a binary and general log, or if your database has a lot of binary logging (millions of database operations daily) then I would definitely recommend a separate partition;
    4) /tmp is separate, although it must be large enough to handle your temporary disk needs! We have had databases go down because there was not enough space in /tmp! (I thought 1G was enough) Our temporary (pun intended) workthrough on this (until we could have time to allocate /tmp partition space) was to set the temp folder inside our database! Yikes!
    5) Our /boot, /usr, and /var directories are in the same partition, as my main concerns lie with disk I/O, and thus are the impetus behind my points above - database, logging and temp space are the top three I/O uses. As for recovery of a “box gone bad”, we have a database backups and a spare machine to use for that purpose.

    Comment by David Holoboff — December 5, 2007 @ 1:52 am

  3. I think you should specify whether the application is serving an OLTP or OLAP (or mixed) workload, as often that will affect how one goes about developing a strategy in this regard, no?

    Comment by Jay Pipes — December 5, 2007 @ 4:09 am

  4. Good point!

    My list above is based more on an OLTP model, as our setup tends toward that, although we are setting up a dedicated reporting server before Christmas to give us an angle on the OLAP side. I also should have added that because of our high availability requirement with our current setup (OLTP-related), we also have Linux-HA alongside our master server to help with uptime.

    Comment by David Holoboff — December 5, 2007 @ 6:27 am

  5. You want to have /boot as a separate partition, alone for security reasons (unmounted all the time, only root-mountable).

    For /var nearly the same as for /tmp is true as you don’t want your root partition to run out of disk space because of some logfiles that didn’t logrotate or suddenly started to grow like crazy…

    I like /usr as separate partition, but to be honest right now I can’t say why. More some historic reasons I assume.

    Comment by Olly — December 5, 2007 @ 11:31 am

  6. We use RAID1 for OS and RAID 5 for the database related partitions. However, we’re going to change this to RAID 10 with lots of small disks. Much better performance, which was actually cheered upon by a MySQL employee during a meeting we had.

    Comment by CaliMonk — December 5, 2007 @ 7:05 pm

  7. Databases usually do write short bursts of data which is less than optimal on RAID-5, because parity is always calculated for the whole stripe size…

    Comment by Nils — December 5, 2007 @ 9:44 pm

RSS feed for comments on this post.

Leave a comment

Home
Professional Blog RSS Feed of Professional Blog
Consulting
Presentations
About Ronald
Related Links
Contact Ronald
  • « Nov spinner iCalendar Jan »
    December 2007
    M T W T F S S
     12
    3456789
    10111213141516
    17181920212223
    24252627282930
    31EC
  • Categories:
    • Professional
      • 42SQL
      • Apple
        • iPhone
        • MacBook
        • OS/X
      • Clever Design
      • Cloud Computing
        • 10gen
        • AppNexus
        • Kaavo
        • Kloudshare
      • Databases
        • Drizzle
        • Ingres
        • MySQL
          • Compiling
          • GUI Products
          • MySQL Events
            • mysqlcamp01
            • mysqlcamp02
          • MySQL Proxy
          • MySQL User Conferences
            • mysqluc06
            • mysqluc07
            • mysqluc08
          • Storage Engines
            • Non Transactional
              • Infobright
              • KickFire
              • Maria
              • Nitro
            • Transactional
              • Blob Streaming
              • Falcon
              • InnoDB
              • PBXT
              • Solid
        • Oracle
      • Extreme Programming (XP)
      • General
      • Java
        • Tomcat
      • Linux
        • One Liners
      • Microsoft
      • Open Source
        • Buildbot
        • Ubuntu
        • UltimateLAMP
        • Virtual Box
      • OSCON 2008
      • Packet General
      • PrimeBase Technologies
      • Solid State Drives
      • Sun
      • The Daily WTF
      • Web 2.0 NY
      • Windoze
      • Yahoo
    • Web
      • Google
        • App Engine
        • Summer of Code
      • SEO
        • Brand Identity
      • Web Development
        • Amazon
          • EC2
          • S3
          • SimpleDB
        • CSS
        • HTML
        • PHP
        • Web 2.0
      • Web Sites
        • Application Software
        • Content
        • Cool Tools
        • Linux Stuff
        • MySQL Related
        • Show Your Stuff
        • Twitter
        • Unype
      • WordPress
  • Pages:
    • Best Of PlanetMySQL Articles
    • Interesting Articles
    • MediaWiki Restyling (1)

  • Archives:
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • October 2005
    • September 2005
    • July 2005
    • June 2005
    • February 2005
    • October 2004
    • September 2004
    • July 2004
    • June 2004