Lately I have seen tons of people doing weird things, like pre-warming EBS volumes... Since quite some time, EBS volumes already have the maximum performance when they become available and do not require initialization. However, what a lot of people forget, is that you plummet your EBS IO-burst capability when considering volumes under 1TB. (3000 = baseline max).
Let us discuss the need for "pre-warming" volumes
Snapshots
When you restore a volume from S3, the volume is not optimized. Now you have a reason to read all your files and do some pre-warming. To make sure your volume is as fast as it should be, you should use dd
or fio
(multi-threaded) to read all files once.
To do this: run the following
sudo dd if=/dev/xvdf of=/dev/null bs=1M
Or:
sudo fio --filename=/dev/xvdf --rw=read --bs=128k --iodepth=32 --ioengine=libaio --direct=1 --name=volume-initialize
You need root-privileges to perform these actions. This due to the fact that you need access to OS-files and not just data files.
dd
and fio
can be a dangerous programs when not used correctly. Please double check your syntax and input/output parameters when using these commands. Do not blindly copy-paste these commands without knowing what they do!
EFS
EFS scales the IO based on the amount of disk space you have been using. When you want to share only a couple of small files and aren't saving a lot of data on the share, you should consider creating a couple of large empty files on these disks. Having 30GB of additional "random files" on top of the NFS-share, will greatly improve the baseline performance. Most problems and bottlenecks that people have with EFS are due to this and can easily be resolved by simply writing some blank-files with dd
dd if=/dev/urandom of=somefilename bs=1M count=30000
The numbers
- You get 3 IOPS per GiB. Volumes are capable of burst up to 3000 IOPS
- Minimal IOPS per drive: 100IOPS (breakeven: 33.3GB disks)
- Baseline performance limit: 10000 IOPS (e.g. no performance gain for disks larger than 3.3TB when considering GP2-SSD)