Believe it or not, a few reboots to your EC2 instance (or technically any IaaS instance) can lead to a 15 to 20 present performance difference.
So if your instance has suddenly started outperforming or vice-a-versa after the last reboot you did. You should not get nervous.
And I am here to explain how and why this could happen. And how you can hack it to get better performance.
Though this is no rocket science, but I am sure most of you would wonder while reading this. So to start, let’s first try to understand how and why this could happen.
The IaaS Infrastructure
The Cloud or to be specific an IaaS infrastructure consists of a huge pool of servers connected with each other and tied through a virtualization middle ware which manages this automatically and creates VMs or as we know it as ‘instances’ based on user requests. But the physical servers at the backend are not uniform. They might belong to the same family of processor architecture though, but it could be of varying generations.
So let’s say when you by an instance on AWS, it can get created on a physical server on a Intel Xeon E5507 @ 2.27 GHz which has 256KB L2 and 4MB L3 cache. But when you reboot the same instance, it can get booted on an Intel Xeon E5430 @ 2.67 GHz with 6MB L2 and no L3 cache.
Now depending on the type of task you are running on that instance, the performance can vary significantly. So if it is a number crunching task you are running on your instance, then after the reboot you might feel an enhancement in the performance of your instance. This is because the processor frequency has increased. But on the other hand, if it’s a memory interaction intensive task, then you might feel your performance has reduced, as 0 L3 cache can actually reduce the memory interaction performance.
The above description might look to be too theoretical and could be argued at various levels. So I thought to do some benchmarking to put some quantitative values to my argument. I ran Geekbench on a Micro AWS instance running Amazon Linux twice. Once when it was booted with a
And next, when the same instance was booted with
And as expected the result were pretty much different and had an overall performance difference of 14%. If you drill down, you can see the Memory bandwidth performance test had a difference of whooping 58% which in non-manner is insignificant.
So, the moral of the story is, keep rebooting your EC2 instance till you get the best possible Processor Type/Family for your requirement.
Need Help in benchmarking your cloud? Let me know..