# FCS 29 Aug

- **Course:** 5102 - Foundations of Comp Sys
- **Recorded:** 2026-08-29 00:00
- **Transcript:** 1909 segments, 16491 words
- **Made by:** deepdml/faster-whisper-large-v3-turbo-ct2

---
Hi, everyone. Can one of you confirm? Am I audible? Am I clear? Hey, guys, thank you very much for your confirmation. I do still see participants are joining. We already have 182 participants joined. Let us give them one more minute and we will start. Okay, guys, I just wanted to set the right expectation i said before we do have participants from non-tech background so we will go a little slow this session as well very similar to last session uh so whoever is already aware of the concepts who are from system's background please bear with us for a session or two then we will pick up the speed sure guys i'll definitely pass in between the sentences hope the speed in which i am talking now on the break i am giving is fine if not please let me know okay cool so interesting point is still we have participants joining okay let us start okay i just shared my screen uh can one of you confirm if it is visible not loading me the chats

be able to observe our bot, stop share, okay, now it is coming, oh it says we are having trouble loading your messages, try refreshing, try refreshing but it's not happening, okay now let me see, yeah now it is coming okay so I'm not sure when I'm sharing it's not happening I really do not know anyhow that's okay let me first share my screen okay cool now let me keep this away so that I can see the chat as well. Abhishek, I guess the participants would respond. Okay, cool. Fine. So now the last week what we have learnt is how to create a server for ourselves. A virtual machine in a AWS environment. and today what we are going to understand is how to observe the server utilization and by observing the server utilization how are we going to map the request that has been sent by the application to cpu to memory or to desk how is it going to happen that is our objective of this session and if we get time if we complete as expected and if we get time we are going to

understand the network abstraction what we have understood is server abstraction now we are in the extension to that we'll be understanding the network abstraction okay so now what is the objective basically when we run an application how cpu memory and disk utilization is happening and especially in the ubuntu environment so we are going to use a application by name systemlab. This application is written in Python. It will run a web application at port 8080. It is going to handle the HTTP request and it will execute the now when HTTP request is coming in, how is it going to Because it is, application is receiving the request. But end of the day, the job has to be done by the hardware that we have with the server. So now how this gets converted and how we are utilizing the hardware. So now the request will go to operating system. The operating system that we are going to have in our server is Ubuntu, which is a Linux operating system.

and when application receives the request to process that request the application is going to give it to the operating system not just this application any application it will give it to the operating system because this application do not have any access to the hardware directly So, how will it get access to the hardware? Now, the operating system is going to play the role of a middleman between the application and the hardware. So, what are all the hardware that we are going to focus? We are going to focus CPU, RAM, the main memory, the storage, that is the disk, and the network. because when the request guys just wanted to confirm is my voice audible is it loud and clear because i do see someone thing that is not able to hear okay fine uh fair enough then probably you need to check pencil, maybe at your end. If you can rejoin then definitely maybe, otherwise it could be an issue at your end. Okay, cool.

So now our focus is how CPU, RAM, storage and network is utilized. So now the request has come to the operating system. So operating system has multiple modules on it any operating system so now the operating system will have scheduler operating system will have a virtual memory not the physical memory some memory that it will have when it comes up it will acquire some virtual memory and it also maintains the file system file system is basically for the storage and it will also have a network stack which is the operating system and what is that network stack it will have the information about the interfaces the server has okay cool now the scheduler's job is basically to schedule the request that the operating system has received to forward it to the CPU because it has to be processed by the processor only. Sure, thank you, Denzil. Now, that job is going to be done by the module called scheduler within the operating system.

Among other modules, the operating system also has something called virtual memory. So what is this? This is a process. This is a module. It's an application. Now, what is this virtual memory module is going to do? It is going to manage the process. Whatever has been assigned to the CPU, it will manage those processes, virtual addresses. and in case if it has to the RAM if it is going full for example the memory then it has to swap it cannot continue to work when it is full so when it is full what it will do this will use the storage and that Concept is called extended RAM. So what it will do? We can convert some portion of disk as RAM. That is extended RAM. So what it will do is it will use that extended RAM also as part of the main RAM. So if it has to, this RAM is anyhow available as a chip. The storage, if you say it is by 12 GB RAM, then all the 512 GB is available within this chip. It doesn't have to go outside. But for some reason, we think that 512 GB is not good enough.

Then we will define a memory called swap memory. What is that swap memory? Swap memory in a very, very layman's term. It is about converting some portion of disk as RAM in addition to the memory what we have. So, suppose if I create another 512 GB of WAP memory, that means this system overall, from the operating system perspective, not from the hardware perspective. Hardware, it is still 512 GB RAM only. From the operating system perspective, it has 512 GB RAM. Extended disk is different. I said extended memory. Yes, extended memory and swap memory are all same. So now, this operating system assumes I have 512 GB RAM, physical RAM, and as well as I have 512 GB swap RAM. So 512 GB plus 512 GB, that is 1024 GB RAM, that is now, sorry, 1024 MB, which is GB. Okay, so now this I-12 MB, when it is getting filled, then it will start using this web memory, that is the extended memory. So that means either it will move some applications, some data from the memory to the hard disk

and whatever is active, that will be brought back from the storage. So now, when it is swapping between RAM and storage, that process is called paging. That process is called paging. The memory is called swap memory, which is there in the hard disk. and what it is swapping, it is swapping inactive data from the inactive processes moving to hard disk and if active process has some data in the hard disk, it will move it to memory immediately so that the active application will get response from the RAM. so yeah so it is physical RAM and the technical actual name is virtual RAM but it is called as swap memory because the data is getting swapped between two physical entities that is one is random access memory that is your main memory and the hard disk so the activity that is happening is data swapping The memory location is referred as swap memory and the action that is the swapping is technically called as paging. So when we say that the system is paging at this point of time, that means it is moving some data from RAM to disk or disk to RAM.

Both directions are referred as paging process only. So, that means operating system needs to know whether paging is happening. And if it is happening, then how much data is getting transferred between these two entities. Now, the third entity is the file system. Suppose if you are fetching data, for example, you wanted to look at the last 30 minutes log. that means the log is written into the storage disk so now if application has to write the log it cannot write to the disk directly it has to write through the operating system only and when it comes to the operating system now the operating system will understand the request is to write to the disk so the file system will be used and what is the role of file system basically to manage files, data, buffers and coordinates basically input output operation input is basically the read, output is basically the write so now where is this happening it is happening into a physical

a resource called HADDOS. So now, these three actually details how exactly it happens. Now, all these things, where is it attached to? It is attached to the motherboard. So how do I identify that motherboard? Using the network stack. where is network this application that is part of the operating system is called as network stack and the physical hardware that is present in the motherboard is network interface network interface card you can call it as NIC so that NIC will identify all these components, how do we know the CPU the memory and the hard disk belongs to this server by taking the help from the network card. So that's the reason I said in any, even if you go and look at the cloud, compute, compute basically combines these three. When somebody is telling compute, it's a combination of CPU, memory and disk. Okay. Now, compute is processing, storage is actually the disk, network. The fourth pillar of Cloud is database.

These four are the pillars of the Cloud. Without any of these, you will not be able to avail services from the Cloud. So your CPU, storage, network, and database. Actually, RAM, which is the main memory, is also a kind of storage. We understood that in the last session. But I'm just repeating so that we understand it very clearly or for the new joiners. So RAM is also a storage. This disk is also storage. RAM is temporary storage and disk is permanent storage. Both these part of the storage only. But the capacity of RAM is very limited. But the speed to access the data that is stored in the RAM, that is very fast. But in storage, that is the disk, the capacity is huge. It could be one terabyte, it could be one petabyte also. So the capacity is huge. Because the capacity is huge, the access time is little longer compared to the memory. So that is the reason when application wants any data, it is served from the memory and not directly from the disk.

