|By Hovhannes Avoyan||
|July 28, 2011 10:15 AM EDT||
Before reading this article, I highly suggest to get familiar with all the concepts of the previous article regarding IO tuning.
Your IO please, sir
How is your IO characterized? Yes, this question has to be asked yet again. It’s a big difference when tuning for random access reads vs. sequential reads.
How is your application doing in that matter? – You should know better than me.
My main approach when optimizing for read IO is to access the disks as little as possible. Disks are slow, really slow, comparing to CPU and RAM – if we can – we avoid them.
Write some proper code
Have a look at a use case of reading large chunks from your HDs and serving them via the network for various users.
Obviously reading the file on demand will save memory, however, it will increase your latency and cause a bad user experience. The secret is here is to:
- Prefetch some more
- Try to expect what should be prefetched
Prefetching (or buffering) the actual data you are going to serve can offload your HDs by reading the data just once and serving it multiple times.
However, when your IO is random and you can’t really expect what’s going to be fetched – you can still statistically optimize your cache hits by buffering as much as data as you can in memory.
Unfortunately for random IO, in the end of the day, expect your HDs to work and also expect the extra delay.
Ah and of course – if the “disk grinding” application is actually a database, then obviously avoiding full table scans and adding proper indexes where needed are the key for better performance in that matter.
Linux to the rescue?
I talked about IO schedulers in the previous article, together with filesystems, they affect your performance not only when writing, but also while reading.
What I did want to mention here, is that Linux does a pretty good job with its buffer cache – ever wondered how come you never have any free memory under Linux? – That is because Linux is doing an awesome job for you – caching disk IO for you without even asking you. So if you didn’t implement proper caches in your application, then Linux might take care of it for you.
TMPFS and RAMFS are, for some reason, only rarely used. These are in-memory filesystems. They can be great for caching files and making sure they stay in your RAM for ultra-fast access.
This is yet another countermeasure we can undertake in order to avoid the slowness of HDs.
Yet another tuneable
For some awkward reason, the ‘noatime’ and ‘nodiratime’ attributes are not on by default on Linux filesystems.
You should switch them on, as it’ll trigger a filesystem metadata write every time you access a file or directory – yes, also for reading. If I disabled it on my humble netbook (actually for battery saving concerns – have the HD spin less) – you must disable it also on your server.
I encourage you to do it now – also on your desktop:
# vim /etc/fstab
Just add ‘noatime’ and ‘nodiratime’ for any non-swap filesystem.
If you have a lot of memory in your system – then use it.
Many are the times I’ve seen people struggle with a database in the size of 10GB which has either multiple reads or writes or both of them together.
The simple solution is just to have the whole DB in-memory on a proper machine with more than 10GB or memory. Trust me – no matter what HD setup you have below – if you have 100% of your databases in-memory – HDs will never slow you down.
Consider it also for databases larger than 10GB. Unfortunately during my work experience I’ve seen what happened with a fairly optimized DB in the size of 100GB. It had gazillion (OK, maybe I’m exaggerating here) of updates and queries per minute. Jumping from 8GB of RAM to 64GB made the huge difference between a system that didn’t work to a system that actually copes with the load.
In most cases, if your system is that much loaded and you justify these huge amounts of memory – you are also probably making enough money to actually afford it.
RAID1 simply mirrors your data over 2 (or more) HDs, usually to provide redundancy. Say one of your HDs is broken – your system can continue to operate from the other.
RAID1 is usually considered “wasteful” because you don’t get extra storage for every HD you add. However, with RAID1 and a proper RAID controller, you can get tremendous read performance boosts.
How come? Imagine you have 10 read IO requests and one HD to serve them – they might get ordered sequentially and served optimally, however, only one HD will serve them.
Lets imagine you now have 10 HDs in a RAID1 and the same 10 read IO requests – you now have 10 HDs to serve them!! Theoretically speaking it’ll be 10 times faster than one HD.
That is with an exception of having a proper RAID controller – some cheaper controllers wouldn’t provide you the desired behavior of reading from multiple disks at the same time.
Be cautious when building a RAID1 configuration – the write speed of the array will be the write speed of the slowest HD in the array – it will decrease write performance noticeably if you have slower disks in the array.
Another word about RAID1 vs. RAID10 – RAID1 can be easily expanded – whenever you notice a performance problem – just chuck another HD in the RAID array and you’re good to go with some more performance!
Hands up, don’t move!
SSDs can yield a big performance boost if you care mainly about reading.
They are, however, 10 times more expensive – but also 10 times or more faster when talking about random access of data.
How come? – there’s nothing turning over there, nothing is moving – all of your stored data is “in the same distance” from you. While on traditional mechanical magnetic HDs you have to actually wait for a head to move to the correct location in order to retrieve any data.
It is a sort of a last resort optimization in my opinion, as it can easily double or triple your expenses.
One last dirty trick
Mechanical disks turn, some at 7.2K RPM, some at 10K and some even at 15K.
In addition to turning, they have a head, pointing to the location with the desired data.
For a given HD, the angular velocity of the head on the HD plate is constant, be it 7.2K, 10K or 15K RPM.
However, going further out on the HD plate, the absolute velocity of the head increases – as the plate radius is bigger and the angular velocity stays the same. This is simple physics.
For a more thorough explanation I suggest reading this brilliant article.
What does it mean for us? Well, in order to squeeze the best out of our HDs, we can use just the outer parts of its plate. Usually the outermost tracks of a HD are in the beginning of it, regarding partition creation.
The bag of tools I published in the previous article are also just as good over here.
Examining your application in the applicative level is highly recommended as well. Provide yourself verbose logs and see where you hit the caches and where you miss them. Your task, obviously, is to minimize the cache misses to a bare minimum.
That’s all folks
Truly these two IO tuning articles are not a mere grocery-store tick list you can just perform and gain an extra boost – these articles were meant to give you tools to think, plan, design and eventually carry out successful architectures. Good luck!
The 19th International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Digital Transformation, Microservices and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportuni...
Aug. 28, 2016 10:30 PM EDT Reads: 4,040
Smart Cities are here to stay, but for their promise to be delivered, the data they produce must not be put in new siloes. In his session at @ThingsExpo, Mathias Herberts, Co-founder and CTO of Cityzen Data, will deep dive into best practices that will ensure a successful smart city journey.
Aug. 28, 2016 06:30 PM EDT Reads: 1,617
SYS-CON Events announced today that 910Telecom will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Housed in the classic Denver Gas & Electric Building, 910 15th St., 910Telecom is a carrier-neutral telecom hotel located in the heart of Denver. Adjacent to CenturyLink, AT&T, and Denver Main, 910Telecom offers connectivity to all major carriers, Internet service providers, Internet backbones and ...
Aug. 28, 2016 06:00 PM EDT Reads: 1,934
Pulzze Systems was happy to participate in such a premier event and thankful to be receiving the winning investment and global network support from G-Startup Worldwide. It is an exciting time for Pulzze to showcase the effectiveness of innovative technologies and enable them to make the world smarter and better. The reputable contest is held to identify promising startups around the globe that are assured to change the world through their innovative products and disruptive technologies. There w...
Aug. 28, 2016 03:00 PM EDT Reads: 754
Internet of @ThingsExpo, taking place November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 19th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devices - comp...
Aug. 28, 2016 01:45 PM EDT Reads: 3,664
DevOps at Cloud Expo, taking place Nov 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 19th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait for long dev...
Aug. 28, 2016 01:00 PM EDT Reads: 2,429
Data is the fuel that drives the machine learning algorithmic engines and ultimately provides the business value. In his session at Cloud Expo, Ed Featherston, a director and senior enterprise architect at Collaborative Consulting, will discuss the key considerations around quality, volume, timeliness, and pedigree that must be dealt with in order to properly fuel that engine.
Aug. 28, 2016 11:30 AM EDT Reads: 1,971
19th Cloud Expo, taking place November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Meanwhile, 94% of enterpri...
Aug. 28, 2016 11:00 AM EDT Reads: 3,142
There is growing need for data-driven applications and the need for digital platforms to build these apps. In his session at 19th Cloud Expo, Muddu Sudhakar, VP and GM of Security & IoT at Splunk, will cover different PaaS solutions and Big Data platforms that are available to build applications. In addition, AI and machine learning are creating new requirements that developers need in the building of next-gen apps. The next-generation digital platforms have some of the past platform needs a...
Aug. 28, 2016 11:00 AM EDT Reads: 718
SYS-CON Events announced today Telecom Reseller has been named “Media Sponsor” of SYS-CON's 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
Aug. 28, 2016 10:45 AM EDT Reads: 873
With so much going on in this space you could be forgiven for thinking you were always working with yesterday’s technologies. So much change, so quickly. What do you do if you have to build a solution from the ground up that is expected to live in the field for at least 5-10 years? This is the challenge we faced when we looked to refresh our existing 10-year-old custom hardware stack to measure the fullness of trash cans and compactors.
Aug. 28, 2016 02:00 AM EDT Reads: 1,801
The emerging Internet of Everything creates tremendous new opportunities for customer engagement and business model innovation. However, enterprises must overcome a number of critical challenges to bring these new solutions to market. In his session at @ThingsExpo, Michael Martin, CTO/CIO at nfrastructure, outlined these key challenges and recommended approaches for overcoming them to achieve speed and agility in the design, development and implementation of Internet of Everything solutions wi...
Aug. 28, 2016 01:30 AM EDT Reads: 2,152
Cloud computing is being adopted in one form or another by 94% of enterprises today. Tens of billions of new devices are being connected to The Internet of Things. And Big Data is driving this bus. An exponential increase is expected in the amount of information being processed, managed, analyzed, and acted upon by enterprise IT. This amazing is not part of some distant future - it is happening today. One report shows a 650% increase in enterprise data by 2020. Other estimates are even higher....
Aug. 28, 2016 01:00 AM EDT Reads: 2,989
Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more business becomes digital the more stakeholders are interested in this data including how it relates to business. Some of these people have never used a monitoring tool before. They have a question on their mind like “How is my application doing” but no id...
Aug. 28, 2016 12:15 AM EDT Reads: 1,863
Identity is in everything and customers are looking to their providers to ensure the security of their identities, transactions and data. With the increased reliance on cloud-based services, service providers must build security and trust into their offerings, adding value to customers and improving the user experience. Making identity, security and privacy easy for customers provides a unique advantage over the competition.
Aug. 27, 2016 08:45 PM EDT Reads: 2,393
I wanted to gather all of my Internet of Things (IOT) blogs into a single blog (that I could later use with my University of San Francisco (USF) Big Data “MBA” course). However as I started to pull these blogs together, I realized that my IOT discussion lacked a vision; it lacked an end point towards which an organization could drive their IOT envisioning, proof of value, app dev, data engineering and data science efforts. And I think that the IOT end point is really quite simple…
Aug. 27, 2016 12:45 PM EDT Reads: 2,382
Personalization has long been the holy grail of marketing. Simply stated, communicate the most relevant offer to the right person and you will increase sales. To achieve this, you must understand the individual. Consequently, digital marketers developed many ways to gather and leverage customer information to deliver targeted experiences. In his session at @ThingsExpo, Lou Casal, Founder and Principal Consultant at Practicala, discussed how the Internet of Things (IoT) has accelerated our abil...
Aug. 27, 2016 02:30 AM EDT Reads: 2,062
Is the ongoing quest for agility in the data center forcing you to evaluate how to be a part of infrastructure automation efforts? As organizations evolve toward bimodal IT operations, they are embracing new service delivery models and leveraging virtualization to increase infrastructure agility. Therefore, the network must evolve in parallel to become equally agile. Read this essential piece of Gartner research for recommendations on achieving greater agility.
Aug. 25, 2016 05:15 PM EDT Reads: 880
SYS-CON Events announced today that Venafi, the Immune System for the Internet™ and the leading provider of Next Generation Trust Protection, will exhibit at @DevOpsSummit at 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Venafi is the Immune System for the Internet™ that protects the foundation of all cybersecurity – cryptographic keys and digital certificates – so they can’t be misused by bad guys in attacks...
Aug. 25, 2016 01:00 PM EDT Reads: 2,697
For basic one-to-one voice or video calling solutions, WebRTC has proven to be a very powerful technology. Although WebRTC’s core functionality is to provide secure, real-time p2p media streaming, leveraging native platform features and server-side components brings up new communication capabilities for web and native mobile applications, allowing for advanced multi-user use cases such as video broadcasting, conferencing, and media recording.
Aug. 25, 2016 08:45 AM EDT Reads: 2,215