Boost Your Unraid NAS Performance by 50%: Fix Disk IO Wait

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back I'm Brian this is all your Tech if you've set up an unraised server and you're wondering why the performance just isn't as good as you had hoped it might be due to disk i o wait let's Jump Right In and talk about it I was pulling my hair out trying to figure out what the performance problems were for my brand new unraid setup I had multiple different cache drives I had some relatively fast spinning discs and I just couldn't figure out why my CPU usage was always spiking to near a hundred percent regardless of what I did and what I was running it turns out it was disk IO weight so first let's start with what is IO weight I await as the name sort of implies is input output weight and this is the amount of time that your CPU spends waiting for data from your disks in order to complete a process so let's jump in and take a look at how we can identify this problem what the cause is behind it and some interesting solutions that should help mitigate this on your own setup we'll jump right into the unray dashboard and specifically about Midway down the page you have this section of processor stats this is going to give you every single core of your processor and how it's performing now one of the telltale signs of there being an i o weight problem is if you see one of your processor cores or multiple Spike to a hundred percent and sort of stay there for a few seconds especially if you're not running anything particularly CPU intensive now my processor stats look pretty healthy here so if you're not seeing anything on here you might want to jump to the next section and what we're going to do is we're going to take a look at the console now if you go back up to the top of the screen there's this little icon here in the upper right hand corner it's called terminal and we're going to go ahead and click on that now when you pull up the terminal you're going to be greeted by this sort of blank prompt and you can simply type top is a program that just pulls up a bunch of information about the running processes that are going on in your system so right across here we can go three rows down and we can say percent of CPUs and we're using about 48 of our CPU that's user system it has a whole bunch of different statistics but the one we care about is right over here next to W A and this is IO weight and you can see about three two three percent of the time our processor is waiting for input output again data coming from the disk going into the CPU now when your system is performing badly you might see a huge number here you might see it at 80 90 percent maybe even a hundred percent and that's telling you that you have a disk i o weight problem and that's something you can address fortunately fairly easily so we'll go ahead and jump back out of the terminal let's jump from the dashboard over to shares now Shares are what you set up to actually use as your folders for your file system essentially so when you load up a Docker container or you add a new VM you're going to point it at one of these shares so when we take a look at these shares there are some configuration options and they're mostly having to do with cash ING with unraid isn't the most intuitive thing in the world but I think we can step through it and make it make sense for you hopefully a little bit easier now unraid has four different caching layers or caching mechanisms built into it and you can see that by just drilling down into one of your shares here so what you'll see is you'll have no which as the name implies no nothing's cached so this everything that gets written to this share gets written directly to your rate array you have yes which yes the data is cached but what actually ends up happening is when something's written to the your system it's written to the cache Drive first and then after it's written to the cache Drive once your mover process runs it's going to take those files from the cache drive and move them to the disk array prefer sort of does the exact opposite of that it's going to prefer to have everything cached on the cash drive so rights are going to happen to the Cash Drive and then if something happens to be on the array when the Mover runs it's going to move things from the array to the cache Drive and then finally you've got only and this means that the files only exist on your cash Drive they're only going to get written to the Cash Drive and the Mover isn't going to move them to the array ever this is a good thing to use for things like your system files for example but it might not be such a good idea for things like your downloads that are coming in now going back to that main screen we have different caching pools that you can set up with unray in my case I've got three separate caching pools I have cash download cash and SSD cache these aren't the most clever names in the world but they get the job done and they let me know what each one is being used for yeah this is important because each of these cash drives actually has its own Mount Point its own directory path to get to it the reason that's important is because of something that happens with Docker and internally with unread so if we go over to the docker containers when we pull one of these open we'll load up the Plex pass one this part here is really important so you can see that we've got Mount user media movies this is the way unraid sets up all the paths by default its Mount user and then the share name and the reason for this is that regardless of the caching level that you have whether it's yes prefer or only the system is able to determine where those files should go and it does this with something called fuse and what fuse does is it monitors for file system rights and then it has this process which determines should this be written to the disk array or should this be written to one of the cache drives the result of that is that for every single right to your system there's an extra step an extra process overhead that the system has to use and that adds up to this disk i o so if you have a bunch of reads and writes coming in at the same time and they should all be going to your cash drives they're still going to be hitting that regular file system it's going to spin up your array and you have all this extra processing overhead so this is what we're going to get rid of so instead of using Mount user media well that's a bad example but if we scroll down further we'll use a good example I promise so to illustrate and really drive this point home I'm going to open up sonar one of my Docker containers in here and we're going to go to show more settings and this is the real important one so app data almost every one of your Docker containers actually all of them are going to have an app data share that it stores all the system files to for that actual Docker container this is just where that Docker container uses as its kind of primary path and by default this path is going to be Mount user app data and then whatever the name of the program is so we're going to do is we're going to change that to the cache path so instead of Mount user which is going to go through that fuse file system have all that additional overhead that I just talked about we're going to go directly to the cache and the way that we find the name of the cache drive that we need to go to is we'll jump back over to Main and you scroll down here and you can see if you go over to one of your cash pools and you go to view which is off on the far right hand side you can't see it on my screen right now but it's there and you click on that you're going to see something cool here so we'll go to the one that's marked cache all right so you'll see that it's the directory path is actually Mount cache now we'll go back to one of my other drives and we'll go to the download cache there's another one of my cache drives and you'll notice that it is Mount download underscore cache so it's the name of the cash pool is the name of the path if we go back again and we take a look at let's say disk one in our array and we open that you say Mount this is disk two Mount disk 2 is the path so again Mount user is just that overhead piece that the fuse file system uses to keep track of where the files should go but really each one of these drives in your system whether it's on the array or it's in your cache pool is individually addressable that's important so now we'll go back to our shares and we'll look at the ones that are set to only cache and to prefer cash and in this case we've got app data it's set to go to only cache and it's set to go to the cash cash pool downloads are set to prefer and they're set to go to the download underscore cache pool so with that in mind we'll jump back into Docker and I'll show you these little tiny changes that you need to make so we'll start with Plex and we'll go to you don't want to do the mount user media movies you don't want to change your media path here because this is written to the array so this is fine to go through fuse this is fine to leave as it is but the one we do want to change is if we go down to show more you can barely see it I'm gonna have to sort of move my window a little bit you see this bottom one here is app data this is again the application directory we're going to change that from Mount user app data to mount cache app data because we saw that on the share screen it's going to my cache cache pool we can go ahead and save that and now every time an app data path directory is written to it's going to skip all that extra overhead we'll do the same thing we're going to jump into sonar and I'll show you the changes there so sonar and radar and a bunch of other things they have the downloads directory that they save everything to and you can see here I've changed that from Mount user downloads to mount underscore cache again the exact same path that we found earlier this is my cache pool for my downloads is download underscore cache the last thing we're going to do is again go to show more settings and then you can see that mount cache I did a sonar so we changed app data from Mount user to mount cache this is going to save you a ridiculous amount of overhead in your system your i o weight as soon as you apply this you restart the docker containers your i o weight is going to start dropping and then you can spend more time streaming movies or transcoding movies running other bits of software that you want to run you're not going to have all that crazy i o weight contention eating up all of your CPU resources and that's the entire point of this so with that out of the way let me know down in the comments below if you have any questions whatsoever that I can help with otherwise hit like And subscribe if this was helpful for more tips and tricks in future videos thank you all so much happy unrating and we'll see you next time
Info
Channel: All Your Tech AI
Views: 28,351
Rating: undefined out of 5
Keywords: unraid tutorial, unraid io wait, unraid performance tweaks, unraid performance tuning
Id: ycP586VK6cY
Channel Id: undefined
Length: 11min 40sec (700 seconds)
Published: Fri Jan 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.