So now if I am asking for the logs, application will give it to the operating system. Operating system will go to that particular file or folder in the hard disk. And then it will read block by block. And then operating system will get it and operating system will give it to the main user. So these three are very, very important processes of operating system. Now, what is the role of network? To identify these three components are belonging to me only, we will use the network stack of the operating system to identify the network card. And this network card, it is attached to the motherboard. All these units are also attached to the motherboard. so we will access the motherboard using the network and we will enter into the different components that the server has. So now if I'm giving an application request if it has to utilize the CPU scheduler we'll schedule and to manage this process these two storages are available

for us and RAM has the major duty is basically paging and the file system is basically for storing the data into the hard disk to identify this we have network stack which will communicate with the network interface card so i have given the flow summary here i've given the legend as well when you receive this application please go through that in detail now how do we understand this practically for that we have a python code we will understand the python code first and then we will execute and see how exactly it communicates with this hardware so there is an application which is called a system lab it is written in python language this program is basically aimed at to understand the cpu the work done by cv cpu the work done by memory the work done by cache and the work done by dish we know cache is part of memory sorry it is part of memory as well as part of cpu the major role for cache is with the cpu We understood we have three different levels of cache, L1, L2, and L3.

We also understood the role of it. So if it is not clear to you, please go back to the previous session and understand. I have just explained that in detail. So this application is written in Python language, focused on these four. But how are we going to understand this? This has handlers. I have written handlers for this program. Basically, it will have, handler means the URL point to the homepage. The program has a homepage. And it also has URL redirections for CPU, memory, cache, disk. And finally, putting all these together under Mixed. So when I am accessing this application only, then it will go to the homepage. When I am accessing along with slash CPU with the URL, then it is related only to the CPU. But if I'm going to use mixed, then all are included in that code. But how do I understand? I'm going to display the code. whoever is new to Python probably just try to understand what you are seeing here if you are not able to I think you need to learn

a little bit Python to understand that so now let me stop sharing the presentation what I am going to do is I am just going to share the small piece of code hope my screen is visible and even the font is legible. Okay. The handlers are redirectors and routines basically the routine at the application layer also routine at the data layer. Now, the routine has two different roles in these two layers. For example, if I am going to clear my cache at a given interval every five seconds every 50 seconds or every 50 minutes i'm going to clear my cache and let the cache get generated by operations then that's a routine yeah i will be sharing this code in the portal uh model you'll definitely get it as a pdf then you might have to copy paste and create it as a python code so now this code the first i'm telling it is a python code so it has to execute with python only so now here i am putting the modules from http.server from urllib.parse import from these

libraries import these modules running http server and base http request handler now url lib is also a library from that we are going to get modules for the modules url parse and parse qs and then we are going to import other modules such as os time and m map m map because we are going to to understand how OS is forwarding the request, and we're going to use couple of tools. Now I'm defining the host. The host is 0.0.0, which is nothing but the local host. Now port 8080. You might ask, is 127.0.0.1 is equivalent to 0.0.0.0? 0.0.0.0, no. Now then I'm actually writing the code. Definition means I'm writing a function. That means this is not getting executed now. It is only getting defined. Because if I have to execute, then I have to define. Here what I'm defining, I'm defining a function called get underscore int. That is getting the integer. So I am passing some parameters and I am just returning the value.

Now the second is the CPU work in seconds. So I am again defining this as a function. The host is a server that is hosting your application. The word host comes from the action that the server is doing which is hosting. The server can host, the server can process, the server can store. If it is hosting an application, then it is a host. If it is only storing data, then it is not a host, but a storage. Now, you can maintain any host name. Host name is flexible. and from port number means each host will have an access point because when you are accessing you need to access an application if you are going to access an application every application is going to listen to a window within the host and that window suppose if host is your house network is your door through which you are entering into the system and what are all these windows windows are all will say I my web application is available in this window my SMTP service

is running in this window you can come through this window if at all you wanted to access smt now if you are going to access a remote unique server using a client called a remote ssh client then you are accessing ssh application that open ssh application is running on window 22 so like that in a host there can be n number of windows that means n number of ports so we don't enter into the house using the door but we will access the application using the window but you need to tell which house window for that only we are given host that means the house is 0.0.0 which is local computer yes you are right and port number 8080 is the window Even if only the window is open, you'll be able to access. I can run an application on port 8080, but I will not allow anybody to come in through that window. That means I will shut that window. Nobody will be able to access that application. So that means I need to keep the window open

for someone to access the application. So house is the computer. door is your entry window is your direct access to the application without entering the house so now in the try block the get function okay get is a function to get the value it's a python function that's available by default so there is a program written for get by python itself and that has been made as an available as a function like how i have written get underscore int function python has made so many functions default functions available to and one of them is get what it will do it will only read and get a value for you so here what is that it is it is trying to get the name of the default zero so basically it will get the whatever is available in default zero zero means the first portion of the array how do i explain array if you are going to assign a variable something like name then it is can have only one value but if you are going to define a variable as an array that means the array can have many

elements within it and it is a single variable now if i want to access the first element of the array i will use zero why zero zero is the starting point from the computer perspective for us we may start with one that's our practice we have been educated so but for computer the starting point is always zero the first element is always referred as zero So get the name from the array default and get the first element in this default array and return maximum and min. That is max of maximum comma min value comma maximum. So the minimum value and the maximum value will be returned for the value. now this is try if something goes wrong in the try then it will just execute what is available in default suppose if it is not able to get default variable or if it is not able to find the name variable then it will go to exception that is because the scenario is exception Yes, there will be an exam for lab also. You will not be asked to write Python programs.

Don't worry about it. But if you can understand a Python program, that is what is expected. So now I have defined get init function. Then CPU work. Then if you look at it, every function is returning some value. And that value is found out by executing this process. And this process is within this loop. And this loop, there is a condition while. And this while condition is part of the function, cpu underscore work. Yes, both are predefined functions. That's right. Now, if value has an error or if the type is an error, then return to default. That is what it is. Now I am defining, I relate it to CPU, I defined. Now this is a function I defined for memory work. And there is one more function. It is actually returning the checksum. So that means it is getting the value for checksum in this entire process and returning the checksum if I am executing this function. Similarly, I have cache underscore work. it is also a function and we also have disk underscore work now this definition is

whatever parameter for example when i am defining this function this function is expecting a parameter and that parameter is stored as variable empty so that means disk underscore work in bracket if i give 1024 then that 1024 will be used to calculate the size basically 1024 into 1024 into 1024 this is megabyte what you are entering this kilobyte and this is byte so whatever you are entering will be converted to the bytes then storing the buffer and then i'm trying to process the entire thing wherein we are doing since it is related to the disk disk work i do have two different processes within this one is about the read another one is about the write so then finally we have the system lab handler, that is the base HTTP requested handler and it is going to be in UTF as a need HTTP and when it is responding you send the response 200, 200 is nothing but a success code for the HTTP protocol could be from a dictionary

or could be from the returned values so So the returned values variable can be a dictionary, but in this example, none of them are dictionary. We are using only arrays. Now coming back, there is a function within this class. Send the text, do get. And within that also try, you can observe that. If condition, if path is equal to slash. That means the base HTTP request of Handler. Handler has only slash and no extended page. Yes, Anuj, Anuj, I will do that if it is possible. You say it is possible, so let me try after explaining. So now this CPU, if you have in your URL, not just a home page, but with slash CPU, then we want this to be executed. basically it will display the cpu workload completed how much is the duration requested what is the elapsed time and what is the result all the three it will display same for memory if it is slash memory and same for cache if it is for cache and disk slash disk it will say how much data was written how much time it took to write how much time read activity

