25 December, 2012

Disk drive for the Amazon virtual server

Amazon virtual server uses ELB (Elastic Block Store) storage as disk drive.
It's like a HDD (Hard Disk Drive) within the physical server.

You can create ELB of any size (1GB..1TB) from the Amazon Web Console.
Then you can attach ELB to EC2 (via Web Console),
sudo mkfs.ext4 /dev/xvdf

sudo mount /dev/xvdf /mnt/disk1

and use:
sudo mkdir --mode=777 /mnt/disk1/tmp

I guess that internally ELB is just a dynamically expanding file, movable between servers.
And I've expanded ELB to the entire allocated size:

dd if=/dev/zero of=/mnt/disk1/tmp/zero bs=1M

921+0 records in
920+0 records out
965447680 bytes (965 MB) copied, 29.1309 s, 33.1 MB/s

Then ELB is very fast (speed depends on the file size and state of system caches):

(1.0 MB) copied, 0.0018899 s, 555 MB/s
(10 MB) copied, 0.0122498 s, 856 MB/s
(105 MB) copied, 0.442308 s, 237 MB/s
(262 MB) copied, 4.84185 s, 54.1 MB/s

No comments: