1

I have an older EC2 Micro instance with a standard LAMP stack installed as a development environment that was utilizing a magnetic drive. I have the same type of setup in production. I wanted to test how switching to an SSD root volume would affect performance. Using webpagetest.org, I ran nine tests a few times before and after the change with pretty consisten results. The load time is almost doubled and the time to first byte is quadrupled.

Before webpagetest.org screenshot

After webpagetest.org screenshot

Everything I've read suggests that utilizing an SSD will only increase performance. What am I doing wrong?

  • 4
    A new EBS drive has a first-write penalty, IIRC, and your new instance may not have had a warm cache. Looks like subsequent runs sped up. – ceejayoz Jul 22 '14 at 20:21

1 Answers1

3

As @ceejayoz pointed out, new EBS volumes have a first-write penalty... but they also have a first-read penalty, particularly if created from a snapshot (or AMI, since those are backed by snapshots).

You should pre-warm the volume, if you haven't already. It's not too late to do it, as you can do it nondestructively. It only needs to done once per volume... of course, it doesn't "need" to be done at all, since it all happens eventually with use, but if you're benchmarking, you definitely should.

Once all the blocks have been accessed, it should perform differently.

When you create any new EBS volume (General Purpose (SSD), Provisioned IOPS (SSD), or Magnetic) or restore a volume from a snapshot, the back-end storage blocks are allocated to you immediately. However, the first time you access a block of storage, it must be either wiped clean (for new volumes) or instantiated from its snapshot (for restored volumes) before you can access the block. This preliminary action takes time and can cause a 5 to 50 percent loss of IOPS for your volume the first time each block is accessed. For most applications, amortizing this cost over the lifetime of the volume is acceptable. Performance is restored after the data is accessed once.

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-prewarm.html

Michael - sqlbot
  • 22,658
  • 2
  • 63
  • 86