was that and what is the bytes right so basically write and read information how much time it took and how much data either read or written now finally mixed what is mixed instead of giving slash cpu slash disk slash you just give slash mixed all will work together when i calling this cpu underscore work i'm just calling the function where is this function i showed you initially we are defining these functions at the top we have definition cpu work so when i'm going to execute this will get executed into the all will get executed and it will display the permission now where am i having this but before this let me see if i can share this show formatting options, actions and apps, now set delivery options, okay, you can only schedule a message, yes it will work, I am not able to understand what you mean by out bound if you are familiar with Python code then you'll definitely be not out of bound since you're using technical words I believe you know fine let me see

if i have the option uh okay okay okay okay okay now i'll not be able to share it in the chat uh yeah i'm going to share only the dot file file in the model so now let me close let me stop sharing this i will stop sharing i believe but now let me go back and share my screen again to the console let's wait and see Anupam so now I have shared my console let me stop sharing let me share my whole screen so that to get a chance to see and if i am pressing the alt tab where is it okay here it is let me share the screen above my screen is visible are we good are you able to see okay i do see a couple of you have raised your hands i'll definitely give your mic after completing this demonstration but okay so now this is my linux this is a virtual machine and it is running ubuntu so what is uname will give me what is the operating system Linux operating system and if I give you name hyphen A it is going to tell me that

it is running a new Linux of x86 64 bit operating system the kernel version is 7.0 7.x so now as part of since I am going to run Python program we need to have Python installed So, I'll be mentioning all those things in the document as a prerequisite, one-time preparation. So, now let's get on to that. So, now let us first verify our storage. Basically, the lsblock command is going to give us the storage. now if I give this, it is telling there are I have asked for the name what is the size, what is the type what is the file system type what are all the mount points and the model so the most important thing is these are all loopbacks now the disk is SDG, this is the virtual disk, what is the capacity of the virtual disk 60 GB. Now out of the 60 GB this has been partitioned into three parts. Now SDA1 which is the first partition has only one MB. The second partition is SDA2 it's a sub partition to sda that has only 2 gb of space and the type is extended for

mount point is slash boot so this partition will have where the information about where exactly the boot sequence available it will basically point to this and it will find the boot up sequence basically it will point out where in the disk the operating system is available and that disk is the sda3 so this sda3 is 58 gb so if you put together it is 60 gb hard disk Now out of this 58 GB, this is actually volumized by with LVM. You can see the type as LVM. And allocated is only 29 GB. So total is 60 GB, Sundar. So out of that, 1 MB and 2 GB. And this is 29 GB. So 31 GB is only used. Yeah, that is right. Out of the 60 GB, only 31 GB is used, 29 is your actual hard disk, and 2 GB is from the hard disk, a small portion is used to bring up the operating system, and 1 megabyte is used to point where exactly it is, that is slash bit. the 29 gb is not used so not used we have allocated but it is not used okay now the first thing is the same program what we saw the system lab

is available in this directory so i'm just i've created a directory called system lab and i'm going to that directory to see answer again and again so let me just allow you okay okay let me allow you priyanka your mic is allowed you can talk if you are there uh good evening sir yeah uh sir i wanted to know if you can share a sample papers for the subject sample sample papers for the subject what do you mean by sample paper the previous year questions or something like that similar questions yes sir I will provide it by end of the session before the examinations definitely you will have topic by topic anything else Priyanka sir and do we have to write this code which you are showing now no no Python code, you will not be expected to write. If it is required, it may not be required at all, but you are expected to understand the commands, Linux commands. So if you are not comfortable with Linux, at least the commands that we are using,

I would expect you to learn. Are we good? Okay, sir. Sir, and for example, only we'll have MCQs, right? That is right. No. From the exam perspective, exam, when I say exam, I'm assuming end semester exam. You will have MCQs. You will have descriptive as well. Okay, sir. Anything else? No, sir. I'm done. Thank you, sir. Okay, thank you. Can you please lower your hand, Priyanka? So now, Anuji, I'm allowing your mic. Anuji, if you are there I have allowed your mic Yes, Anuji So, Professor, my query is Yes, Anuji My query is with regards to the last portion you said around the hard drive you can say expansion if you can get into that portion once again where you are explaining the respective alignments like how the are you speaking about this one what is there available on the screen yes cool so if I say go ahead so if I just trying to understand how this FS type is being differentiated and what is being a kind of difference when LVM and ROM

as well as the part is being aligned to certain like a sda1 sda2 and sda3 sections because it seems it's also a area where ubuntu is working but how come they are being different i'm just trying to understand this first thing is that and how this loopback is actively like allocated to a mount point currently are we anyhow running any kind of like self-attention or self-attentive you can say job here so it's actually running in its own own system and executing to a similar one point somehow or it's a first net we can say fresh ec2 instance and then we just connected there so kind of thought process i'm building as an analogy that what is being going on okay cool so let me answer your second question first this loop is created by the operating system when it got installed into this hard disk so when you're installing the operating system it means that the operating system is creating its own files it owns its own directories in the hard drive and it will start with a directory called slash boot

it will create slash boot and it will write all the information related to the system and then the control will go to the operating system. So when you are booting the system, if I reboot this virtual machine now what will happen is it will shut down the operating system and then it will start again. Reboot is nothing but shutting down and starting. So when we are starting again, first thing is it will look for this partition. Basically this hard disk 60 GB is partitioned into three parts one is 2 GB second is 58 GB and the first one is 1 megabyte so when operating system starts again it will first look for this partition that's why if you look at there is no FS type by that's a default position in the hard disk that operating system will go when it reboots and that will specify where exactly is the boot disk available what is boot disk boot disk will have the bootable information saying that okay your operating system is available in slash usr slash local etc etc that information will be available

in this so it will take that information from the boot disk and then continue with the operating system which is stored in this 58 gb but now this is this 58 gb though it is partitioned is it fully utilized no you have bought a site of 1200 square feet and you have planned to build a house of 800 square feet but as of now you are building only 600 square feet you planned to build a three bedroom all kitchen but as of now whatever reason it may be you are building only two bedroom all kitchen but other space is still there whenever you want you can build the third bedroom and make it part of your house that is what exactly happened here only 29 gb is allocated to this volume now this 58 gb is broken down into only one volume and that's why it says that lvm and LVM is basically the volume manager. So this volume manager has taken 29 GB out of this 58 GB and then made it as a volume by the name Ubuntu VG Ubuntu hyphen hyphen L.

So now that has 29 GB. So what will happen to the rest of 29 GB? If you want to add the available 29 GB, which is not allocated to any volume, You can use the volume manager and extend this 29 GB to 58 GB directly. Or you can add one more volume under SDA3 and then make it 29 GB. However you want, you can. But that is about the disk administration. But from our perspective, what we need to understand is the disk is getting partitioned into multiple partitions. one is boot partition that will lead to operating system and operating system will start coming up. Once operating system comes up, it will be able to identify all other resources your CPU, your memory, your disk, your network card, your you know graphic card, everything whatever is there in the motherboard the operating system will start detecting it. Only after that all All those resources will be available to you. That is what I was trying to explain this.

