Thinking about running Docker on M2?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right who remembers the docker song well I know some of you remember it it's been a while though today I've got three machines two MacBook Air m2s and one by popular request MacBook Pro the M1 Pro chip in it this is the base model MacBook Pro 14 inch we've got a 24 gig MacBook Air M2 and the base model MacBook Air it's there just for the heck of it it's probably not going to do so well in a Docker test or virtualization in general but I'm just curious that's why it's here now if you're curious about my M1 MacBook Air tests I'll link some videos down below I've done that last year and all throughout the years let's continue with these new models I want to do two tests today one is the getting started guide because everybody knows it everybody's familiar with it and you know how long it takes on your machine there's two steps here of course when you do dock or run it has to download some images so I'm gonna do these individually sorry Schwarzenegger we don't need you today buddy but you'll be now the build is going to be local so at that point we're going to be timing it now as far as the resources uh that I've allocated for Docker they are slightly different so let's have a look and these are not defaults by the way I did change the resources and I've maxed out the resources as much as possible on each one of these machines this base model MacBook Air only gets 8 CPUs and 8 gigabytes of memory but the interesting thing is that these two machines right here I call this one the mini MacBook Pro because so far it's been doing pretty well it's got a nice chip in it it does have more memory than the MacBook Pro so we'll see if that helps it out and I Max that out too so we'll do getting started as the first test and for the second test that's gonna be this app right here which is located on GitHub Docker samples example voting app so what is this well it's a more complex Docker setup that uses a Docker compose and it has five images there's a node app there is a SQL database there is a reddish cache there's a.net worker and a voting app that's written in Python so we got a mix of things and they're all going to be spun up at the same time using Docker compose so I'm going to create a directory for my Docker tests and then I'm going to clone that repository and uh there it is the example voting app all right I'll have that ready when the time comes let's kick things off with a getting started example I'm going to copy that Command right from Docker desktop there is the sample and paste it into my terminal and run it and if we look at Docker desktop now we've got an image this one Docker getting started we have a container that's running well that didn't take long at all on any one of these machines but that's not really what the test is now I'm going to run the build command and that's Docker build Dash T getting started Dot and I'm going to add the time command at the beginning of that I love being able to just copy this from one machine and paste it on the other machine that's still something so useful you know what I could use Schwarzenegger here alright buddy you're on the Schwarzenegger one two three I love how it gives uh the containers different names this one is strange surely this one is ecstatic Williams and this one is inspiring Clark this is great now but doing the tutorial doesn't actually give us the code this tutorial actually lives on GitHub so we can go to GitHub Docker getting started and this is where it lives so you can actually clone the code itself in the tutorial so I'm going to clone that and I'm going to grab the code and run that from the code base let's have a look at that all right there's the docker file and it will pull this image but I already have the image downloaded because I ran the tutorial now that I have this locally I can run the build command that will be Docker build Docker 101 tutorial why not and the period at the end and let's do the same thing on all these let's go okay there we go there we go the differences are gonna be pretty small because the dependencies it's downloading are really tiny but we do have a result and it is an interesting one and this might have to do with the chip I don't know because we've got 17.9 seconds on the MacBook Pro and on the MacBook Air M2 we've got 12.5 seconds and on the base model M2 MacBook Air we got 12.3 seconds so this is not a question of having more memory this is not a very memory intensive test but perhaps this can be attributed to the M2 Chip and if that's the case that is a pretty big difference so what's happening here Chris what do you think the process of kicking off the build right there isn't particularly memory intensive one but it's more has everything to do with the processor and being able to run those processes so the M2 processor has a bit more advanced architecture and so it's you're just going to see more improvements and also uh the one difference that I want to call out too that if the processes were long run and would were pinging the CPU at 100 for a long period of time you'd see the M2 the MacBook airs really really fall behind because I don't have a fan in them and so you'll see that suddenly the the processing power and uh you know will scale off or back off for heating concerns whereas the M1 Pro would just sail past because of the active cooling gotcha let's go we're kicking things off with the M2 MacBook Air the upgraded model just to see what that's going to be all about now after this is done I'm going to try to scale one of the instances to 100 to see how long that takes okay this one's done M2 base model did you know that there was a vs code open button I didn't see that before that's new but that's pretty cool you can open this project in vs code right from here from Docker desktop I'm going to click on it and see what happens hey look at that that's pretty cool all right we don't need that right now let's run this on the MacBook Pro well I don't know what to tell you folks the times are pretty much the same so we've got 45 seconds on the base model MacBook Air 42 seconds on the upgraded MacBook Air and 44 seconds on the MacBook Pro and the difference there just could be attributed to network traffic Network differences even though nothing else is running here I'm not using the network but still variations could cause that I don't see a huge difference here now if we take a look at Docker desktop you can expand the example voting app and you'll see that there's a bunch of containers that have been created and some of them are running if we do pop open activity monitor though here we'll see some differences especially on the memory Tab and when we look at the memory tab here you'll see that the MacBook Pro is using zero bytes of memory the MacBook Air that's upgraded is using 39 megabytes which is 0.39 about the same but the base model MacBook Air is going to show some struggling here because it's using pretty much all the memory that's available and it's using about a gigabyte of swap so far and this is only one instance of each container so just for fun let's scale it up a little bit and see what happens usually during a development scenario this is pretty much all you're going to need so right now we're seeing that these two machines will be handling it just fine the MacBook Air Base model is probably going to struggle if you try to use the web or try to use your editor at this point you're gonna see some slowdowns and the experiment that I'm about to do is usually not something you'll do on a laptop anyway you'll probably deploy this if you want to scale this up to 100 instances but what the heck let's just do it for fun anyway I'm going to keep activity monitor running just so that we can keep an eye on it while we're doing this and here's the command I'm going to use the same exact command time Docker compose up Dash D Force recreate and I'm gonna add one more flag here and that's the scale flag and what I want to scale is the worker and I'm going to set that to 100. what is this where worker thing let's take a look at the code here and you can see that here are your apps and workers just one of them with its own Docker file this is the.net application that's going to be running as the worker process and this is the one we're going to scale to 100 you can scale a few of them if you wanted to but we're just going to do this one let's go you can see how many workers is spinning up right there and it's quite a lot is anything struggling here on the MacBook Air M2 not really what's going on here the air M2 looks like it started them up and they're running memory uses 20 Gigabytes the M1 I don't know if it finished starting all of them up maybe it did but the times are a little bit strange I got 25.8 seconds on the base model MacBook Air 33 seconds on the upgraded MacBook Air in 13 seconds on this MacBook Pro I don't think so something doesn't seem right I don't think they actually started it's using only 11 gigabytes on the MacBook Pro let's have a look here Docker desktop says there's only 56 containers running on the MacBook Pro 101 containers running on the MacBook Air Base and 103 on the MacBook Air upgraded I don't know what's going on folks I ran the same command but I will run this one more time just to see if that helps it recreating recreating we got errors that's kind of too bad let's see if cleaning this up will help us I'm gonna delete all these images okay we've got a clean system you know what just in case I'll do Docker system prune over here yes let's try this again Docker composed up let's see now this is using the network because it's re-pulling the images but I'm not running any other tests so it's okay okay these kinds of things happen in the real world so there we go the video is edited but I'm keeping this in because well you might experience the same issues creating creating creating created now we need to see started all right I think that was clean it says running 100 out of uh or running 99 out of 104. what happened to that last one did we just lose one anyway close enough I'm gonna do the exact same thing on these two I'll be right back I'm waiting it's happening it's looking better but we do have one struggling machine if you think I'm wearing underwear this is not underwear it's shorts all right I know some people in the comments said are you wearing underwear first of all I'm at home I could wear underwear but these are shorts it's okay all right folks we got some results and these look to be pretty good as far as the cleanliness of the test they all seem to be somewhat working well okay here is the result ready we have 88 running containers on the base model MacBook Air we have 97 running containers on the upgraded MacBook Air and we have 99 running on the MacBook Pro I don't know why there's that difference but there is maybe things like hey you've got enough containers why am I gonna give you 30 13 extra ones you don't need them don't worry about it here are the results as far as the timing goes of those builds 59 seconds on the base model M2 MacBook Air 45 seconds 0.9 on the upgraded MacBook Air and one minute eight seconds on the MacBook Pro the extra Ram is probably helping out this MacBook Air but how does that explain that the base model MacBook Air is faster than the MacBook Pro well could it be the M2 Chip yeah I think it could be let's have a look at activity monitor one last time here we've got uh zero bytes used by swap on the MacBook Pro again 39 megabytes barely anything used by the MacBook Air M2 the upgraded model the most memory pressure and it's not looking so great for the MacBook Air Base model it was struggling even with the getting started example so it's going to be struggling even more now 1.8 gigabytes used of swap the base model MacBook Air only has a a single nand chip for the rent for the hard drive for the SSD yeah that's right whereas the upgraded one has the two uh nand chips for the SSD so even when it gets to swap on the upgraded MacBook Air it's still not as slow as the base model so all in all when you're comparing the MacBook Air Base model versus the upgraded one the swap is even slower so when you get that memory contention and you start or memory pressure as you see in the activity monitor uh and you hit the swap on the disc then you're gonna see even slower results even though the base model MacBook Air started fewer which you would expect like oh some of them failed out pretty early on right like so you would expect it to be faster because of fewer certain containers it's actually still slower because you hit that memory cap and you hit the swap and that swap is slow in comparison to the swap space for the SSD on the upgraded 24 gig MacBook M2 MacBook Air yeah now realistically how often do people start up this many containers on their local laptop pretty unrealistic right unless you're a researcher like unless you're doing something with you're trying to break the parallel processes or trying to start this no you're you know if you're doing local stuff at most you'll run like five to ten if you're really trying to push the limits but like no one's ever running this much locally and I don't know what exactly is happening and it's just like I said it's evident that there is some resource contention that's going on if you're going to be doing virtualization better get the upgraded Ram model you kind of knew this was coming but the test had to be done especially between the MacBook Air M2 and the MacBook Pro base model they are pretty close I would say that this is a definitive result as far as upgrading your MacBook Air if you're thinking about doing that but it's not so cut and dry between the MacBook Air with 24 gigs of RAM and the base model MacBook Pro more tests to come on those two by the way I want to take a moment to thank the members of this channel I've had the membership up for about six months now and some folks have the six month badge on their names thanks to those folks and to those that join in between and if you want to join and support the channel as well there's a join button over there otherwise if you subscribe I'll be happy too thank you so much and if you like this video give it a thumbs up Schwarzenegger will be back next time see y'all later have a good one [Applause] thank you [Music]
Info
Channel: Alex Ziskind
Views: 77,139
Rating: undefined out of 5
Keywords: m1 docker, m1 macbook air, m1 docker performance, apple silicon, apple silicon chip, apple silicon macbook, apple silicon macbook air, apple silicon macs, m1 chip, macbook air m1, apple m1 javascript, m1 docker preview, m1 docker mac, m1 for developers, docker on m1, docker on m1 mac, docker on m1 macbook, docker on apple m1, docker on apple, docker on apple silicon, docker arm, m1 macbook vs, m1 pro, m2 docker, docker m2, m1 pro vs m2, m2 vs m1 pro
Id: N7wzU3TlmcE
Channel Id: undefined
Length: 14min 33sec (873 seconds)
Published: Wed Oct 05 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.