Understanding Lustre Architecture
This chapter describes the Lustre architecture and features of the Lustre file system. It includes the following sections:
- What a Lustre File System Is (and What It Isn’t)
- Lustre Components
- Lustre File System Storage and I/O
What a Lustre File System Is (and What It Isn’t)
The Lustre architecture is a storage architecture for clusters. The central component of the Lustre architecture is the Lustre file system, which is supported on the Linux operating system and provides a POSIX *standard-compliant UNIX file system interface.
The Lustre storage architecture is used for many different kinds of clusters. It is best known for powering many of the largest high-performance computing (HPC) clusters worldwide, with tens of thousands of client systems, petabytes (PiB) of storage and hundreds of gigabytes per second (GB/sec) of I/O throughput. Many HPC sites use a Lustre file system as a site-wide global file system, serving dozens of clusters.
The ability of a Lustre file system to scale capacity and performance for any need reduces the need to deploy many separate file systems, such as one for each compute cluster. Storage management is simplified by avoiding the need to copy data between compute clusters. In addition to aggregating storage capacity of many servers, the I/O throughput is also aggregated and scales with additional servers. Moreover, throughput and/or capacity can be easily increased by adding servers dynamically.
While a Lustre file system can function in many work environments, it is not necessarily the best choice for all applications. It is best suited for uses that exceed the capacity that a single server can provide, though in some use cases, a Lustre file system can perform better with a single server than other file systems due to its strong locking and data coherency.
A Lustre file system is currently not particularly well suited for “peer-to-peer” usage models where clients and servers are running on the same node, each sharing a small amount of storage, due to the lack of data replication at the Lustre software level. In such uses, if one client/server fails, then the data stored on that node will not be accessible until the node is restarted.
Lustre Features
Lustre file systems run on a variety of vendor’s kernels. For more details, see the Lustre Test Matrix Preparing to Install the Lustre Software.
A Lustre installation can be scaled up or down with respect to the number of client nodes, storage capacity and bandwidth. Scalability and performance are dependent on available storage and network bandwidth and the processing power of the servers in the system. A Lustre filesystem can be deployed in a wide variety of configurations that can be scaled well beyond the size and performance observed in production systems to date.
Lustre File System Scalability and Performance shows some of the scalability and performance characteristics of a Lustre file system. For a full list of Lustre file and filesystem limits see File and file system limits.
| Feature | Current Practical Range | Known Production Usage |
|---|---|---|
| Client Scalability | 10-100000 | 50000+ clients, several in the 10000 to 20000 range |
| Client Performance | Single client: I/O 90% of network bandwidth Aggregate: 50 TB/sec I/O, 225M IOPS | Single client: 80 GB/sec I/O (8x 100Gbps IB), 100k IOPS Aggregate: 20 TB/sec I/O, 40M IOPS |
| OSS Scalability | Single OSS: 1-32 OSTs per OSS Single OST: 1000M objects, 4096TiB per OST OSS count: 1000 OSSs, 4000 OSTs | Single OSS: 8 OSTs per OSS Single OST: 2048TiB OSTs OSS count: 450 OSSs with 900 750TiB HDD OSTs + 450 25TiB NVMe OSTs 576 OSSs with 576 69TiB NVMe OSTs |
| OSS Performance | Single OSS: 50 GB/sec, 1M IOPS Aggregate: 50 TB/sec, 225M IOPS | Single OSS: 15/25 GB/sec write/read, 750k IOPS Aggregate: 20 TB/sec, 40M IOPS |
| MDS Scalability | Single MDS: 1-4 MDTs per MDS Single MDT: 4 billion files, 16TiB per MDT (ldiskfs) 64 billion files, 64TiB per MDT (ZFS) MDS count: 256 MDSs, up to 256 MDTs | Single MDS: 4 billion files MDS count: 56 MDS with 56 4TiB MDTs 90 billion files |
| MDS Performance | 1M/s create operations 2M/s stat operations | 100k/s create operations, 200k/s metadata stat operations |
| File system Scalability | Single File: 32 PiB max file size (ldiskfs) 2^63 bytes (ZFS) Aggregate: 2048 PiB space, 1 trillion files | Single File: multi-TiB max file size Aggregate: 700 PiB space, 90 billion files |
Other Lustre software features are:
- Performance-enhanced ext4 file system: The Lustre file system uses an improved version of the ext4 journaling file system to store data and metadata. This version, called
ldiskfs, has been enhanced to improve performance and provide additional functionality needed by the Lustre file system. - It is also possible to use ZFS as the backing filesystem for Lustre for the MDT, OST, and MGS storage. This allows Lustre to leverage the scalability and data integrity features of ZFS for individual storage targets.
- POSIX standard compliance: The full POSIX test suite passes in an identical manner to a local ext4 file system, with limited exceptions on Lustre clients. In a cluster, most operations are atomic so that clients never see stale data or metadata. The Lustre software supports mmap() file I/O.
- High-performance heterogeneous networking: The Lustre software supports a variety of high performance, low latency networks and permits Remote Direct Memory Access (RDMA) for InfiniBand (utilizing OpenFabrics Enterprise Distribution (OFED), Intel OmniPath®, and other advanced networks for fast and efficient network transport. Multiple RDMA networks can be bridged using Lustre routing for maximum performance. The Lustre software also includes integrated network diagnostics.
- High-availability: The Lustre file system supports active/active failover using shared storage partitions for OSS targets (OSTs), and for MDS targets (MDTs). The Lustre file system can work with a variety of high availability (HA) managers to allow automated failover and has no single point of failure (NSPF). This allows application transparent recovery. Multiple mount protection (MMP) provides integrated protection from errors in highly-available systems that would otherwise cause file system corruption.
- Security: By default TCP connections are only allowed from privileged ports. UNIX group membership is verified on the MDS.
- Access control list (ACL), extended attributes: the Lustre security model follows that of a UNIX file system, enhanced with POSIX ACLs. Noteworthy additional features include root squash.
- Interoperability: The Lustre file system runs on a variety of CPU architectures and mixed-endian clusters and is interoperable between successive major Lustre software releases.
- Object-based architecture: Clients are isolated from the on-disk file structure enabling upgrading of the storage architecture without affecting the client.
- Byte-granular file and fine-grained metadata locking: Many clients can read and modify the same file or directory concurrently. The Lustre distributed lock manager (LDLM) ensures that files are coherent between all clients and servers in the file system. The MDT LDLM manages locks on inode permissions and pathnames. Each OST has its own LDLM for locks on file stripes stored thereon, which scales the locking performance as the file system grows.
- Quotas: User and group quotas are available for a Lustre file system.
- Capacity growth: The size of a Lustre file system and aggregate cluster bandwidth can be increased without interruption by adding new OSTs and MDTs to the cluster.
- Controlled file layout: The layout of files across OSTs can be configured on a per file, per directory, or per file system basis. This allows file I/O to be tuned to specific application requirements within a single file system. The Lustre file system uses RAID-0 striping and balances space usage across OSTs.
- Network data integrity protection: A checksum of all data sent from the client to the OSS protects against corruption during data transfer.
- MPI I/O: The Lustre architecture has a dedicated MPI ADIO layer that optimizes parallel I/O to match the underlying file system architecture.
- NFS and CIFS export: Lustre files can be re-exported using NFS (via Linux knfsd or Ganesha) or CIFS (via Samba), enabling them to be shared with non-Linux clients such as MicrosoftWindows, Apple Mac OS X , and others.
- Disaster recovery tool: The Lustre file system provides an online distributed file system check (LFSCK) that can restore consistency between storage components in case of a major file system error. A Lustre file system can operate even in the presence of file system inconsistencies, and LFSCK can run while the filesystem is in use, so LFSCK is not required to complete before returning the file system to production.
- Performance monitoring: The Lustre file system offers a variety of mechanisms to examine performance and tuning.
- Open source: The Lustre software is licensed under the GPL 2.0 license for use with the Linux operating system.
Lustre Components
An installation of the Lustre software includes a management server (MGS) and one or more Lustre file systems interconnected with Lustre networking (LNet).
A basic configuration of Lustre file system components is shown in Lustre file system components in a basic cluster.
Management Server (MGS)
The MGS stores configuration information for all the Lustre file systems in a cluster and provides this information to other Lustre components. Each Lustre target contacts the MGS to provide information, and Lustre clients contact the MGS to retrieve information.
It is preferable that the MGS have its own storage space so that it can be managed independently. However, the MGS can be co-located and share storage space with an MDS as shown in Lustre file system components in a basic cluster.
Lustre File System Components
Each Lustre file system consists of the following components:
- Metadata Servers (MDS)- The MDS makes metadata stored in one or more MDTs available to Lustre clients. Each MDS manages the names and directories in the Lustre file system(s) and provides network request handling for one or more local MDTs.
- Metadata Targets (MDT) - Each filesystem has at least one MDT, which holds the root directory. The MDT stores metadata (such as filenames, directories, permissions and file layout) on storage attached to an MDS. Each file system has one MDT. An MDT on a shared storage target can be available to multiple MDSs, although only one can access it at a time. If an active MDS fails, a second MDS node can serve the MDT and make it available to clients. This is referred to as MDS failover. Multiple MDTs are supported with the Distributed Namespace Environment (DNE). In addition to the primary MDT that holds the filesystem root, it is possible to add additional MDS nodes, each with their own MDTs, to hold sub-directory trees of the filesystem. Since Lustre software release 2.8, DNE also allows the filesystem to distribute files of a single directory over multiple MDT nodes. A directory which is distributed across multiple MDTs is known as a stripeddirectory.
- Object Storage Servers (OSS): The OSS provides file I/O service and network request handling for one or more local OSTs. Typically, an OSS serves between two and eight OSTs, up to 16 TiB each. A typical configuration is an MDT on a dedicated node, two or more OSTs on each OSS node, and a client on each of a large number of compute nodes.
- Object Storage Target (OST): User file data is stored in one or more objects, each object on a separate OST in a Lustre file system. The number of objects per file is configurable by the user and can be tuned to optimize performance for a given workload.
- Lustre clients: Lustre clients are computational, visualization or desktop nodes that are running Lustre client software, allowing them to mount the Lustre file system.
The Lustre client software provides an interface between the Linux virtual file system and the Lustre servers. The client software includes a management client (MGC), a metadata client (MDC), and multiple object storage clients (OSCs), one corresponding to each OST in the file system.
A logical object volume (LOV) aggregates the OSCs to provide transparent access across all the OSTs. Thus, a client with the Lustre file system mounted sees a single, coherent, synchronized namespace. Several clients can write to different parts of the same file simultaneously, while, at the same time, other clients can read from the file.
A logical metadata volume (LMV) aggregates the MDCs to provide transparent access across all the MDTs in a similar manner as the LOV does for file access. This allows the client to see the directory tree on multiple MDTs as a single coherent namespace, and striped directories are merged on the clients to form a single visible directory to users and applications.
Storage and hardware requirements for Lustre file system componentsprovides the requirements for attached storage for each Lustre file system component and describes desirable characteristics of the hardware used.
| Required attached storage | Desirable hardware characteristics | |
|---|---|---|
| MDSs | 1-2% of file system capacity | Adequate CPU power, plenty of memory, fast disk storage. |
| OSSs | 1-128 TiB per OST, 1-8 OSTs per OSS | Good bus bandwidth. Recommended that storage be balanced evenly across OSSs and matched to network bandwidth. |
| Clients | No local storage needed | Low latency, high bandwidth network. |
For additional hardware requirements and considerations, see Determining Hardware Configuration Requirements and Formatting Options.
Lustre Networking (LNet)
Lustre Networking (LNet) is a custom networking API that provides the communication infrastructure that handles metadata and file I/O data for the Lustre file system servers and clients. For more information about LNet, see Understanding Lustre Networking (LNet).
Lustre Cluster
At scale, a Lustre file system cluster can include hundreds of OSSs and thousands of clients (see Lustre cluster at scale). More than one type of network can be used in a Lustre cluster. Shared storage between OSSs enables failover capability. For more details about OSS failover, see Understanding Failover in a Lustre File System.
Lustre File System Storage and I/O
Lustre File IDentifiers (FIDs) are used internally for identifying files or objects, similar to inode numbers in local filesystems. A FID is a 128-bit identifier, which contains a unique 64-bit sequence number (SEQ), a 32-bit object ID (OID), and a 32-bit version number. The sequence number is unique across all Lustre targets in a file system (OSTs and MDTs). This allows multiple MDTs and OSTs to uniquely identify objects without depending on identifiers in the underlying filesystem (e.g. inode numbers) that are likely to be duplicated between targets. The FID SEQ number also allows mapping a FID to a particular MDT or OST.
The LFSCK file system consistency checking tool provides functionality that enables FID-in-dirent for existing files. It includes the following functionality:
- Verifies the FID stored with each directory entry and regenerates it from the inode if it is invalid or missing.
- Verifies the linkEA entry for each inode and regenerates it if invalid or missing. The linkEA stores the file name and parent FID. It is stored as an extended attribute in each inode. Thus, the linkEA can be used to reconstruct the full path name of a file from only the FID.
Information about where file data is located on the OST(s) is stored as an extended attribute called layout EA in an MDT object identified by the FID for the file (see Layout EA on MDT pointing to file data on OSTs). If the file is a regular file (not a directory or symbol link), the MDT object points to 1-to-N OST object(s) on the OST(s) that contain the file data. If the MDT file points to one object, all the file data is stored in that object. If the MDT file points to more than one object, the file data is striped across the objects using RAID 0, and each object is stored on a different OST. (For more information about how striping is implemented in a Lustre file system, see Lustre File System and Striping.
When a client wants to read from or write to a file, it first fetches the layout EA from the MDT object for the file. The client then uses this information to perform I/O on the file, directly interacting with the OSS nodes where the objects are stored. This process is illustrated in Lustre client requesting file data .
The available bandwidth of a Lustre file system is determined as follows:
- The network bandwidth equals the aggregated bandwidth of the OSSs to the targets.
- The disk bandwidth equals the sum of the disk bandwidths of the storage targets (OSTs) up to the limit of the network bandwidth.
- The aggregate bandwidth equals the minimum of the disk bandwidth and the network bandwidth.
- The available file system space equals the sum of the available space of all the OSTs.
Lustre File System and Striping
One of the main factors leading to the high performance of Lustre file systems is the ability to stripe data across multiple OSTs in a round-robin fashion. Users can optionally configure for each file the number of stripes, stripe size, and OSTs that are used.
Striping can be used to improve performance when the aggregate bandwidth to a single file exceeds the bandwidth of a single OST. The ability to stripe is also useful when a single OST does not have enough free space to hold an entire file. For more information about benefits and drawbacks of file striping, see Lustre File Layout (Striping) Considerations.
Striping allows segments or ‘chunks’ of data in a file to be stored on different OSTs, as shown in File striping on a Lustre file system. In the Lustre file system, a RAID 0 pattern is used in which data is “striped” across a certain number of objects. The number of objects in a single file is called the stripe_count.
Each object contains a chunk of data from the file. When the chunk of data being written to a particular object exceeds the stripe_size, the next chunk of data in the file is stored on the next object.
Default values for stripe_count and stripe_size are set for the file system. The default value for stripe_count is 1 stripe for file and the default value for stripe_size is 1MB. The user may change these values on a per directory or per file basis. For more details, see Setting the File Layout/Striping Configuration (lfs setstripe).
File striping on a Lustre file system, the stripe_size for File C is larger than the stripe_size for File A, allowing more data to be stored in a single stripe for File C. The stripe_count for File A is 3, resulting in data striped across three objects, while the stripe_count for File B and File C is 1.
No space is reserved on the OST for unwritten data. File A in File striping on a Lustre file system.
The maximum file size is not limited by the size of a single target. In a Lustre file system, files can be striped across multiple objects (up to 2000), and each object can be up to 16 TiB in size with ldiskfs, or up to 256PiB with ZFS. This leads to a maximum file size of 31.25 PiB for ldiskfs or 8EiB with ZFS. Note that a Lustre file system can support files up to 2^63 bytes (8EiB), limited only by the space available on the OSTs.
Note
ldiskfs filesystems without the ea_inode feature limit the maximum stripe count for a single file to 160 OSTs.
Although a single file can only be striped over 2000 objects, Lustre file systems can have thousands of OSTs. The I/O bandwidth to access a single file is the aggregated I/O bandwidth to the objects in a file, which can be as much as a bandwidth of up to 2000 servers. On systems with more than 2000 OSTs, clients can do I/O using multiple files to utilize the full file system bandwidth.
For more information about striping, see Managing File Layout (Striping) and Free Space.
Extended Attributes(xattrs)
Lustre uses lov_user_md_v1/lov_user_md_v3 data-structures to maintain its file striping information under xattrs. Extended attributes are created when files and directory are created. Lustre uses trusted extended attributes to store its parameters which are root-only accessible. The parameters are:
trusted.lov: Holds layout for a regular file, or default file layout stored on a directory (also accessible aslustre.lovfor non-root users).trusted.lma: Holds FID and extra state flags for current filetrusted.lmv: Holds layout for a striped directory (DNE 2), not present otherwisetrusted.link: Holds parent directory FID + filename for each link to a file (forlfs fid2path)
xattr which are stored and present in the file could be verify using:
# getfattr -d -m - /mnt/testfs/file>