Mounting a NVME disk on AWS EC2
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Mounting an NVMe disk on an AWS EC2 instance can enhance performance significantly, especially in high-read/write scenarios where low latency and high throughput are critical. NVMe (Non-Volatile Memory Express) is a storage interface designed to take advantage of the low latency and parallelism of SSDs compared to traditional hard drives. When you launch specific EC2 instance types, AWS automatically provides NVMe SSDs as part of the instance store or EBS.
Understanding NVMe on AWS EC2
AWS provides NVMe interfaces for both EC2 Instance Store volumes and EBS volumes. It's important to understand the differences between these and how they are presented to your instance:
- Instance Store Volumes: These are temporary storage volumes that are physically attached to the host server. They offer very low latency since they are local, but they exist only during the instance's lifecycle.
- EBS Volumes: These are persistent block storage options available with AWS. When provisioned as NVMe devices, they can offer better performance over standard interfaces.
Key Considerations
When working with NVMe disks on AWS, keep the following in mind:
- NVMe devices are attached to instances using NVMe PCIe interfaces, providing lower latency and higher throughput.
- AWS EC2 instance types such as
C5,M5, andR5commonly use NVMe for instance storage. - Data on NVMe instance store volumes is ephemeral, hence ensure that data persistence is managed using EBS or S3, depending on your need.
- The device mapping can differ from the instance types using traditional block devices. Hence, using device names such as
/dev/sdfneeds to be adjusted to the NVMe interface.
Practical Steps for Mounting NVMe Disks
Step 1: Identify NVMe Devices
Use the lsblk
command to list all block devices and confirm the presence of NVMe devices:
- Read/Write Throughput: Measures in megabytes per second (MB/s).
- IOPS: Input/Output operations per second.
Related reading
- Mounting Google Cloud network locally
- Mounting multiple volumes on a docker container?
- Mounting NFS Persistent Volumes with authentication
- MountVolume.Setup failed for volume xxx couldn't get secret
- Move files between amazon S3 to Glacier and vice versa programmatically using API
- Move files directly from one S3 account to another?
- Multi-master data replication across different AWS regions
- Multi Region Architecture on AWS for SNS notifications

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.