introduction to xfs

Upload: sjayaraman79

Post on 07-Apr-2018

247 views

Category:

Documents


2 download

TRANSCRIPT

  • 8/4/2019 Introduction to XFS

    1/32

    Jonathan Wheeler

    E-Science Centre, RAL

    Introduction to XFS

    HEPSYSMAN

    5th December 2005

  • 8/4/2019 Introduction to XFS

    2/32

    Jonathan Wheeler

    e-Science Centre, RAL

    What exactly is a filesystem ?

    Organization:

    Large disk space to store small data items

    Use files and directories

    In UNIX everything is a stream of bytes:

    More complex file definition in other OSs Devices are also presented in the filesystem

    Linux uses virtual filesystems, e.g. /proc

  • 8/4/2019 Introduction to XFS

    3/32

    Jonathan Wheeler

    e-Science Centre, RAL

    A little bit of background

    Three generation of UNIX filesystems:

    a) v7 / sysv / coherent / minix

    b) ffs / ext2

    c) vxfs / ext3 / jfs / xfs / reiserfs

  • 8/4/2019 Introduction to XFS

    4/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Features of 3rd generation UNIXfilesystems

    a) Intent logging / journalingb) Flexible metadata structures

    c) Dynamic inode allocations

    d) Extents

  • 8/4/2019 Introduction to XFS

    5/32

    Jonathan Wheeler

    e-Science Centre, RAL

    History of XFS

    Developed by Silicon Graphics (now SGI)for use on IRIX:

    1993 - original design 1994 - available for IRIX v 5.3

    2000 - released as Open Source

    2001/2002 some Linux distributions withnative XFS support

    2003 XFS support in 2.4 kernel

  • 8/4/2019 Introduction to XFS

    6/32

    Jonathan Wheeler

    e-Science Centre, RAL

    XFS features (1)

    Journaling:

    but only metadata updates, not data

    updates.

    Fast Transactions:

    uses efficient B+ tree structures for fast

    searches and rapid space allocation

  • 8/4/2019 Introduction to XFS

    7/32

    Jonathan Wheeler

    e-Science Centre, RAL

    XFS Features (2)

    64-bit file system:a) 64bit variables for global counters and disk addresses

    b) Large theoretical maximum filesystem sizei. For Linux 2.4: 2 Terabytes.

    ii. For Linux 2.6 (when using 64 bit addressing on a64 bit platform): 9 Petabytes (or the device limits)

    iii. For Linux 2.6 (on 32 bit platforms): 16Terabytes(even with 64 bit addressing)

    c) Maximum file size is same as filesystem size

  • 8/4/2019 Introduction to XFS

    8/32

    Jonathan Wheeler

    e-Science Centre, RAL

    XFS Features (3)

    Partitioned into Allocation Groups:

    a) each AG manages its own free space

    and inodes

    b) provides scalability and parallelism within

    the file system

    c) limits the size of the structures needed totrack this information

  • 8/4/2019 Introduction to XFS

    9/32

    Jonathan Wheeler

    e-Science Centre, RAL

    XFS Features (3, continued)

    d) allows many internal pointers to be 32-

    bits

    e) AGs typically range in size from 0.5 to4GB

    f) files and directories are not limited to a

    single AG.

  • 8/4/2019 Introduction to XFS

    10/32

    Jonathan Wheeler

    e-Science Centre, RAL

    XFS Features (4)

    Sophisticated support utilities:

    a) fast mkfs (make a file system)

    b) dump and restore utilities for backupc) xfsrepair to fix corrupt filesystem

    d) xfs_fsr (XFS defragmenter)

    e) xfsdb (XFS debug)f) xfscheck (XFS check)

    g) xfs_growfs (enlarges filesystems online)

  • 8/4/2019 Introduction to XFS

    11/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Why you might want to use XFS

    a) Stable, mature code base (oldestjournaling filesystem available on Unix)

    b) Very good performance for large readsor writes

    c) Designed for large systems

    d) Supports user and group quotase) Support for Access Control Lists andExtended Attributes

  • 8/4/2019 Introduction to XFS

    12/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Extended Attributes

    An extended attribute is a name/value pair

    associated with a file. Attributes can be

    attached to all types of inodes: regularfiles, directories, symbolic links, device

    nodes, and so forth. Attribute values can

    contain up to 64KB of arbitrary binarydata.

    See man attr for more details

  • 8/4/2019 Introduction to XFS

    13/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Extended attribute namespaces

    XFS implements three attribute namespaces:

    a) user namespace available to all users,

    protected by the normal file permissionsb) system namespace, accessible only toprivileged users and used for protectedfilesystem meta-data such as accesscontrol lists (ACLs) and hierarchical storagemanager (HSM) file migration status

    c) security namespace used by securitymodules (SELinux)

  • 8/4/2019 Introduction to XFS

    14/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Why you might not want to use XFS

    a) No data journaling

    b) tar, cpio do not understand Extended

    Attributes

  • 8/4/2019 Introduction to XFS

    15/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Resources

    XFS/Linux homepage:

    http://oss.sgi.com/projects/xfs/ contains

    pointers to whitepapers, books, articles,etc.

    Public mailing list: [email protected]

    with searchable list archiveSGI Bugzilla database to report any bugs in

    XFS for Linux

  • 8/4/2019 Introduction to XFS

    16/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison tests - 1

    Tests were performed:

    on the same filesystem on the same

    hardware (AMD Athlon 1666 Mhz, 500Mb) using 3 different operating systems:

    i. Redhat 7.3 (2.4.20-28.7)

    ii. Scientific Linux version 3 (2.4.21-20.EL)

    iii. Scientific Linux version 4

    (2.6.9-22.0.1.EL and 2.6.9.-11.EL.XFS)

  • 8/4/2019 Introduction to XFS

    17/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison tests - 2

    Tests used different filesystem types:

    RH 7.3 ext2, ext3 (xfs not available)

    SL 3 ext2, ext3 (attempts to create xfs

    filesystem caused system crash requiring

    hardware reset)

    SL 4 ext2, ext3, xfs (default), xfs(custom: mkfs.xfs d agsize=4g i

    version=1 I size=512 )

  • 8/4/2019 Introduction to XFS

    18/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison tests - 3

    Tests were performed:

    using bonnie++ test program (see

    http://www.coker.com.au/bonnie++) using the same parameters for each test:

    /usr/local/sbin/bonnie++ -d /data \

    -s 4096M:1024k \-n 192:1048576:128:1024 -m csfnfs30 \

    -u root 1>> outputfile 2>&1

  • 8/4/2019 Introduction to XFS

    19/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison tests - 4

    12 tests in total, each reporting filesystem

    performance and CPU use

    The first 6 tests measure I/O intensive work:

    Sequential output for character, blocked

    and rewrites

    Sequential input for character and blocked

    Random seeks

  • 8/4/2019 Introduction to XFS

    20/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison tests - 6

    The other 6 tests measure performance for

    many small files using:

    Sequential create, read and delete

    Random create, read and delete

  • 8/4/2019 Introduction to XFS

    21/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparsion of filesystems (Sequential output)

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Percharacter(Kb/sec)

    Serie

  • 8/4/2019 Introduction to XFS

    22/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison of filesystems (Sequential output)

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Perblock(Kb/sec)

    Serie

  • 8/4/2019 Introduction to XFS

    23/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison of filesystems (Sequential output

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Rewrite(Kb/sec)

    Serie

  • 8/4/2019 Introduction to XFS

    24/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparsion of filesystems (Sequential input)

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Percharacter(Kb/sec)

    Serie

  • 8/4/2019 Introduction to XFS

    25/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison of filesystems (Sequential input)

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Perblock(Kb/sec)

    Serie

  • 8/4/2019 Introduction to XFS

    26/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Compariosn of filesystems (Random seeks)

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Number/sec

    Serie

  • 8/4/2019 Introduction to XFS

    27/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison of filesystems (Sequential create)

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Create(Num/sec)

    Serie

  • 8/4/2019 Introduction to XFS

    28/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison of filesystems (Sequential create

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Read(number/sec)

    Serie

  • 8/4/2019 Introduction to XFS

    29/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison of filesystems

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Delete(number/sec)

    Serie

  • 8/4/2019 Introduction to XFS

    30/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison of filesystems (Random create)

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Create(Number/sec)

    Serie

  • 8/4/2019 Introduction to XFS

    31/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison of filesystems (Random create)

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Read(Number/sec)

    Serie

  • 8/4/2019 Introduction to XFS

    32/32

    Jonathan Wheeler

    e-Science Centre, RAL

    Comparison of filesystems (Random create)

    e t e t l e t l e t l e t l e t l l ecial

    Filesystem type

    Delete(Number/sec)

    Serie