Hey welcome to the river channel so I was doing some port from a Linux codebase or to FreeBSD for one of my client and then I just thought let me do some performance analysis and compare the performance of between the Linux versus the FreeBSD because this stuck by what I was doing this a network stack in a user.
Spacer since it is user space I don’t need to touch any you know kernel aspects of either of the operating system whether it is in Linux or you know FreeBSD so which is when I thought let.
Me test it’s a overall system performance uh a couple of days ago I shot a video episode on you know memory tests memory performance tests for my newly built you know freeness over I just want to compare the hardware capabilities of.
Just you know bare metal server versus my desktop PC and the same I have covered in one of the video episode so you can go through the same over here you can see here it is a titled as NASA operating system category and under that I have.
Discussed about the ZFS on Ubuntu and as a part of that series even the other episode I.
Have discussed about this sanam copy performance because most of the times we do this any stack.
Or anything it depends sometimes on the you know raw mem copy performance because if you encrypt some data you you may have some encrypted file system you can do even compression take for instance ZFS or something like that so it can be file system it can be mean.
It can be anything so that’s what I have.
This questioned exclusively covered.
In the episode today I thought.
An eye perf test and let me conclude how it is going to behave Oh which is when.
Now I thought let me do a knife between local host to local water so that it gives that the raw performance of that term.
That device this is something you can do on you know bare metal level and further demonstration purposes I thought to.
Cover in this video I thought to do in the VM so that I can have a couple of identical VM sent and I could do some more you know I purchased so in case.
If you are new to I puff if you are a student or something like that I once covered about this and networker performance tool called hyper for this is quite handy and itself and so bulk of data don’t rely on pink that’s all that and pink is okay to do some basic connectivity and you can increase the size of the.
Packets of 2500 or more than that here and there so you can use ping for such limited tests but if you want to do some bulk TCP connections and I mean TCP connector to transactions or bulk UDP transactions or try to use you know and I pass tol okay so that’s what so what I have done is I have an identical VM setup.
As you can see here so here I have a desktop VM which has so em suspects you can have you can see here it has three processor ascend and it has around 2.5 GB of memory and down and there are various other things and similarly I have another FreeBSD server you can see here it has the similar.
Specs so hardware wise it has the similar specs so it it.
Same in case if you run it on a bare metal also as I said this is something I have done on a bare metal on a specific device on a test device own of my client and it even now behaved more or less the same which is when I thought it is quite in and let me cover this in a video episode in case if you are you know doing your masters or something like.
That in a university in case if you have some test bed you can also do some tests and get back your.
Research data as well so that we can compare how it turns out okay so this is what it is let me justify this you know V em up so this is a FreeBSD one you can see here this is the desktop it is already booted and it is running so this is a Linux desktop okay so yes so let’s import the same if you go.
To the general law you know search you can see various type of tests and benchmarks being done I was quite amazed you can see here FreeBSD versus Linux performance and here somewhere there’s a comparison between even Solaris and.
Windows and Ruby this is it is understandably quite an old matrix so we can take such samples so you can see here this is gzip compression again it is quite handy it is in photonics you can see here this is versus Debian and in this case they are comparing with you know FreeBSD 8.0 the orange bar and the green bar is the main thing to compare as well as this I’m sorry this you know Morrowind bar actually.
So this versus this orange so that is like Debian vs.
FreeBSD and in this case that the green one is FreeBSD 1.
Compare in this particular test you know three BSD is performing better than now that Debian Linux but again this is a very bold with next kernel as you understand it is 2.6 is around more than eight or seven years old so that’s.
What yeah there are some other different tests you can see here working the process of how much time it takes so the less amount of you know microseconds is much you know faster so in this case the bar should be as low as possible to get you know a better performing system so in.
This case you can see linux is a red curve and freebsd is both to this blue and you know purple curves so clean is again.6 dynamic so in this case you can see here you know linux is performing.
More or less better than freebsd and we can check similar examples whereas in the scale you.
Can see yeah 7-zip compression in this case of debian is again.
Maroon bar it is again from Mathurin XO versus freebsd is a green and orange bar so you can see it is little bit you know performing i believe this is speed test i believe the bigger the bar better it is so i believe that is what it is so once again here freebsd is a little bit performing little not so good compared to linux so yeah there are various ways so people have plotted the same so anyway I think the VM is booted up you can see here so.
Let us just to login into the same.
And we can do some quick test start XFC for I have installed accept see for GUI in the same we can go to a terminal and we can open one more tab so that we can do a.
Quick hypo here in the desktop I have again two tabs but before doing the same R we can also do this you.
Know mem copy benchmark as well so that we will have some baseline measurement in this mem copy tests how it is behaving and then we can do a knife test because I perfect Esther if you see architectural wise so it is quite simple you have this you know userspace.
Process so you have this type of server and type of.
Client and one side if the data is pumped to the other side it is going to go through the you know kernel space and come to the user space.
So that’s what it happens essentially so it goes from this process to this process and from this process to this process as simple as that so technically or testing the overall stack performance so and as well as the hardware performance of a specific device in in a way you are also testing the CPU performance and as well as some memory performance but in a way you can cross-check your iPod tests with some type of memory benchmark test as well so that’s why we can do this.
Same mem copy performance stuff which I have once discussed in this episode as I mentioned earlier ok so over here we can do the same in a VM which is the.
Linux in a VM which is FreeBSD we do this and we will have some baseline measurement which is doing better and then we can cross-check with hyper.
As well so people think that I per face – network performance it is only network performance test if you do on a real network of way so if you do on a local host erm then it is.
Going to be a system performance test because you are testing end of the day the ipv4 stack and overall network stack or networking subsystem of Linux kernel and if you do it in FreeBSD it’s a network subsystem of FreeBSD kernel so that’s what and then other than that you are also testing the overall system.
Performance and as well as all these things are coupled with the real hardware performance that way if you see I do a quick walkthrough so this is what I have discussed in the other episode.
You have this mm cop attached and to prevent the compiler optimization I have added the few lines here and there I am doing a memset and each time based on the size you provide how much byte to do or megabytes in this case or to do mem copy attached to based on that I am just setting that you know I’m doing a mem set so.
That each time it you know changes that.
I’m doing some tests of dynamic so that each eye tration I.
Am increasing few you know megabytes as you can see here it is 10 MB 20 MB and so on and then after that I’m skipping the after.
100 MB I’m skipping to 300 MB and after that 500 MB and then I’m running a continuous of for loop over that same oh you know 400 MB so 50 means it is 50 x.
You know 10 MB so that’s why it is you know 500 MB so the same 500 MB test in the last I’m.
Doing in a for loop so this I have put later because if you do something like that what happens is the entire tests which have done in the last iteration is going to stay in CPU cache whatever it is and if you do any for loop it is going.
To have the same the source buffer is going to have the same bite and even the destination buffer or this or you know docto which is getting copy data from both one to book two is also going to have the same bite so it is just going to do some comparison I mean the optimal mem copy is.