Hope it is clear. Anuja? Are we good? Okay. Not sure. Okay. Yes, Varun. I'll take two more questions now. Rest. I'll take it later in the session. Okay. I am allowing you, Shivam. if you are there please speak up hello yes good evening sir yeah very good actually i need a book related to this course for studying how can i get one because everything you is because everything you is related to python is new to me so i need to book some study material to understand this concept for data okay concept is related to the system only okay demonstrate the system concept i need an application and that application i have written in python so i just briefed about how the python program looks if you are not aware of python programming then you can ignore that not an issue and if you really want to learn Python fundamentals you can go to any source because Python is a very common programming language any source in the internet

you can even as simple as Jigs for Jigs go and learn probably 8 or 10 chapters basics you will get to know Python uh sir have any uh link for this course and any study metal so can more than help for me you can say i will i will i will i will do that when i'm uploading this presentation i will add a source for python knowledge also okay thank you sir okay cool Suraj, you there? Good evening, sir. Yes, Suraj. Sir, my question is also similar to the Shivam. I have the experience about the Python and the web development, but I want to know where I can get the soft copy or hard copy about the foundations of computer system. As because we have the last lab about the EC2 instance in VM, I am trying to create the one and able to successfully create the one instance. After doing this lab in the activity, how I can do it? Should I do it? When you have brought up the virtual machine in AWS or any other cloud, log into that virtual machine and however I'm doing, you can do the same thing.

Only thing is, if you have chosen Ubuntu, command is same. if you have chosen any other linux variants the command format will change here and there a little bit but command is going to be the same okay answer uh in my system do we have the same amount of memory as you are doing this or we need to make when you have created the when you have created the virtual machine yeah whatever ram or whatever memory you have defined that much will be created for uh sir i have created the same t2 micro free instance t2 micro t2 micro i think it will give you a 4gb ram yes if i'm right yeah 4gb ram you will get so we have to split us uh applic vm that is that is memory but this is a disk okay so in your vm if you have said i want 60 gb 60 GB will be given to you as disk. If you are told 20 GB, then you will get only 20 GB. The default is only 8 GB in AWS. And can sir, my last question is, can you highlight some use case in the

real production environment? Suppose someone has the e-commerce website and he is deploying his website to the VM and why he needs to split his memory according to it? So we are not splitting the memory. No, we are not splitting the memory. We are splitting the hard disk. So what is the core idea to splitting the hard disk? I want to get it. Core area is you want to control what is getting stored where. And you don't want to allow an application to use more than what you are allocating. That you want to control. That is the reason. And second thing is the security. You can control all this at the mount level or the volume level. I can give you access for this volume and another 29 GB, if I make it as another volume next to this, I need not have to give access to this second volume. So all those control I can have as a system administrator. that's why we are partitioning it and for example this partition nobody will have access to

you will not be able to access slash boot like how I am accessing system lab you can't access slash boot as a normal user I can control all those mechanism ok cool are we good ok the last question and then we will progress yes, Rajat Rajat, you there disabling your mic wearing your hand as well okay, Krishna Kumar yeah, good evening sir actual being the industry professionals we have only time on the fully time dedicated time Saturday and Sunday for the course so there are the five hours lectures means a big lectures so we are following your recording and all things so it would be better if providing the thought notes and things so that when during that the exam times are previous to one week or exam we can refer to that also or because we have not too much time to the refer book and these things so we are totally based on your lecture and these things is this is sufficient for the exam point of view or how can you suggest my sessions are sufficient for the exam and whatever i'm covering for example

lsblk is the command i'm suffering so you can just learn lsblk from that perspective and like whatever commands we are using from the operating system perspective that should be sufficient end of the day you should understand the concept you don't need to understand or know the entire operating system or you don't need to know the entire programming what we are trying to understand is the components of the hardware how it is working great sir so we are yes great so we totally follow your lectures and it would be better if short notes would be the provided which is the main or clue so that would be better I'll definitely try to give it but for that I need some time but I'll give it sure sure thank you sir okay so now let us get back so now how do I understand you have the system here there is one application is that application running no it is not running yet and whatever code we saw that is available in this directory in the system the whole code now if i have to run this program

since it is an executable i will directly run it with slash dot and the name of the file now this If I enter, you can see it is saying that line number 398 in module main, server host, some error it is giving. Okay, cool. Now, it says one thing which is very clear is address already in use. okay so now let me look at the processes how will i look at the processes processes means nothing but the processes that cpu is handling so now i will ps is the command which will list the processes that is already running in the cpu and i'm just going to grep for the name of the process that starts with system there is nothing there is nothing this process is not running but it is also okay this is correct this is correct this is correct okay fine so now let me see if it is going to give the error a guy if not let me just run it with python if that is the case i can call the same program with python i'll just say python 3 that is the

program i'll just say system lab till it is giving error so basically it is supposed to start and then it is supposed to stay there so that this application can be accessed and if it is running then it will be running on this just give me a minute, let me just check what is the issue here I did demonstrate this, it was working but I really yeah, server binding error, yes I could see new messages that is coming in just change the port sir why should I change the port port is already in use but it should not be right I am not running this so why will it why will it hold so I can see all these things I can but let me do that offline very good very good very good I like all those suggestions but as all the packages are there so now let me okay cool guys hold on I understand okay so now if you look at it I did not change the port but what I did is I killed the it was a zombie which was using 8080 because probably last time when I used

this and I came out of the system i might have not stopped the application i might have just left it like that so there was a zombie process which was running what is zombie process it just remembers but it doesn't know what it is that is zombie so it was remembering yes there is something which is running at 8080 but it doesn't know what it is so and now i'm just going to leave this console as is and i'm going to open another console and I'm going to log in and I'm a user called Sundar but I want to become super user so I'm using sudo, sudo is nothing but a command that will make you super user, which sudo you want, I want to become a super user that is su, super user is nothing but the root and I want to get all my environment also, so hyphen so now it is asking for the authentication which authentication whether sundar is allowed should be visible let me how about now is the second screen visible okay so this is the second screen i opened

the first screen my program is running now I have come to the second screen in this second screen I am just going to access the application how can I access the application I can use the curl command but before that let us understand where is this process is running so I can use yes okay let me let me repeat so i don't know i did not unmute i think sarah's got tips okay fine no problem sorry guys so this is my first window where i'm running my python program and this is running if i press ctrl c this program will stop i'm not pressing ctrl c i am allowing it to hey man one second one second guys one second guys one second one second okay hope my screen is visible now rohan fine so i am running my system lab dot python i think for some time i'm not going to focus on chat i think that's where exactly something i clicked somewhere it went off so i'm running systemlab.py in one screen and if i press ctrl c this program will

stop i'm not going to press ctrl c i will continue to allow this is my screen one and this screen two basically what we were trying to understand is we know that this systemlab.python program is utilizing the CPU and there is a process ID that has been allocated by the CPU for this systemlab.python how I can identify that for that only we ran this command wherein the output said 1740 is the process ID for this systemlab.python program. Now, when I know the process ID, I can use the native ps command and get relevant information by asking for specific information. iPhone O is nothing but give me an output of all these things. For which process? Now it is 1740 is the process ID of my systemlab.python. So I'm just going to give for hyphen piece, nothing but we can tell which process ID. So I'm giving 1740 and I am giving an enter. Now it is giving process ID 1740, which I asked for. It also gives percentage CPU and the percentage memory.

