11
Understanding hardware still matters in the cloud
Cloud services and infrastructure from Amazon, Windows Azure and other cloud providers offer resources with high levels of abstraction that sometimes provide scalability and fault tolerance benefits. One common misconception with deploying to the cloud is that you don’t have to care about how anything works underneath, especially the hardware. I don’t agree that the cloud makes the computer transparent. Often these abstractions come at a cost of reduced performance and are far from what you can get with a bare metal machine. Understanding how hardware and software works underneath is a way to gain some of that back.
Amazon EBS and Windows Azure storage provide storage resources that you can mount as drives to store data. Cloud storage is usually replicated and that is one reason for the reduced performance, a trade-off for the benefits of fault tolerance. Underneath all the storage API’s and replication are like any other computer: some HDD or SSD drives and either a standard or custom filesystem of some kind.
Similar to accessing memory, how you access a drive matters. Like memory, even if you request reading a small block, there is a minimum block size that the drive operates at. If your request is smaller it will read the entire block before delivering you the small piece you wanted. Drives might have a physical sector size of 512 bytes or 4096 bytes for example. Legacy BIOS software often only understands 512 byte sectors and drives who provide 4096 sector sizes will always read 4096 bytes even if you requested only 512 bytes.
If you’re not careful with how you access memory or disk you might request something that is 4096 bytes that is misaligned and spans in the middle of two 4096 blocks even though it would fit in one. This will read both blocks even though you only have 1 block worth of data you wanted. The computer hides this from you, but there is a performance cost. These tricks work both with software on bare metal machines but they also work in the cloud.
Martin Monperrus wrote an interesting article where he measured the difference between aligned and misaligned random reads on Amazon EBS. Martin writes:
On Amazon Elastic Block Storage (EBS), I noticed at least a difference of one millisecond in average between accessing aligned random 4096B blocks (~10ms) and misaligned random 4096B blocks (~12ms, see below). It means that EBS is sensitive to disk and partition misalignment with 4KiB requests (that typically correspond to filesystem blocks).
10% to 20% additional latency per random seek of unaligned access is pretty substantial if your workload does a lot of random access!
I encourage you to read more about Martin’s article.
-
http:hazem-bahgat.blogspot.com Hazem
Recent Posts
- The 99th percentile matters
- Batching and pipelining linearizable operations in replicated logs
- Trick to reduce allocations improves response latency in Haywire
- Improving the protocol parsing performance in Redis
- Mencius and Fast Mencius a high performance replicated state machine for WANs
- Tuning Paxos for high-throughput with batching and pipelining
- deru campur debu.pdf
- Create benchmarks and results that have value
- Routing aware master elections
- My new test lab
- Responsible benchmarking
- Understanding hardware still matters in the cloud
- The “network partitions are rare” fallacy
- Messaging and event sourcing
- Further reducing memory allocations and use of string functions in Haywire
- HTTP response caching in Haywire
- Atomic sector writes and misdirected writes
- How memory mapped files, filesystems and cloud storage works
- Hello haywire
- Active Anti-Entropy
Archives
- October 2014
- database systems by cj date pdf download
- May 2014
- qvpdf download
- March 2014
- February 2014
- January 2014
- November 2013
- October 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- January 2013
- October 2012
- September 2012
- August 2012
- May 2012
- April 2012
- February 2012
- January 2012
- December 2011
- September 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- unconditional parenting ebook download
- December 2010
- November 2010
- October 2010
- September 2010
- the kings dogge: the story of francis lovell.epub
- July 2010
- the gunslinger book
- May 2010






