Timedora

3 Amazon EFS File Storage

Learn how Amazon EFS provides shared file storage, how clients connect to it, and how its availability and performance options support different workloads.

Shared file storage

provides managed, elastic file storage that multiple Linux-based compute resources can share. Multiple EC2 instances and supported AWS compute services can mount the same and work with its files through familiar directories and file paths.

The grows and shrinks as files are added or removed, so capacity does not need to be pre-provisioned. EFS is useful when an application needs shared file access instead of a separate storage volume for each instance.

types and access

The type determines where EFS stores data and its Availability Zone placement.

  • Regional: Stores data redundantly across multiple Availability Zones in a Region. This is the typical choice when resilience across Availability Zones is important.

  • One Zone: Stores data in a single Availability Zone. It can suit workloads that accept the additional availability risk in exchange for a different cost profile.

A provides network access to a from a VPC. For a Regional , mount targets can be created in the Availability Zones where clients run. Using a in the same Availability Zone as a client is recommended for performance and cost reasons.

Mounting EFS from an instance

An administrator mounts the EFS to a local directory on an EC2 instance. Applications can then read and write files at that directory as they would on a local . EFS uses NFS; AWS recommends the EFS mount helper, which is included with the amazon-efs-utils client. Mounting through a standard NFS client is also supported.

For example, after installing the EFS client and creating /mnt/efs, a Linux instance can mount a as follows:

Replace the example ID with the ID of the EFS . Before mounting, ensure the instance can reach a in the VPC. The ’s security group must allow inbound NFS traffic on TCP port 2049 from the client’s security group, and the client must be permitted to send that traffic.

Performance and throughput

A influences file-operation latency and the scale of parallel work.

  • General Purpose: Provides the lowest per-operation latency and is the recommended mode for most workloads. It is the default mode for file systems, and One Zone file systems use it.

  • Max I/O: Was designed for highly parallel workloads that can tolerate higher per-operation latency. It is a previous-generation option and is not supported with One Zone file systems or Elastic throughput. AWS recommends General Purpose for faster performance.

is separate from : it controls the throughput capacity available to the . EFS offers Elastic, Provisioned, and Bursting throughput. Elastic throughput can suit workloads with unpredictable or spiky demand, while Provisioned throughput can suit workloads with known requirements.

When to use EFS

EFS is a good fit when multiple compute resources need a common, file-based view of data. Common applications include:

  • Web serving and content management: Several application servers read and update shared site files or media.

  • Containers and serverless applications: Supported services such as ECS, EKS, Fargate, or Lambda use shared, persistent file storage.

  • Home directories and developer environments: Users or development instances access files from a common .

  • Analytics and machine learning: Multiple compute instances read shared datasets and write results.

  • Media workflows and shared application files: Workers access common assets without copying a separate dataset to each instance.

Choose EFS when shared file access and familiar file-system semantics matter. It differs from block storage attached to a host and object storage accessed through an API; those storage types serve different access patterns.