Basically, this program, systemlab.python, is not using any CPU at this point of time. though this process is loaded in the memory when i say process this python is loaded in the memory and it is occupying only 0.5 percent at this point of time now i have understood it is using cpu it is using memory now what is this 1662 sundar this 1662 is nothing but the parent process id like how 1740 is the process id for system lab and this system lab is a python program so who is running this program python is running this program how do i know the command used to run this program is python3 and what is the process id for this command is 1662 so python3 is a parent for systemlab.py so systemlab.py process id is 1740 and python3 process id is 1662 this is how i will get to understand now how much python3 is occupied because it is also a process running in cpu so instead of putting 1740 if i put 1662 that is the process id of the python

now it is going to say for process id 1662 which is of python the parent is 1660 that means the parent of python is 1660 and what is that command is the shell unix shell and this unique shell is running the python and this python is running systemlab.py program so this is how we will connect what is running what now if you look at python python is occupying only 0.1 percent of the memory wherein this python program is occupying 0.5 percent that means the whole program is running on is running in the memory now what is this 0.5 percent is relevant to it is relevant to the 4 gb of ram what i have 4 gb is the memory i have allocated so out of that 4 gb 0.5 percent is occupied by my python program and 0.1 percent is occupied by the python application itself now this is how i will get to know about the utilization so what is ps stat is basically process that process state right now it is sleeping that means the process is sleeping

it's not doing anything and what is rss it is the resident memory that means how much is swapped we spoke about the swap memory that will give this for now let us hold on to the vsz which is virtual address space which is physical address space of the cpu we're not going to get into the details of it but i just wanted to tell you what is vsz that is virtual address space now what we are going to do is we are going to generate the CPU currently the CPU utilization is 0 now if I do something with the application then it is going to utilize the processor now let me run the CPU within this application how am I going to run this application where is it accessible it is listening on local host that is the local computer at 8080 okay cool what are all the applications available end points I have which is the home page that is slash second is I also have something called slash CPU I also have slash memory and it is given

an example give it in the terms of seconds how many seconds you wanted to Put pressure on the CPU, 10 seconds. Okay, cool. Now, what I am going to do is, I am going to continuously monitor the application. Because our focus is only on 1740, which is our program, systemlab.py. So, I can also save this process ID. I can also save this process ID to a variable. How can I do that? I can define a variable in Unix, that is PID. Let me define it as a variable name. I can ask this PID to store. I'm using same whatever pgraph, look for systemlab.py. head one means first line so what is the first line here it is this is the line only one line is there out of which only the first part that is one seven four zero now this echo command is going to tell what is stored in that so now this echo command is telling it is in pid variable we have the process number so 1740 now i have a command called top top in unix which is basically going to

tell us what is being utilized in all the processes now i want a very specific process so i'm going to give the process id i can mention 1750 also since i have stored it in pid variable i'm using the variable now if you look at it this top now it says that percentage cpu our focus is percentage tpu user is zero system is also zero at this point of time but system is moving away moving away becoming zero ideal is 100 percent when these two are zero this is 100 percent when this is utilizing something then this is reducing so now this is This 1750 is run by Python 3, not using any memory or any CPU at this point of time. Now, I can also use a watch command for this or I can also use htop, whichever you are convenient. But now what I'm going to do is, I'm going to run the program. How am I going to run the program? I'm going to access the program using the curl command. What is that curl command is going to do?

It is going to put some process for 20 seconds. Here it says you mentioned in seconds. What did that CPU program, what we saw in the Python program, it is doing some calculations so that CPU will get engaged. So now I'm going to engage for 20 seconds. First, let me do it for 5 seconds and focus here in the CPU percentage. If I'm going to engage this program as a user for 5 seconds, you can see, is there anything getting utilized? You can see 41.3 user. System is using only 0.2. Now, when I engaged for 5 seconds, there was an utilization of the CPU by this program. Now if I'm going to engage for 20 seconds longer, that means it is longer means more users are utilizing it. That is the concept I'm trying to drive. Now I'm engaging with this application for 20 seconds. you can see cpu utilization is 50 percent from the user this is user this is system and this is idle so these will be followed when it is 50 it is 49 now it is 9 it is 90 now it is zero

both system and us idle is 100 so for this program suppose if i add one more process id that is 1662 i can add that also let me see let me show you without any specific the top is going to tell this is what it is going to do that means there are so many commands are running for all these commands process ids are available and the process ids from 1 to 900 sorry 1 to 999 is basically operating system processes that is what is referred here as system processes for example if you look at it ksoft irqd or vm tool or k thread all these are the processes initiated by the operating system which is point now user also is zero zero there are no requests all the processes are there now you focus here what is coming in the cpu because we are going to put pressure on the cpu focus here what is coming on top right now some vm tool is coming which is operating system related now i am putting pressure onto the tpu how by doing some process now i'm doing it for

20 seconds you should be able to see see the python 3 it is cpu is 99.7 percent which is python 3 it is 1740. 1740 is our python program which is running it python 3 now we can see 45.2 percent now this has come out the process is over here it has come out you can see the cpu coming down so the moment you give access to the application application is giving it to operating system operating system is giving it to the python program and python program knows how to run the python now to access the actual processor operating system again identifies how by giving the process id allocated by operating system now cpu will get instruction this is what we spoke about isa instruction set architecture now here when i am giving this curl command the curl first has to identify this localhost so it is going via the network then it needs to identify the window that is port number in this port number what is running systemlab.python

okay and within systemlab i want to access the function cpu that is slash cpu and run it for 20 seconds we generated cpu we observed that when we give processes request then cpu is getting utilized now we can also look at in a different way the cpu but did application directly control the cpu the answer is no okay now let us look at it in a different way there is an another command in unix basically which is mp stat basically statistics i'm asking for all quotes and i want only one so now if you look at it it is going on displaying it is now if you look at here percentage user is zero percentage system also is zero and idle is 100 percent so focus on this this and this three columns it will continue to run it is giving at that point of time so now if I'm going to engage with the application now you'll get a different view of the same now user is 100 percent zero percent idle for this particular process

so basically system plus user is your total for this process it doesn't mean that it is now it has come down so it has stopped become zero 18 percent 35 percent so basically when i stopped this it is showing average if you look at it i have two processors this is the cp i have two cores that means two processors but it was using only one the moment when this become hundred percent then it started using my second processor also that means only 1.89 percent average user utilization so basically did application control the cpu no application gave the request to operating system and operating system was controlling the cpu to which i have two processors to which processor it has to be given is told by the operating system and when the first processor is 100% utilized second processor is called for the duty now the total here if you look at this this is let me put this this is a percentage idle now it is 97% idle this is 63%

idle put together these two is 80 percent idle because in processor 1.11 that is 11 percent in processor 2 so these two become 0.2 and these two become 36 so that's the reason averages dt here just a math calculation so now let us create it for memory now let me clear this screen let me minimize this so that we are able to see all the three still our applications is running and this is my command window now Now, let me give some work to the memory. How can I give that work? In my Python program, I have a module for memory. So instead of CPU, if I put any process, it will put load on the CPU. but if i'm going to access something from the memory then that is going to put load on the memory that is ram here i'm trying to block the memory when if i want to block the memory i need to give what is the size so i have to mention in mb we saw in the program mb is a variable here i can say mb is equal to pi 12. so now it is going to

block pi 12 mb of memory who is going to block this application why it will block when user request comes if it requires some processing it will go to the processor if it has to temporarily store some information then it will store it in the memory so i'm just going to store something in the memory and now let us continue to run the same command which one not mstat because that now let us see it in the htop htop is another utility i think you'll be able to understand this better so this is the memory this is the swap memory now this is the load average load average is nothing but the processor load average and uptime is nothing but how long this almost like 34 minutes 38 seconds now you are able to see this is the command which is running and this is the utilization of memory and this is the utilization of cpu which user which process id You don't see 17540 coming anywhere. Most of the processor is less than 999.

So system processor. Now let me go ahead and give a load. That means I'm blocking the memory. So now you can see the memory is increasing. So I'm doing it for 20 seconds. So earlier it was, it has occupied only here. now it has occupied how much it is utilizing 868 so basically 512 MB is what I blocked from 356 it added 512 so it became some 868 instead of that let me now give a scenario where it is occupying 1024 now how much I have 3.27 gigabits I have that is 3024 of that i'm going to occupy 1024 already 356 is occupied by the processes that are running now so now i'm my system lab also is going to use the memory so now you can see the processor has gone 100 percent the second processor went up to 2%. Now you can see the memory 1.36 GB. So if I'm going to run it for a longer period of time, so basically it ran for 12 seconds and this ran for 15 seconds and it has occupied 1024 which we were able to see here. I can also show you

in another way wherein I can use watch command but before getting there let me clear this screen so we could clearly observe that when application is needing a resource it is going via the operating system and operating system is allocating the resources ok fine now Sundar you showed there are two processors in your system 0 and 1 whenever this processor is full either 0 or 1 the another processor will start getting utilized now how will I know how much time actually this program has utilized the CPU that is called as CPU time what we are seeing here when I am giving an input you can see that processor is going high our memory is totally occupied this will run for approximately 15 seconds 10 seconds now it has come back again so now it says that elapsed time is 10.91 seconds so that means this process this program was utilizing the memory for 10 seconds no This elapsed time also includes the free time. Suppose if you have written something in the memory,

and if you are not accessing now, you are accessing after 3 milliseconds, then the idle time is 3 milliseconds. So elapsed time includes that 3 milliseconds. When it says 10.91 seconds, that includes 0.3. The CPU time utilized by this program would probably be only 10.3 or 10.6. Rest is an idle time. Like how we had idle time for memory. Here also we have idle time. So elapsed time is basically processing time plus idle time. That is elapsed time. then how are we going to calculate the CPU time so that we will know how much was idle we are going to see that but before that I just wanted to show you one more thing which is nothing but let me come out of this tool let me now use the watch command we saw that it is going to show this process with output we saw this command i'm going to put this command under watch that means continuously we display the information so now every one second it will refresh what it will refresh it will refresh this command and if you look at this

As of now, it is showing only 1750 because we have added 1750 only. So 1750, 3.1% utilization, 0.5% memory, and Python 3 is running. So let me take back the screen. Now, let me give a command. What is a command? i'm going to look at more details let this screen be assessed now where all this information coming from all this information are stored in the hard disk all this information are stored in the hard desk where exactly there is a directory called slash proc that is proc basically the processes so what will this processes directory will have proc directory will have it will have there are 302 directories under this do you want me to list everything list so you can see there are so many processes process ids are there in this one of the process id directory is 1750 so that means anything related to this process id is written in 1750 so now let me go to 175040 now under this also there are this is the directory under this there are files so now there are so many directories

also so many files also now in this there is a file called status and see this there is a stat which is nothing but statistics it is a directory and there is a file called status so cat is nothing but we are seeing the content of the status file oops there's so many yeah the status has so many now within this let me give search for only vm size let me maximize this window now this command i gave this file has all this info if you look at it name is python 3 the program that is initiated this is python 3 state is sleeping which is our python program is sleeping there are no requests if request comes the state will change and this is tgid ngid we'll skip that will directly go to there is something called VM size. This is virtual memory. It's not virtual machine. It is virtual memory. The peak it has gone to this. The size available now is only this much. This is KB. That means this is 7 MB. So basically 107 MB.

When it has gone into the peak it is 1.2 gb that is what we allocated to the memory in our command 1024mp which is equivalent to 1 gb plus another 356 was already running so 1.2 gb so this status file will get updated now and done who will update the status file the operating system the operating system is going to allocate process ID for every program that is running in the processor and for that processor it is going to maintain the status also. Okay. Now there is an another important which is nothing but virtual memory data. That is VM data. How much it is? 19 MB. 19 MB of data was written to the virtual memory through this program like this every process has its own directory with its process id so if you are an administrator if you want to know more details we can get into the system processes also is it sundar there is a boot yes boot also has a process id if you look at the process id let me now go back here let me say zero there's nothing one see there is one there is process

number one if i go inside the process one is there a status in it yes there would be and if i give status. Now, we will come to this. I have given this. Name is system D, which is nothing but Unix operating system. System D is nothing but the system daemon. What is daemon? The process that is running always, as long as this machine is running. So, system daemon is running process 1. What is process 1? As of now, it is sleeping. But in the peak, it used 24 MB of memory. Size now allocated is also 24 MB. Now, virtual memory data, only 3 KB to put into the memory. So this is the peak. This is the size. It has blocked. the data that it is written is 3.9 MP now we can also look at it in a different way like let me clear the screen so that no confusion we have another command called the map process mapping and I am going to give it as $PID because 1740 is stored in this argument is missing p map okay let me give once on for zero

now if you okay probably that variable got released yeah there are no value that's why it gave an error so now if I look at this for this one seven five zero which specific physical area is used and it is mapped by what? So you can see the Python 3 program is using this address. Python 3 requires libraries library crypto.so.3 library lisma.so.5.8.3 All this, cPython also is being used to run this program your program is running now still our program is running so it is occupying so much of physical letters and it is using so many libraries from the python to run our program because we have imported and it is using the library because we have used it in our program so all the libraries so many libraries are running now you can see on top kilobytes is nothing but memory the memory map there is something called dirty dirty is nothing but how much has been swapped between hard disk and the memory this process has not swapped it but this process has

swapped 484 bytes out of total 616 currently it is in the hard disk not in the memory why did it do because we blocked 1.2 GB for our application so at that point of time it has to vacate some things so that our program can get memory moved to the hard disk so this is how we see how hard disk and other things are happening now let us quickly see let me put back this now let us see we can see by doing the mixed before that let us generate our disk if we have done utilizing the processor we are done utilizing the memory now we are trying to use the disk space actual storage let me put not 1024 let me put 2048 the higher number i'm going to use systemlab.py and as if it is writing to the hard disk now it is writing to the disk so the application is writing to a temporary debit now it says 2040 because where is it writing? It is actually writing, first it will write into the temporary space do we have a temporary space? Yes it is

now if I give OS dot it's basically the Python program if I give OS dot sync F sync, file sync I will be able to see exactly where it is writing you can use this to absorb this but now let me give in the temporary there are so many this will get changed but temporarily if you look at it the data was written here there were not sufficient space in the temporary so it aborted now what is the size of this system lab dot that you can see here it is taking so much how much it is this is 1 KB that is 8 KB and this is MB which is nothing but 1.7 GB so this is 1.7 GB 1024 is what everything we need to go higher up these actual bytes I can also ask for human readable ls hyphen h it will give you can try it out now is it still there if it is still there so let me remove this demo system lab demo dot data i'm removing do i have the file now no such file or directory now let me go ahead and write 512 so now it has written it has written in

0.14 seconds. That is the write time. Read time is 0.05. Read is faster. So now is it there? It has written in the temporary space and then it has gone. It has got removed. Because I am not saving it to the hard disk. I am writing temporarily and then I am coming out. Instead of writing to the memory, I am now writing to the disk so now my program is calculating how much time it took to write because I am writing that earlier we saw that file was there systemlab demo.dat now it is not there because after writing successfully we have removed that file and that removal also requires a reading input so reading time is only 0.05 seconds that is 5 milliseconds writing it took 0.14 seconds it is basically 14 milliseconds so now if i increase this to 1024 is it successful yes now you can see more the data we are trying to write it is taking more time to write this is 0.14 seconds double the size it has taken 0.03 seconds to write read 0.1 seconds so that means

here writing to the hard disk the slash tmp is in the hard disk writing to the hard disk is lower than using the memory so memory is also storage hard disk is also storage Memory has less capacity. Hard disk has more capacity. My memory is only 4 GB. My hard disk is 60 GB. Now accessing the memory and getting the data is faster. Accessing the hard disk and getting the data is comparatively slower. So now when I am accessing this program, this program is still running. Now let me clear this screen. Now I also have something called mixed. We have the CPU, memory, and disk. Now it is mixed. Now if I am going to give this as, instead of disk, if I give mixed. Mixed means all. So why is it not working? The URL is mixed. But is it all? But what is that we are supposed to give along with that? We are also supposed to give the parameter for the mixed. We are given for CPU memory and the disk, how much to be used. But for mixed, how we are going to give?

sort of CPU along with that we also give mixed how are we going to give this mixed this was the command I'm going to give you so now since it is missing this double quote it is waiting for it now you can see URL rejected malformed so now let me put it as it is starting the mixed workload but it is waiting for our input why is it not working let us look at the program see I am just trying to make all these mistakes purposefully so that you get to know where to see so now if you look at here error is coming it is a broken type so now until now we never received because we gave the specific url we also gave all the parameters that is required to run it now for mixed it is giving error so how can i run that server this is what we are going to see we are going to see a demonstration of how it is moving from operating system to the resources how it is opening, how it is reading, how it is writing how it is closing that is one thing

with using the mixed we will continue with that in our next session let me stop sharing let me give access in case if somebody have any queries first let me see the chat are there any queries we used curl to send a request op confirms the server successfully processed the simulated cpu workload returning a result after an elapsed time of 20.05 seconds that's matching your requirement of 20 seconds duration okay i think you have answered the query cool code is returned to create url slash yeah that is right efficiency processor would be clocked up after putting the load that is right zero percent cpu in htap does not itself meet the clock speed is 100 of maximum so clock speed is different and CPU utilization is different. It is something like you have a car, you have seven-seater SUV that is your capacity. And if there are only five of you are sitting, five of you are occupying seven-seater. But the clock speed is something like

whether you have five, whether you have seven, whether you have 2. In which speed the car can travel? Up to 180 km per hour. That's what is this capacity and speed is related to processing processor also. Throttling, I wanted to see just to get an idea when performance cores come into the picture. why it is sleeping if it runs always ok now you have the car now you have started the car you have not you have started the engine that is something like you have loaded your python into the memory now only if you press the pedal it will increase the speed, it will get utilized Otherwise, the car is idle, engine is on. So the Python program is always on and it is present in the memory. But if you are going to give a request to the program, then it will start working. Something like how you press the pedal, car will start moving. Until then, though engine is on, car is idle. It's not moving. PID variable was set in another screen, not in this screen.

know whether you set in whichever screen it is set for that server so actually i rebooted my server to release 8080 port so that's the reason variable disappeared otherwise you define a variable and store a value to it remotely also it will get stored Temporary space is also in the same disk. Yes, exactly. It is also in the same disk. But the allocation of temporary space will be limited. There you need to go and look at the operating system partitions. You will get to know how many is allocated for. In my case, the allocated space for temporary is only 1.6 GB. That's why when I tried 2 GB of writing, into the temporary space. It said you don't have any space. Why accessing the data from memory is faster as compared to accessing the data from the hard disk? Okay. It is something like this. In your cupboard, you have a smaller space. Lesser number of items are stored. It is easier for you to search an item in that

and another partition which is a huge where there are so many items are stored. To search something in that, it will take more time. So that is the logic here. So RAM is having lower access. It will store only active. Hard disk is storing everything. Active, inactive as well. So it is a little slower. Memory is faster. That's right. It's not about only missing code, more than that. Fine. Which tool is he using for commands? I'm using, OK, I'm not sure about, you're asking which tool is he using for commands. I am using Putty to connect to the server remotely. The tool I am using for commands, if you are referring to copy-paste, I'm using memory again. I'm taking the command from my notepad, copying it. The moment I copy, it goes to my memory, laptop memory. And then when I go to the remote server, when I paste it there, It goes into the memory of my remote server. But both of them are in my same laptop because my Linux is a virtual machine

run by VMware workstation in my laptop itself. Can we have it in the next session tomorrow? Yes, that's what we are going to do. We are expecting an additional parameter. What is that? How it works? What we will get? Everything. Writing to computer memory is, yeah, I think. you are answering. Okay, all these are answers to the questions. I will share the code file to test in our system. I will share it, upload it in the modal. You will be able to download it. It will be the form of a PDF file. You can create it. I do see Pritam. Pritam, I am allowing your mic if you have any questions please quickly i have taken 15 minutes extra already um and whoever is good enough no questions you can definitely log in so any feedback please let me know uh because i'll be increasing my speed from the next session uh so if that is uh going to be okay or not, we will know the next. What was the speed in this session? Did help you to understand

or not? If you have any feedback, you can also tell. Yes, Pritam. You there? It looks like some saving Pritam. Okay, I am allowing Deepak. Deepak, you are there. Deepak Roy, if you are talking then you are talking on mute, maybe it is Abhi Krishna Chandra, I am allowing your mic, there is Krishna, see there, if you are talking then I am not able to hear you, looks like Krishna is also Abhi, so Deepak Rai, you are there, okay i need it i'm loving your mic now uh hi sir uh hope i'm audible yeah you are audible uh yeah first of all uh yeah thank you for this station it was a great uh session uh there was a lot of learning uh uh one question sir when you started this uh carry cram journey you said that we suppose not to have any particular specialization around the any particular operating system for example linux if you have a linux operating code if you have window code if you have mac that is also good but on this call you said like you you should

remember linux command if i'm using mac there the command would be different to visualize the similar kind of experience my first question is whether the all of the things which we have done in visualization of CPU memory utilization and all of those things can it be possible on Macintosh terminal second if not do we need to go through strictly through the Linux operating system or we should learn the commands that you have presented today okay you will definitely be able to see the same in macintosh so run this python program in your macintosh that means you need to have python installed and then run it use mac commands you should be able to see the same outcome in terms of cpu memory disk definitely it is possible it's not mandatory that you need to learn all these commands at least it is an opportunity for all of you to learn something so learning another 8 10 commands of unix is not a great thing if you are doing it well and good

because we don't know today's scenario in the industry uh when you'll get project for which operating system so that's the reason i said otherwise it's not mandatory hope that answers your question yeah yeah thanks thank you sir yeah so the question would not be like uh the thank you yeah that was the question yeah thank you for clarifying that yeah okay cool so now Now, that's fine. So, Deepak Rai, you said you are not audible, so I raised my hand. I was unable to unmute. Okay, cool. Fair enough. Varun? Yeah, hey, Sundar. Yes, that was the issue. So, that's why I raised my hand. Okay, cool. No problem. Who were raised for that, please lower your hand. Otherwise, if you are good, then we are good. So, thank you, sir. a lot of learning today's session there are some session I missed from the previous but I will go through those recording from today's session I have couple of questions one on the exit 86 vs is x86 64 architecture does there is

any difference in the memory management or the disk management on those architecture perspective secondly if I create a virtual machine sometimes in the in the as you i am using the azure for my as in cloud or provider and i sometimes sees the temp is part of the uh the vm type i selected and sometime it goes outside the vm type i selected and i need to create it as a separate disk is there as any any difference between those two or they are part of, they work similarly, but it has some differences. So that's what my second question and the third question is on the... If you continue to ask, then I will not remember. Sorry, sorry, go ahead. So what is your first, your observation of, what was your first question? So I saw that UVM that you have created has an operating system of x86 and underscore 64. Architecture. Yes. Okay, so the way the memory is managed, the way the CPU is managed is different from architecture to architecture.

Definitely the architecture will have its own components to manage memory. And when we are speaking about the architecture, here we are speaking about the hardware architecture. X86 is basically Intel motherboard. you also have risk you also have other architecture so the architecture in which the hardware is built the way it manages the hardware is different but the same operating system will have different distributions if you go and download ubuntu it will ask for which architecture you want the operating system so if you say x86 and download then x86 architecture will work arm it will work but if you want ubuntu for risk then it is a different installable that you need to download if you download x86 and run it on risk it will not work did i answer your first query yes more or less so it means the memory management and the disk management changes with the architecture we select. Is it correct? Yeah, definitely, definitely.

That's the reason the same operating system has different distribution for a different architecture. Perfect. My second question was on the, I just created a VM on Azure and sometimes you see there are some virtual machines that have temp as part of the VM type that you select. And some does not give you that temp as an option and you have to create it separately once your operating systems are where VM is up and running. Does there is a difference between these two or it's the same thing? Okay, if you are referring to the instance types like t3.micro or ie2.medium, r2. dot okay all these instance type means basically it differs of how much resources are getting allocated to that particular compute so when you are getting only 8 gb of hard disk then the operating system is not going to create partitions for every directory that it want to create it will see okay if i have only 8 gb ram then accordingly it will install the operating

system directory slash temp is an operating system directory so it is not going to create a partition for slash temp and it is supposed to be part of the overall partition it is something like this you have one room kitchen so your dining area also is part of your living area so if you have two bedroom hall kitchen then you might have a dining area very specifically identified and it will not be part of your living area or bedrooms it is something like that so if you don't want a living area sorry if you don't want a dining area then it will not be there only if you want to create one put a dining table in your living area only and use it it is something similar to that so temporary is not a must partition it will create only must partitions in the lower disk configuration. Does that answer your query? So if I understand it properly, it's like it's not mandatory and it also does not change if whatever type of VMs we choose it, correct?

Only if you're choosing a configuration with temp as a default one, you don't need to create it. Is my understanding correct? No. depending upon the size of your disk only mandatory directories directories means partitions will be created so I showed you in the disk there were three partitions in my disk so in that slash was there slash boot was there my slash temp is part of that slash it has not created a temporary so TMP should be there but it will be part of your overall partition. You will not be able to see the partition slash temp as part of your disk partitions. But if you experience that slash TMP itself is not there, then I would like to know the situation so that I can answer it. Slash TMP will be there whether it is having a different room or it is part of your living room is all the question, but it will be there. but if you don't want you can remove it if you remove the slash temp it will go no temporary space

will not be there but in case if you are using hard disk for your extended memory then the slash temp should be there that's all so it is at the OS architecture level I hope I answered your query yeah I think so but I will make you a specific screenshot in a personal chat what i was referring so maybe it's a more good and one last question sir sorry i'm taking a little more time is on the os disk versus data disk are they same or they are different uh when we see in any instance in a in a in a cloud we wanted to create a virtual machine we get two options creating using an os disk and data disk is the same disk or it has some difference in the in the meaning of You are more asking about the cloud. No problem, no problem. See, what happens is, if you are buying a hard disk with one terabyte, now in that hard disk only, you are going to store your operating system and you are also going to store your data in the same disk only physically.

You don't have any other disk, only one disk you have. So now that disk will be partitioned into operating system area and data area. And whatever operating system area physically from this sector to this sector, only operating system will use so that I can control that not everyone will have access to it. Now data area. That data area, I will give access to the user so that they can store their data, retrieve, remove, whatever they wanted to do. So these two are partitioned in the same physical hard disk. But in case of the Cloud, when it is asking about YS disk and data disk, what they are trying to do is they are trying to give you a disk of 8 GB, which will have only operating system. If you want additional disk to store your data, then you can ask for a data disk of any size you want. So it will be two different disks physically, though it is virtual. For your understanding, I am telling, physically you will have two disks,

in which one will have only 8 GB size, wherein only operating system will reside. That is referred as OS disk. If you don't want any extra space, don't ask for any more additional volume. The additional volume is referred as data disk. Make sense? makes sense clear clear now okay cool okay fine i do see sorrow sorrow i'm allowing your mic and this is the last question i'm going to take it's already 10 p.m now hello sir yes yeah sir i have just a very basic question like as you are showing the memory uh cpu consumption uh when you are trying to run the python program so there was a point where the cpu utilization reached 100 percent and then it uses the core two so like is this the same way it is going to happen every time like once the core one has wasted 100 percent utilization then only core two is utilized and then so on like if we have portrait core for them like for two is utilizing this then we'll be moving

to core three is this happen the same way always okay in this system i was running only one program right okay so generally in the production it will be something like this one if you are running a web server it will be a web server if you are running a front end it will be a front end if you are running a middleware it will be only middleware that will be running in those servers okay so if you're running only one program the way it is going to utilize the cores will be similar to this first it will consume the first core if it is full then it it will go to the second core. Now, instead of that, if you are going to run two programs in the same machine, then first program will start utilizing core 1, second program will start utilizing core 2. If core 1 is full, then first program will use core 2, whatever is left out. If that is also not available, that means your CPU is 100%. You should not reach that stage.

So you need to have a warning at 85% so that you can manage. If you reach 100% of both the cores, then your system is going to hack. Okay, so if I get it correctly, it is like if we're running two programs simultaneously, then core 1 will be utilized by one of the program like process and another process will utilize core 2, right? So if one of the process completes is 100% in core 1, then it would take some of the CPU from core 2 as well. if it is available and all these things are assigned by the operating system program will not know because if core 2 is 100% then operating system is going to say okay core 2 is there give some more space to this process end of the day that program is identified by the process number the process number will get additional memory or additional cpu that's yeah so there's one of uh addition to this question like yeah we know uh we are running a program but in the behind the scene i think there's the system of processors would also be

running right so will they be coming under the same cpu utilization or they are having something different like we are saying like if it is uh using 100 so the system processors would be having somewhere else running around or it is the same core or the same cpu that you would be utilizing we have only two cores of cpu so that is the same cpu which a system as well as application will use okay so it is like shared both by the system and the program yeah it is shared by all processes that is running the system but it will be controlled by the operating system so operating system will identify okay these are all my processes are nothing but operating system processes so it will know its own processes so it will not allow anybody else to access it it will not consume more than 3 to 5 percent of the CTU if you still have like two cores it will not take more than three to five percent that's the reason initially

so sir as you said like one program you will be using core one and the another program will be using core two so at that moment of time where are the system processes going to be like executed if our operating system has assigned the core one it will run in core one only okay so it is like that decision is ultimately on the operating system where it exactly oh thank you thank you sir for the clarification okay guys cool guys thank you so much i do see still there are 105 attendees part of this okay cool and i do see some chat that is coming total virtual cpu and memory can be greater than actual memory or CPU? No. That is not possible. Actual CPU and memory should be the maximum for virtual also. Okay, guys. Thank you very much. It's already 10.5pm. Have a great evening. Thank you, sir. We'll catch up next week. Tomorrow we have theory. We'll catch up. Thank you. Take care. Bye-bye. Thank you, sir.

