[00:00:44] 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 [00:01:39] i said before we do have participants from non-tech background so we will go a little [00:01:48] slow this session as well very similar to last session uh so whoever is already aware of the [00:01:58] concepts who are from system's background please bear with us for a session or two [00:02:10] then we will pick up the speed sure guys i'll definitely pass in between the sentences [00:03:39] hope the speed in which i am talking now on the break i am giving is fine if not please let me [00:03:47] know okay cool so interesting point is still we have participants joining okay let us start okay [00:05:07] i just shared my screen uh can one of you confirm if it is visible not loading me the chats [00:05:32] be able to observe our bot, stop share, okay, now it is coming, oh it says we are having trouble [00:05:47] loading your messages, try refreshing, try refreshing but it's not happening, okay now let me see, [00:05:55] yeah now it is coming [00:05:59] okay so I'm not sure when I'm sharing it's not happening I really do not know anyhow [00:06:10] that's okay let me first share my screen okay cool now let me keep this away [00:06:25] so that I can see the chat as well. [00:06:39] Abhishek, I guess [00:06:41] the participants would respond. [00:06:53] Okay, cool. Fine. [00:06:58] So now the last week [00:07:01] what we have learnt is how to create a [00:07:04] server for ourselves. A virtual machine in a [00:07:09] AWS environment. [00:07:11] and today what we are going to understand is how to observe the server utilization [00:07:20] and by observing the server utilization how are we going to map [00:07:27] the request that has been sent by the application to cpu to memory or to desk [00:07:38] how is it going to happen that is our objective of this session [00:07:43] and if we get time if we complete as expected and if we get time we are going to [00:07:50] understand the network abstraction what we have understood is server abstraction [00:07:58] now we are in the extension to that we'll be understanding the network abstraction [00:08:05] okay so now what is the objective basically when we run an application how cpu memory and disk [00:08:16] utilization is happening and especially in the ubuntu environment so we are going to use a [00:08:26] application by name systemlab. [00:08:30] This application is [00:08:32] written in Python. [00:08:36] It will run a web application [00:08:38] at port 8080. [00:08:42] It is going to handle the [00:08:44] HTTP request and it will execute the [00:08:48] now when HTTP request [00:08:55] is coming in, how is it going to [00:08:59] Because it is, application is receiving the request. [00:09:03] But end of the day, the job has to be done by the hardware that we have with the server. [00:09:09] So now how this gets converted and how we are utilizing the hardware. [00:09:15] So now the request will go to operating system. [00:09:19] The operating system that we are going to have in our server is Ubuntu, which is a Linux operating system. [00:09:26] and when application receives the request to process that request the application is going [00:09:34] to give it to the operating system not just this application any application it will give it to [00:09:41] the operating system because this application do not have any access to the hardware directly [00:09:49] So, how will it get access to the hardware? [00:09:52] Now, the operating system is going to play the role of a middleman between the application [00:09:59] and the hardware. [00:10:00] So, what are all the hardware that we are going to focus? [00:10:05] We are going to focus CPU, RAM, the main memory, the storage, that is the disk, and the network. [00:10:19] because when the request guys just wanted to confirm is my voice audible is it loud and clear [00:10:36] because i do see someone thing that is not able to hear okay fine uh fair enough then probably [00:10:46] you need to check [00:10:47] pencil, maybe [00:10:51] at your end. If you can rejoin [00:10:54] then definitely [00:10:55] maybe, otherwise it could be an [00:10:57] issue at your end. [00:11:00] Okay, cool. [00:11:02] So now our focus is [00:11:03] how CPU, [00:11:06] RAM, storage and network [00:11:07] is utilized. [00:11:12] So now the request has come [00:11:13] to the operating system. [00:11:16] So [00:11:16] operating system has [00:11:18] multiple modules on it any operating system so now the operating system will have scheduler [00:11:28] operating system will have a virtual memory not the physical memory some memory that it will have [00:11:36] when it comes up it will acquire some virtual memory and it also maintains the file system [00:11:45] file system is basically for the storage and it will also have a network stack which is the [00:11:54] operating system and what is that network stack it will have the information about [00:11:59] the interfaces the server has okay cool now the scheduler's job is basically to [00:12:12] schedule the request that the operating system has received [00:12:19] to forward it to the CPU [00:12:22] because it has to be processed by the processor only. [00:12:28] Sure, thank you, Denzil. [00:12:30] Now, that job is going to be done by the module [00:12:34] called scheduler within the operating system. [00:12:39] Among other modules, [00:12:41] the operating system also has something called [00:12:43] virtual memory. [00:12:47] So what is this? [00:12:49] This is a process. [00:12:51] This is a module. [00:12:52] It's an application. [00:12:54] Now, what is this virtual memory module is going to do? [00:12:59] It is going to manage the process. [00:13:02] Whatever has been assigned to the CPU, [00:13:05] it will manage those processes, [00:13:08] virtual addresses. [00:13:09] and in case [00:13:13] if it has to [00:13:16] the RAM [00:13:18] if it is going full [00:13:22] for example the memory [00:13:23] then it has to swap [00:13:26] it cannot continue to work [00:13:28] when it is full [00:13:31] so when it is full [00:13:33] what it will do [00:13:34] this will use the storage [00:13:38] and that [00:13:41] Concept is called extended RAM. [00:13:45] So what it will do? [00:13:48] We can convert some portion of disk as RAM. [00:13:53] That is extended RAM. [00:13:56] So what it will do is it will use that extended RAM also as part of the main RAM. [00:14:03] So if it has to, this RAM is anyhow available as a chip. [00:14:07] The storage, if you say it is by 12 GB RAM, [00:14:10] then all the 512 GB is available within this chip. [00:14:15] It doesn't have to go outside. [00:14:17] But for some reason, we think that 512 GB is not good enough. [00:14:22] Then we will define a memory called swap memory. [00:14:27] What is that swap memory? [00:14:28] Swap memory in a very, very layman's term. [00:14:32] It is about converting some portion of disk as RAM [00:14:38] in addition to the memory what we have. [00:14:40] 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. [00:14:53] Hardware, it is still 512 GB RAM only. [00:14:56] From the operating system perspective, it has 512 GB RAM. [00:15:03] Extended disk is different. [00:15:05] I said extended memory. [00:15:07] Yes, extended memory and swap memory are all same. [00:15:12] So now, this operating system assumes I have 512 GB RAM, physical RAM, and as well as I have 512 GB swap RAM. [00:15:28] So 512 GB plus 512 GB, that is 1024 GB RAM, that is now, sorry, 1024 MB, which is GB. [00:15:39] Okay, so now this I-12 MB, when it is getting filled, then it will start using this web [00:15:50] memory, that is the extended memory. [00:15:53] So that means either it will move some applications, some data from the memory to the hard disk [00:16:04] and whatever is active, that will be brought back from the storage. [00:16:14] So now, when it is swapping between RAM and storage, [00:16:21] that process is called paging. [00:16:27] That process is called paging. [00:16:29] The memory is called swap memory, which is there in the hard disk. [00:16:33] and what it is swapping, it is swapping [00:16:37] inactive data [00:16:39] from the inactive processes [00:16:43] moving to hard disk [00:16:47] and if active process has some [00:16:50] data in the hard disk, it will move it to [00:16:52] memory immediately so that the active [00:16:56] application will [00:16:58] get response from the RAM. [00:17:01] so [00:17:03] yeah so it is [00:17:05] physical RAM [00:17:06] and the technical actual name is [00:17:09] virtual RAM but it is [00:17:11] called as swap memory [00:17:13] because the data [00:17:15] is getting swapped between two [00:17:17] physical entities [00:17:18] that is one is [00:17:20] random access memory that is [00:17:23] your main memory [00:17:24] and the hard disk [00:17:26] so the activity that is [00:17:29] happening is data swapping [00:17:31] The memory location is referred as swap memory and the action that is the swapping is technically called as paging. [00:17:43] 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. [00:17:55] Both directions are referred as paging process only. [00:18:00] So, that means operating system needs to know whether paging is happening. [00:18:08] And if it is happening, then how much data is getting transferred between these two entities. [00:18:17] Now, the third entity is the file system. [00:18:20] Suppose if you are fetching data, for example, you wanted to look at the last 30 minutes log. [00:18:28] that means the log is written into the storage disk [00:18:38] so now [00:18:40] if application [00:18:43] has to write the log [00:18:46] it cannot write to the disk directly [00:18:50] it has to write through the operating system only [00:18:54] and when it comes to the operating system [00:18:57] now the operating system will understand [00:18:59] the request is to write to the disk [00:19:02] so the file system will be used [00:19:05] and [00:19:07] what is the role of file system [00:19:09] basically to manage [00:19:10] files, data, buffers [00:19:14] and coordinates [00:19:14] basically input [00:19:17] output operation [00:19:19] input is [00:19:21] basically the [00:19:23] read, output is basically [00:19:25] the write [00:19:26] so now where is this happening [00:19:29] it is happening into a physical [00:19:31] a resource called HADDOS. [00:19:35] So now, these three actually details how exactly it happens. [00:19:45] Now, all these things, where is it attached to? [00:19:50] It is attached to the motherboard. [00:19:53] So how do I identify that motherboard? [00:19:56] Using the network stack. [00:20:00] where is network [00:20:02] this application that is [00:20:04] part of the operating system is called [00:20:06] as network stack [00:20:08] and the physical hardware [00:20:10] that is present in the [00:20:12] motherboard is network [00:20:14] interface [00:20:15] network interface card [00:20:18] you can call it as NIC [00:20:19] so that NIC [00:20:21] will identify all these [00:20:24] components, how do we know [00:20:26] the CPU [00:20:27] the memory [00:20:29] and the hard disk belongs to this server [00:20:36] by taking the help from the network card. [00:20:43] So that's the reason I said in any, [00:20:46] even if you go and look at the cloud, [00:20:51] compute, compute basically combines these three. [00:20:56] When somebody is telling compute, [00:20:58] it's a combination of CPU, memory and disk. [00:21:04] Okay. [00:21:05] Now, compute is processing, [00:21:11] storage is actually the disk, network. [00:21:17] The fourth pillar of Cloud is database. [00:21:21] These four are the pillars of the Cloud. [00:21:24] Without any of these, [00:21:27] you will not be able to avail services from the Cloud. [00:21:31] So your CPU, storage, network, and database. [00:21:38] Actually, RAM, which is the main memory, is also a kind of storage. [00:21:43] We understood that in the last session. [00:21:47] But I'm just repeating so that we understand it very clearly [00:21:50] or for the new joiners. [00:21:53] So RAM is also a storage. [00:21:56] This disk is also storage. [00:21:58] RAM is temporary storage and disk is permanent storage. [00:22:04] Both these part of the storage only. [00:22:06] But the capacity of RAM is very limited. [00:22:16] But the speed to access the data that is stored in the RAM, that is very fast. [00:22:29] But in storage, that is the disk, the capacity is huge. [00:22:35] It could be one terabyte, it could be one petabyte also. [00:22:40] So the capacity is huge. [00:22:44] Because the capacity is huge, the access time is little longer compared to the memory. [00:22:51] So that is the reason when application wants any data, it is served from the memory and not directly from the disk. [00:22:58] So now if I am asking for the logs, application will give it to the operating system. [00:23:08] Operating system will go to that particular file or folder in the hard disk. [00:23:14] And then it will read block by block. [00:23:20] And then operating system will get it and operating system will give it to the main user. [00:23:28] So these three are very, very important processes of operating system. [00:23:37] Now, what is the role of network? [00:23:39] To identify these three components are belonging to me only, [00:23:44] we will use the network stack of the operating system to identify the network card. [00:23:51] And this network card, it is attached to the motherboard. [00:23:55] All these units are also attached to the motherboard. [00:23:58] so we will access the motherboard using the network [00:24:01] and we will enter into the different components [00:24:05] that the server has. [00:24:09] So now if I'm giving an application request [00:24:11] if it has to utilize the CPU scheduler [00:24:14] we'll schedule and to manage this process [00:24:17] these two storages are available [00:24:20] for us [00:24:21] and RAM has the major duty [00:24:25] is basically paging and the file system [00:24:28] is basically for storing the data into the hard disk to identify this we have network stack [00:24:35] which will communicate with the network interface card so i have given the flow summary here [00:24:43] i've given the legend as well when you receive this application please go through that in detail [00:24:50] now [00:24:52] how do we understand this practically [00:24:55] for that we have a [00:24:58] python code [00:25:00] we will understand the python [00:25:03] code first [00:25:04] and then we will execute [00:25:06] and see how exactly it [00:25:09] communicates with this hardware [00:25:11] so there is [00:25:13] an application which [00:25:15] is called a system lab [00:25:16] it is written in python language [00:25:19] this program is basically aimed at to understand the cpu the work done by cv cpu the work done by [00:25:31] memory the work done by cache and the work done by dish we know cache is part of memory sorry [00:25:39] it is part of memory as well as part of cpu the major role for cache is with the cpu [00:25:48] We understood we have three different levels of cache, L1, L2, and L3. [00:25:53] We also understood the role of it. [00:25:56] So if it is not clear to you, please go back to the previous session and understand. [00:26:01] I have just explained that in detail. [00:26:04] So this application is written in Python language, focused on these four. [00:26:09] But how are we going to understand this? [00:26:13] This has handlers. [00:26:15] I have written handlers for this program. [00:26:21] Basically, it will have, [00:26:22] handler means the URL point to the homepage. [00:26:29] The program has a homepage. [00:26:31] And it also has URL redirections [00:26:36] for CPU, memory, cache, disk. [00:26:41] And finally, putting all these together under Mixed. [00:26:45] So when I am accessing this application only, [00:26:48] then it will go to the homepage. [00:26:51] When I am accessing along with slash CPU with the URL, [00:26:56] then it is related only to the CPU. [00:26:58] But if I'm going to use mixed, [00:27:01] then all are included in that code. [00:27:06] But how do I understand? [00:27:08] I'm going to display the code. [00:27:10] whoever is [00:27:12] new to Python [00:27:14] probably [00:27:16] just try to understand [00:27:17] what you are seeing here [00:27:19] if you are not able to I think you need to learn [00:27:21] a little bit Python to understand [00:27:24] that [00:27:24] so now let me stop sharing [00:27:27] the presentation [00:27:28] what I am going to do is I am just going to share [00:27:31] the [00:27:32] small piece of code [00:27:35] hope my [00:27:37] screen is visible [00:27:39] and even the font is [00:27:47] legible. Okay. The handlers [00:27:57] are redirectors and routines [00:28:01] basically the routine at the application layer [00:28:05] also routine at the data layer. [00:28:10] Now, the routine has two different [00:28:13] roles in these two layers. For example, if I am going to [00:28:18] clear my cache at a given interval every five seconds every 50 seconds or every 50 minutes [00:28:27] i'm going to clear my cache and let the cache get generated by operations then that's a routine [00:28:37] yeah i will be sharing this code in the portal uh model you'll definitely get it as a pdf [00:28:46] then you might have to copy paste and create it as a python code so now this code [00:28:54] the first i'm telling it is a python code so it has to execute with python only [00:29:03] so now here i am putting the modules from http.server from urllib.parse import from these [00:29:14] libraries import these modules running http server and base http request handler now url lib is also [00:29:25] a library from that we are going to get modules for the modules url parse and parse qs and then [00:29:34] we are going to import other modules such as os time and m map m map because we are going to [00:29:41] to understand how OS is forwarding the request, [00:29:46] and we're going to use couple of tools. [00:29:49] Now I'm defining the host. [00:29:51] The host is 0.0.0, [00:29:55] which is nothing but the local host. [00:29:59] Now port 8080. [00:30:05] You might ask, is 127.0.0.1 is equivalent to 0.0.0.0? [00:30:10] 0.0.0.0, no. [00:30:14] Now then I'm actually writing the code. [00:30:18] Definition means I'm writing a function. [00:30:21] That means this is not getting executed now. [00:30:25] It is only getting defined. [00:30:29] Because if I have to execute, then I have to define. [00:30:33] Here what I'm defining, I'm defining a function called get underscore int. [00:30:39] That is getting the integer. [00:30:42] So I am passing some parameters and I am just returning the value. [00:30:49] Now the second is the CPU work in seconds. [00:30:55] So I am again defining this as a function. [00:31:01] The host is a server that is hosting your application. [00:31:07] The word host comes from the action that the server is doing which is hosting. [00:31:13] The server can host, the server can process, the server can store. [00:31:18] If it is hosting an application, then it is a host. [00:31:22] If it is only storing data, then it is not a host, but a storage. [00:31:32] Now, you can maintain any host name. [00:31:36] Host name is flexible. [00:31:39] and from port number [00:31:43] means each [00:31:45] host will have [00:31:47] an access [00:31:49] point [00:31:50] because when you are accessing [00:31:52] you need to access [00:31:55] an application [00:31:56] if you are going to access [00:31:59] an application [00:32:00] every application is going to [00:32:03] listen to [00:32:05] a window within the [00:32:07] host and that [00:32:09] window suppose if host is your house network is your door through which you [00:32:16] are entering into the system and what are all these windows windows are all [00:32:21] will say I my web application is available in this window my SMTP service [00:32:30] is running in this window you can come through this window if at all you wanted [00:32:34] to access smt now if you are going to access a remote unique server using a client called [00:32:43] a remote ssh client then you are accessing ssh application that open ssh application is running [00:32:56] on window 22 so like that in a host there can be n number of windows that means n number of ports [00:33:05] so we don't enter into the house [00:33:09] using the door [00:33:10] but we will access the application using the window [00:33:15] but you need to tell [00:33:17] which house window [00:33:20] for that only we are given host [00:33:23] that means the house is 0.0.0 [00:33:26] which is local computer [00:33:28] yes you are right [00:33:29] and [00:33:31] port number 8080 is the window [00:33:38] Even if only the window is open, you'll be able to access. [00:33:43] I can run an application on port 8080, [00:33:47] but I will not allow anybody to come in through that window. [00:33:51] That means I will shut that window. [00:33:54] Nobody will be able to access that application. [00:33:56] So that means I need to keep the window open [00:34:00] for someone to access the application. [00:34:04] So house is the computer. [00:34:07] door is your entry [00:34:10] window is your [00:34:12] direct access to the application [00:34:15] without entering the house [00:34:17] so now [00:34:19] in the try block [00:34:21] the get function [00:34:24] okay get is a [00:34:28] function to get the [00:34:29] value [00:34:31] it's a python function [00:34:35] that's available by default [00:34:37] so there is a program [00:34:40] written for get [00:34:41] by python itself and that has been made as an available as a function like how i have written [00:34:48] get underscore int function python has made so many functions default functions available to [00:34:56] and one of them is get what it will do it will only read and get a value for you so here what [00:35:04] is that it is it is trying to get the name of the default zero so basically it will get the [00:35:13] whatever is available in default zero zero means the first portion of the array how do i explain [00:35:25] array if you are going to assign a variable something like name then it is can have only one [00:35:38] value but if you are going to define a variable as an array that means the array can have many [00:35:51] elements within it and it is a single variable now if i want to access the first element of [00:35:59] the array i will use zero why zero zero is the starting point from the computer perspective [00:36:07] for us we may start with one that's our practice we have been educated so [00:36:14] but for computer the starting point is always zero the first element is always referred as zero [00:36:21] So get the name from the array default [00:36:25] and get the first element in this default array [00:36:31] and return maximum and min. [00:36:36] That is max of maximum comma min value comma maximum. [00:36:42] So the minimum value and the maximum value [00:36:45] will be returned for the value. [00:36:48] now [00:36:50] this is try [00:36:52] if something goes wrong [00:36:54] in the try [00:36:56] then it will [00:37:00] just execute [00:37:02] what is available in default [00:37:03] suppose if it is not [00:37:06] able to get [00:37:06] default variable or if it is not [00:37:10] able to find the name variable [00:37:12] then it will go to exception [00:37:14] that is because the scenario is [00:37:16] exception [00:37:20] Yes, there will be an exam for lab also. [00:37:24] You will not be asked to write Python programs. [00:37:29] Don't worry about it. [00:37:31] But if you can understand a Python program, that is what is expected. [00:37:36] So now I have defined get init function. [00:37:40] Then CPU work. [00:37:43] Then if you look at it, every function is returning some value. [00:37:49] And that value is found out by executing this process. [00:37:54] And this process is within this loop. [00:37:57] And this loop, there is a condition while. [00:38:00] And this while condition is part of the function, [00:38:03] cpu underscore work. [00:38:08] Yes, both are predefined functions. [00:38:12] That's right. [00:38:14] Now, if value has an error or if the type is an error, [00:38:19] then return to default. [00:38:20] That is what it is. [00:38:23] Now I am defining, I relate it to CPU, I defined. [00:38:27] Now this is a function I defined for memory work. [00:38:32] And there is one more function. [00:38:34] It is actually returning the checksum. [00:38:37] So that means it is getting the value for checksum in this entire process [00:38:41] and returning the checksum if I am executing this function. [00:38:46] Similarly, I have cache underscore work. [00:38:49] it is also a function and we also have disk underscore work now this definition is [00:39:00] whatever parameter for example when i am defining this function this function is [00:39:05] expecting a parameter and that parameter is stored as variable empty so that means [00:39:13] disk underscore work in bracket if i give 1024 then that 1024 will be used to calculate the size [00:39:22] basically 1024 into 1024 into 1024 this is megabyte what you are entering this kilobyte [00:39:29] and this is byte so whatever you are entering will be converted to the bytes [00:39:36] then storing the buffer and then i'm trying to process the entire thing wherein we are doing [00:39:47] since it is related to the disk disk work i do have two different processes within this [00:39:55] one is about the read another one is about the write so then finally we have the system [00:40:07] lab handler, that is the base [00:40:09] HTTP requested handler [00:40:11] and [00:40:12] it is going to be in UTF [00:40:15] as a need HTTP [00:40:16] and when it is responding you send [00:40:21] the response 200, 200 is nothing [00:40:23] but a success code for the [00:40:25] HTTP protocol [00:40:26] could be [00:40:32] from a dictionary [00:40:33] or could [00:40:36] be from the returned values [00:40:38] so [00:40:40] So the returned values variable can be a dictionary, [00:40:43] but in this example, none of them are dictionary. [00:40:47] We are using only arrays. [00:40:50] Now coming back, there is a function within this class. [00:41:00] Send the text, do get. [00:41:04] And within that also try, you can observe that. [00:41:11] If condition, if path is equal to slash. [00:41:15] That means the base HTTP request of Handler. [00:41:19] Handler has only slash and no extended page. [00:41:36] Yes, Anuj, Anuj, I will do that if it is possible. [00:41:41] You say it is possible, so let me try after explaining. [00:41:45] So now this CPU, if you have in your URL, [00:41:52] not just a home page, but with slash CPU, [00:41:56] then we want this to be executed. [00:41:59] basically it will display the cpu workload completed how much is the duration requested [00:42:07] what is the elapsed time and what is the result all the three it will display same for memory [00:42:14] if it is slash memory and same for cache if it is for cache and disk slash disk [00:42:22] it will say how much data was written how much time it took to write how much time read activity [00:42:32] was that and what is the bytes right so basically write and read information how much time it took [00:42:39] and how much data either read or written now finally mixed what is mixed instead of giving [00:42:47] slash cpu slash disk slash you just give slash mixed all will work together when i calling this [00:42:59] cpu underscore work i'm just calling the function where is this function i showed you initially we [00:43:05] are defining these functions at the top we have definition cpu work so when i'm going to execute [00:43:12] this will get executed into the all will get executed and it will display the permission [00:43:23] now where am i having this but before this let me see if i can share this [00:43:35] show formatting options, actions and apps, now set delivery options, okay, you can only [00:43:47] schedule a message, yes it will work, I am not able to understand what you mean by out [00:44:12] bound if you are familiar with Python code then you'll definitely be not out [00:44:25] of bound since you're using technical words I believe you know fine let me see [00:44:35] if i have the option uh okay okay okay okay okay now i'll not be able to share it in the chat [00:44:45] uh yeah i'm going to share only the dot file file in the [00:44:51] model so now let me close let me stop sharing [00:44:56] this i will stop sharing i believe but now let me go back and share [00:45:01] my screen again to the console let's wait and see Anupam so now I have shared my console [00:45:25] let me stop sharing let me share my whole screen so that [00:45:32] to get a chance to see and if i am pressing the alt tab where is it okay here it is [00:45:44] let me share the screen above my screen is visible are we good are you able to see [00:45:58] okay i do see a couple of you have raised your hands i'll definitely give your mic [00:46:05] after completing this demonstration but okay so now this is my linux this is a virtual machine [00:46:18] and it is running ubuntu so what is uname will give me what is the operating system [00:46:28] Linux operating system [00:46:30] and if I give [00:46:32] you name hyphen A [00:46:34] it is going to tell me that [00:46:36] it is running a [00:46:38] new Linux [00:46:39] of x86 64 [00:46:42] bit operating system [00:46:44] the kernel version is [00:46:48] 7.0 [00:46:49] 7.x [00:46:50] so now as part of [00:46:55] since I am going to run [00:46:57] Python program [00:47:00] we need to have Python installed [00:47:02] So, I'll be mentioning all those things in the document as a prerequisite, one-time preparation. [00:47:08] So, now let's get on to that. [00:47:13] So, now let us first verify our storage. [00:47:21] Basically, the lsblock command is going to give us the storage. [00:47:30] now [00:47:32] if I [00:47:34] give this, it is telling [00:47:36] there are [00:47:38] I have asked for the name [00:47:39] what is the size, what is the type [00:47:42] what is the file system type [00:47:44] what are all the mount [00:47:46] points and the model [00:47:48] so the most important thing [00:47:50] is these are all loopbacks [00:47:51] now the disk is [00:47:55] SDG, this is the virtual [00:47:58] disk, what is the capacity [00:48:00] of the virtual disk 60 GB. Now out of the 60 GB this has been partitioned into three parts. [00:48:12] Now SDA1 which is the first partition has only one MB. The second partition is SDA2 [00:48:24] it's a sub partition to sda that has only 2 gb of space and the type is extended for [00:48:34] mount point is slash boot so this partition will have where the information about where exactly the [00:48:43] boot sequence available it will basically point to this and it will find the [00:48:49] boot up sequence basically it will point out where in the disk the operating system is available [00:48:59] and that disk is the sda3 so this sda3 is 58 gb so if you put together it is 60 gb hard disk [00:49:13] Now out of this 58 GB, this is actually volumized by with LVM. [00:49:22] You can see the type as LVM. [00:49:24] And allocated is only 29 GB. [00:49:27] So total is 60 GB, Sundar. [00:49:33] So out of that, 1 MB and 2 GB. [00:49:38] And this is 29 GB. [00:49:40] So 31 GB is only used. [00:49:42] Yeah, that is right. [00:49:44] 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. [00:50:07] the 29 gb is not used so not used we have allocated but it is not used [00:50:15] okay now the first thing is the same program what we saw the system lab [00:50:27] is available in this directory so i'm just i've created a directory called system lab [00:50:35] and i'm going to that directory to see answer again and again so let me just [00:50:44] allow you okay okay let me allow you priyanka your mic is allowed you can talk if you are there [00:51:13] uh good evening sir yeah uh sir i wanted to know if you can share a sample papers for the subject [00:51:22] sample [00:51:24] sample papers for the subject [00:51:27] what do you mean by sample paper [00:51:30] the previous year questions or something like that [00:51:32] similar questions [00:51:34] yes sir [00:51:34] I will provide it by end of the session [00:51:38] before the [00:51:40] examinations definitely you will have [00:51:42] topic by topic [00:51:43] anything else Priyanka [00:51:46] sir and do we have to write this code [00:51:48] which you are showing now [00:51:50] no no [00:51:51] Python code, you will not be expected to write. [00:51:55] If it is required, it may not be required at all, [00:51:59] but you are expected to understand the commands, Linux commands. [00:52:07] So if you are not comfortable with Linux, [00:52:09] at least the commands that we are using, [00:52:12] I would expect you to learn. [00:52:15] Are we good? [00:52:16] Okay, sir. [00:52:18] Sir, and for example, only we'll have MCQs, right? [00:52:21] That is right. [00:52:22] No. [00:52:23] From the exam perspective, [00:52:25] exam, when I say exam, [00:52:27] I'm assuming end semester exam. [00:52:30] You will have MCQs. [00:52:32] You will have descriptive as well. [00:52:36] Okay, sir. [00:52:38] Anything else? [00:52:40] No, sir. [00:52:41] I'm done. [00:52:42] Thank you, sir. [00:52:43] Okay, thank you. [00:52:44] Can you please lower your hand, Priyanka? [00:52:47] So now, Anuji, I'm allowing your mic. [00:52:51] Anuji, if you are there [00:52:57] I have [00:52:59] allowed your mic [00:53:00] Yes, Anuji [00:53:03] So, Professor, my query is [00:53:06] Yes, Anuji [00:53:11] My query is with regards to [00:53:14] the last portion you said [00:53:16] around the hard drive [00:53:18] you can say expansion [00:53:20] if you can [00:53:21] get into that portion once again [00:53:24] where you are explaining the [00:53:25] respective alignments [00:53:28] like how the [00:53:29] are you speaking about [00:53:32] this one [00:53:34] what is there available on the screen [00:53:36] yes [00:53:36] cool [00:53:38] so if I say [00:53:40] go ahead [00:53:42] so if I just trying to understand [00:53:45] how this [00:53:45] FS type is being [00:53:49] differentiated and [00:53:50] what is being [00:53:52] a kind of difference [00:53:55] when LVM and ROM [00:53:56] as well as the part is being [00:53:58] aligned to certain [00:54:00] like a sda1 sda2 and sda3 sections because it seems it's also a area where ubuntu is working [00:54:10] but how come they are being different i'm just trying to understand this first thing is that [00:54:15] and how this loopback is actively like allocated to a mount point currently are we anyhow running [00:54:25] any kind of like self-attention or self-attentive you can say job here so it's actually running in [00:54:34] its own own system and executing to a similar one point somehow or it's a first net we can say fresh [00:54:41] ec2 instance and then we just connected there so kind of thought process i'm building as an analogy [00:54:47] that what is being going on okay cool so let me answer your second question first this loop is [00:54:54] created by the operating system when it got installed into this hard disk so when you're [00:55:00] installing the operating system it means that the operating system is creating its own files [00:55:06] it owns its own directories in the hard drive and it will start with a directory called slash boot [00:55:15] it will create slash boot and it will write all the information related to the system [00:55:22] and then the control will go to the [00:55:25] operating system. So [00:55:26] when you are [00:55:28] booting the system, if I reboot [00:55:31] this virtual machine now [00:55:32] what will happen is it will [00:55:35] shut down the operating system [00:55:36] and then it will start again. [00:55:40] Reboot is nothing but [00:55:41] shutting down and starting. [00:55:43] So when we are starting [00:55:45] again, first thing [00:55:47] is it will look for this [00:55:48] partition. Basically this [00:55:51] hard disk 60 GB is partitioned into three parts one is 2 GB second is 58 GB and the first one is [00:56:02] 1 megabyte so when operating system starts again it will first look for this partition that's why [00:56:11] if you look at there is no FS type by that's a default position in the hard disk that operating [00:56:18] system will go when it reboots and that will specify where exactly is the boot disk available [00:56:26] what is boot disk boot disk will have the bootable information saying that okay your [00:56:32] operating system is available in slash usr slash local etc etc that information will be available [00:56:40] in this so it will take that information from the boot disk and then continue with the operating [00:56:46] system which is stored in this 58 gb but now this is this 58 gb though it is partitioned [00:56:55] is it fully utilized no you have bought a site of 1200 square feet and you have planned to build a [00:57:06] house of 800 square feet but as of now you are building only 600 square feet you planned to [00:57:14] build a three bedroom all kitchen but as of now whatever reason it may be you are building only [00:57:19] two bedroom all kitchen but other space is still there whenever you want you can build the third [00:57:26] bedroom and make it part of your house that is what exactly happened here only 29 gb is allocated [00:57:33] to this volume now this 58 gb is broken down into only one volume and that's why it says that lvm [00:57:41] and LVM is basically the volume manager. [00:57:46] So this volume manager has taken 29 GB out of this 58 GB [00:57:50] and then made it as a volume by the name Ubuntu VG Ubuntu hyphen hyphen L. [00:57:59] So now that has 29 GB. [00:58:02] So what will happen to the rest of 29 GB? [00:58:04] If you want to add the available 29 GB, which is not allocated to any volume, [00:58:10] You can use the volume manager and extend this 29 GB to 58 GB directly. [00:58:16] Or you can add one more volume under SDA3 and then make it 29 GB. [00:58:23] However you want, you can. [00:58:25] But that is about the disk administration. [00:58:28] But from our perspective, what we need to understand is [00:58:31] the disk is getting partitioned into multiple partitions. [00:58:37] one is boot partition [00:58:40] that will lead to operating system [00:58:42] and operating system will start [00:58:44] coming up. Once operating system [00:58:46] comes up, it will be able to identify [00:58:48] all other resources [00:58:50] your CPU, your [00:58:52] memory, your disk, your [00:58:54] network card, your [00:58:56] you know [00:58:57] graphic card, everything [00:59:00] whatever is there in the motherboard [00:59:02] the operating system will start detecting [00:59:04] it. Only after that all [00:59:06] All those resources will be available to you. [00:59:09] That is what I was trying to explain this. [00:59:11] Hope it is clear. [00:59:14] Anuja? [00:59:19] Are we good? [00:59:24] Okay. [00:59:25] Not sure. [00:59:26] Okay. [00:59:27] Yes, Varun. [00:59:28] I'll take two more questions now. [00:59:30] Rest. [00:59:32] I'll take it later in the session. [00:59:40] Okay. [00:59:40] I am allowing you, Shivam. [00:59:44] if you are there please speak up hello yes good evening sir yeah very good actually i need a book [01:00:04] related to this course for studying how can i get one because everything you is because everything [01:00:12] you is related to python is new to me so i need to book some study material to understand this [01:00:21] concept for data okay concept is related to the system only okay demonstrate the system concept [01:00:31] i need an application and that application i have written in python so i just briefed about how the [01:00:40] python program looks if you are not aware of python programming then you can ignore that [01:00:46] not an issue [01:00:48] and if you really want to learn [01:00:53] Python fundamentals [01:00:54] you can go to any [01:00:57] source because Python is a very [01:00:59] common programming language [01:01:00] any source in the [01:01:03] internet [01:01:03] you can even as [01:01:06] simple as Jigs for Jigs [01:01:09] go and learn [01:01:10] probably 8 or 10 chapters [01:01:12] basics you will get to know [01:01:15] Python [01:01:15] uh sir have any uh link for this course and any study metal so can more than help for me [01:01:25] you can say i will i will i will i will do that when i'm uploading this presentation i will add [01:01:34] a source for python knowledge also okay thank you sir okay cool [01:01:42] Suraj, you there? [01:01:46] Good evening, sir. [01:01:53] Yes, Suraj. [01:01:55] Sir, my question is also similar to the Shivam. [01:01:58] I have the experience about the Python and the web development, [01:02:02] but I want to know where I can get the soft copy or hard copy [01:02:07] about the foundations of computer system. [01:02:11] As because we have the last lab about the EC2 instance in VM, [01:02:16] I am trying to create the one and able to successfully create the one instance. [01:02:23] After doing this lab in the activity, how I can do it? [01:02:26] Should I do it? [01:02:27] When you have brought up the virtual machine in AWS or any other cloud, [01:02:33] log into that virtual machine and however I'm doing, you can do the same thing. [01:02:38] Only thing is, if you have chosen Ubuntu, command is same. [01:02:41] if you have chosen any other linux variants the command format will change here and there a little [01:02:48] bit but command is going to be the same okay answer uh in my system do we have the same amount [01:02:55] of memory as you are doing this or we need to make when you have created the when you have created [01:03:02] the virtual machine yeah whatever ram or whatever memory you have defined that much will be created [01:03:10] for uh sir i have created the same t2 micro free instance t2 micro t2 micro i think it will give [01:03:19] you a 4gb ram yes if i'm right yeah 4gb ram you will get so we have to split us uh applic [01:03:29] vm that is that is memory but this is a disk okay so in your vm if you have said i want 60 gb [01:03:39] 60 GB will be [01:03:41] given to you as [01:03:43] disk. If you are told [01:03:45] 20 GB, then you will get only [01:03:47] 20 GB. The default is only [01:03:49] 8 GB in AWS. [01:03:52] And can [01:03:52] sir, my last question is, can you highlight [01:03:55] some use case in the [01:03:57] real production environment? [01:03:59] Suppose someone has the e-commerce website [01:04:01] and he is deploying his [01:04:02] website to the VM [01:04:04] and why he needs to split [01:04:07] his memory according to it? [01:04:09] So we are not splitting the memory. [01:04:11] No, we are not splitting the memory. [01:04:13] We are splitting the hard disk. [01:04:17] So what is the core idea to splitting the hard disk? [01:04:20] I want to get it. [01:04:22] Core area is you want to control what is getting stored where. [01:04:28] And you don't want to allow an application to use more than what you are allocating. [01:04:36] That you want to control. [01:04:38] That is the reason. [01:04:39] And second thing is the security. [01:04:41] You can control all this at the mount level or the volume level. [01:04:49] I can give you access for this volume and another 29 GB, [01:04:54] if I make it as another volume next to this, [01:04:57] I need not have to give access to this second volume. [01:05:03] So all those control I can have as a system administrator. [01:05:06] that's why we are [01:05:09] partitioning it [01:05:12] and for example [01:05:14] this partition [01:05:16] nobody will have access to [01:05:18] you will not be able to access [01:05:21] slash boot [01:05:22] like how I am accessing [01:05:25] system lab you can't access [01:05:27] slash boot as a normal user [01:05:28] I can control all those mechanism [01:05:31] ok cool [01:05:39] are we good [01:05:40] ok the last question [01:05:50] and then we will [01:05:52] progress [01:05:54] yes, Rajat [01:05:58] Rajat, you there [01:06:08] disabling your mic [01:06:14] wearing your hand [01:06:17] as well [01:06:17] okay, Krishna Kumar [01:06:21] yeah, good evening sir [01:06:26] actual [01:06:28] being the industry professionals [01:06:30] we have only time [01:06:32] on the fully time dedicated [01:06:33] time Saturday and Sunday [01:06:35] for the course so there are the five hours lectures means a big lectures so we are following [01:06:43] your recording and all things so it would be better if providing the thought notes and things [01:06:49] so that when during that the exam times are previous to one week or exam we can refer to [01:06:57] that also or because we have not too much time to the refer book and these things so we are totally [01:07:03] based on your lecture and these things is this is sufficient for the exam point of view or how [01:07:08] can you suggest my sessions are sufficient for the exam and whatever i'm covering for example [01:07:17] lsblk is the command i'm suffering so you can just learn lsblk from that perspective [01:07:25] and like whatever commands we are using from the operating system perspective that should be [01:07:31] sufficient end of the day you should understand the concept you don't need to understand or know [01:07:37] the entire operating system or you don't need to know the entire programming what we are trying to [01:07:44] understand is the components of the hardware how it is working great sir so we are yes great so we [01:07:53] totally follow your lectures and it would be better if short notes would be the provided [01:07:59] which is the main or clue [01:08:01] so that would be better [01:08:02] I'll definitely try to give it [01:08:06] but for that I need [01:08:07] some time but I'll give it [01:08:09] sure sure [01:08:11] thank you sir [01:08:12] okay so now [01:08:14] let us get back [01:08:16] so now [01:08:18] how do I understand [01:08:21] you have [01:08:23] the system here [01:08:25] there is one [01:08:27] application [01:08:30] is that application running no it is not running yet and whatever code we saw [01:08:38] that is available in this directory in the system the whole code now if i have to run this program [01:08:47] since it is an executable i will directly run it with slash dot and the name of the file now this [01:08:59] If I enter, you can see it is saying that line number 398 in module main, server host, some error it is giving. [01:09:18] Okay, cool. [01:09:19] Now, it says one thing which is very clear is address already in use. [01:09:26] okay so now let me look at the processes how will i look at the processes processes means [01:09:36] nothing but the processes that cpu is handling so now i will ps is the command which will list [01:09:44] the processes that is already running in the cpu and i'm just going to grep for the name of the [01:09:53] process that starts with system there is nothing there is nothing this process is not running [01:10:02] but it is also okay this is correct this is correct this is correct okay fine so now let [01:10:19] me see if it is going to give the error a guy if not let me just run it with python [01:10:26] if that is the case i can call the same program with python i'll just say python 3 that is the [01:10:35] program i'll just say system lab till it is giving error so basically it is supposed to start [01:10:43] and then it is supposed to stay there so that this application can be accessed [01:10:51] and if it is running [01:10:54] then it will be running on this [01:10:55] just give me a minute, let me just check [01:10:58] what is the issue here [01:10:59] I did demonstrate [01:11:03] this, it was working [01:11:04] but I really [01:11:06] yeah, server binding [01:11:09] error, yes [01:11:18] I could see [01:11:20] new messages that is coming in [01:11:22] just change the port sir [01:11:24] why should I change the port [01:11:25] port is already in use [01:11:28] but it should not be right [01:11:30] I am not running this [01:11:33] so why will it [01:11:34] why will it [01:11:37] hold [01:11:37] so I [01:11:44] can see all these things [01:11:46] I can [01:11:47] but let me do [01:11:50] that offline [01:11:51] very good very good very good [01:12:06] I like [01:12:08] all those [01:12:09] suggestions but as all the packages [01:12:12] are there [01:12:13] so now [01:12:15] let me [01:12:17] okay cool guys [01:12:30] hold on I understand [01:12:32] okay [01:12:34] so now if you look at it [01:12:36] I did not change [01:12:38] the port but what I did is [01:12:40] I killed the [01:12:42] it was a zombie [01:12:43] which was using 8080 [01:12:46] because probably last [01:12:48] time when I used [01:12:50] this and I came out of the system [01:12:52] i might have not stopped the application i might have just left it like that so there was a zombie [01:12:57] process which was running what is zombie process it just remembers but it doesn't know what it is [01:13:03] that is zombie so it was remembering yes there is something which is running at 8080 but it [01:13:08] doesn't know what it is so and now i'm just going to leave this console as is and i'm going to [01:13:18] open another console [01:13:20] and I'm going to log in [01:13:23] and I'm a [01:13:25] user called Sundar [01:13:26] but I want to become [01:13:28] super user so I'm using [01:13:30] sudo, sudo is nothing but [01:13:33] a command that will make you [01:13:35] super user, which sudo [01:13:37] you want, I want to become a super user [01:13:39] that is su, super user [01:13:41] is nothing but the root [01:13:42] and I want to get all my environment [01:13:44] also, so hyphen [01:13:46] so now it is asking for the authentication which authentication [01:13:51] whether sundar is allowed should be visible let me [01:13:59] how about now is the second screen visible okay so this is the second screen i opened [01:14:23] the first screen my program is running [01:14:27] now I have come to the second screen [01:14:29] in this second screen [01:14:32] I am just going to access [01:14:35] the application [01:14:36] how can I access the application [01:14:40] I can use the curl command [01:14:42] but before that [01:14:46] let us understand [01:14:48] where is this process is running [01:14:50] so I can use [01:14:52] yes okay let me let me repeat so i don't know i did not unmute i think sarah's got tips [01:25:01] okay fine no problem sorry guys so this is my first window where i'm running my python program [01:25:13] and this is running if i press ctrl c this program will stop i'm not pressing ctrl c [01:25:21] i am allowing it to hey man one second one second guys one second guys one second one second [01:25:32] okay hope my screen is visible now rohan fine so i am running my system lab dot python i think for [01:25:49] some time i'm not going to focus on chat i think that's where exactly something i clicked somewhere [01:25:55] it went off so i'm running systemlab.py in one screen and if i press ctrl c this program will [01:26:06] stop i'm not going to press ctrl c i will continue to allow this is my screen one and this screen two [01:26:14] basically what we were trying to understand is we know that this systemlab.python program [01:26:22] is utilizing the CPU and [01:26:26] there is a process ID that has been [01:26:30] allocated by the CPU for this systemlab.python [01:26:34] how I can identify that [01:26:37] for that only we [01:26:40] ran this command wherein the output said [01:26:45] 1740 is the process ID for [01:26:50] this systemlab.python program. [01:26:54] Now, when I know the process ID, [01:26:58] I can use the native ps command [01:27:01] and get relevant information [01:27:04] by asking for specific information. [01:27:07] iPhone O is nothing but give me an output [01:27:09] of all these things. [01:27:12] For which process? [01:27:13] Now it is 1740 is the process ID [01:27:17] of my systemlab.python. [01:27:19] So I'm just going to give for hyphen piece, nothing but we can tell which process ID. [01:27:26] So I'm giving 1740 and I am giving an enter. [01:27:31] Now it is giving process ID 1740, which I asked for. [01:27:35] It also gives percentage CPU and the percentage memory. [01:27:40] Basically, this program, systemlab.python, is not using any CPU at this point of time. [01:27:47] though this process is loaded in the memory when i say process this python is loaded in the memory [01:27:54] and it is occupying only 0.5 percent at this point of time now i have understood it is using cpu [01:28:06] it is using memory now what is this 1662 sundar this 1662 is nothing but the parent [01:28:17] process id like how 1740 is the process id for system lab and this system lab is a python program [01:28:26] so who is running this program python is running this program how do i know the command used to run [01:28:35] this program is python3 and what is the process id for this command is 1662 so python3 is a parent [01:28:45] for systemlab.py so systemlab.py process id is 1740 and python3 process id is 1662 [01:28:56] this is how i will get to understand now how much python3 is occupied because it is also a process [01:29:06] running in cpu so instead of putting 1740 if i put 1662 that is the process id of the python [01:29:17] now it is going to say for process id 1662 which is of python the parent is 1660 that means the [01:29:27] parent of python is 1660 and what is that command is the shell unix shell and this unique shell [01:29:36] is running the python and this python is running systemlab.py program so this is how we will [01:29:47] connect what is running what now if you look at python python is occupying only 0.1 percent of [01:29:55] the memory wherein this python program is occupying 0.5 percent that means the whole program is [01:30:05] running on is running in the memory now what is this 0.5 percent is relevant to it is relevant to [01:30:12] 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 [01:30:22] occupied by my python program and 0.1 percent is occupied by the python application itself [01:30:31] now this is how i will get to know about the utilization so what is ps stat is basically [01:30:41] process that process state right now it is sleeping that means the process is sleeping [01:30:50] it's not doing anything and what is rss it is the resident memory that means how much is swapped [01:31:00] we spoke about the swap memory that will give this for now let us hold on to the vsz which is [01:31:07] virtual address space which is physical address space of the cpu we're not going to get into the [01:31:15] details of it but i just wanted to tell you what is vsz that is virtual address space now [01:31:22] what we are going to do is [01:31:25] we are going to generate the CPU [01:31:28] currently the CPU utilization is 0 [01:31:31] now if I do something with the application [01:31:34] then it is going to utilize the processor [01:31:37] now let me [01:31:39] run the CPU [01:31:43] within this application [01:31:44] how am I going to run this application [01:31:48] where is it accessible [01:31:49] it is listening on local host [01:31:52] that is the local computer [01:31:54] at 8080 [01:31:56] okay cool [01:31:57] what are all the applications available [01:32:00] end points I have [01:32:01] which is the home page [01:32:03] that is slash [01:32:05] second is I also have something called [01:32:08] slash CPU [01:32:10] I also have [01:32:12] slash memory and it is given [01:32:14] an example [01:32:15] give it in the terms of seconds [01:32:18] how many seconds you wanted to [01:32:22] Put pressure on the CPU, 10 seconds. [01:32:26] Okay, cool. [01:32:27] Now, what I am going to do is, [01:32:31] I am going to continuously monitor the application. [01:32:37] Because our focus is only on 1740, [01:32:39] which is our program, systemlab.py. [01:32:45] So, I can also save this process ID. [01:32:49] I can also save this process ID to a variable. [01:32:55] How can I do that? [01:32:57] I can define a variable in Unix, that is PID. [01:33:02] Let me define it as a variable name. [01:33:05] I can ask this PID to store. [01:33:11] I'm using same whatever pgraph, [01:33:14] look for systemlab.py. [01:33:19] head one means first line so what is the first line here it is this is the line only one line [01:33:25] is there out of which only the first part that is one seven four zero now this echo command is going [01:33:33] to tell what is stored in that so now this echo command is telling it is in pid variable we have [01:33:42] the process number so 1740 now i have a command called top top in unix which is basically going to [01:33:59] tell us what is being utilized in all the processes now i want a very specific process [01:34:09] so i'm going to give the process id i can mention 1750 also since i have stored it in pid variable [01:34:17] i'm using the variable now if you look at it this top now it says that percentage cpu our focus is [01:34:27] percentage tpu user is zero system is also zero at this point of time but system is [01:34:38] moving away moving away becoming zero ideal is 100 percent when these two are zero this is 100 [01:34:49] percent when this is utilizing something then this is reducing so now this is [01:34:56] This 1750 is run by Python 3, not using any memory or any CPU at this point of time. [01:35:06] Now, I can also use a watch command for this or I can also use htop, whichever you are convenient. [01:35:14] But now what I'm going to do is, I'm going to run the program. [01:35:20] How am I going to run the program? [01:35:22] I'm going to access the program using the curl command. [01:35:28] What is that curl command is going to do? [01:35:30] It is going to put some process for 20 seconds. [01:35:38] Here it says you mentioned in seconds. [01:35:41] What did that CPU program, what we saw in the Python program, [01:35:45] it is doing some calculations so that CPU will get engaged. [01:35:50] So now I'm going to engage for 20 seconds. [01:35:54] First, let me do it for 5 seconds and focus here in the CPU percentage. [01:36:03] If I'm going to engage this program as a user for 5 seconds, you can see, is there anything getting utilized? [01:36:11] You can see 41.3 user. [01:36:15] System is using only 0.2. [01:36:17] Now, when I engaged for 5 seconds, there was an utilization of the CPU by this program. [01:36:27] Now if I'm going to engage for 20 seconds longer, that means it is longer means more [01:36:35] users are utilizing it. [01:36:37] That is the concept I'm trying to drive. [01:36:42] Now I'm engaging with this application for 20 seconds. [01:36:46] you can see cpu utilization is 50 percent from the user this is user this is system and this is idle [01:36:58] so these will be followed when it is 50 it is 49 now it is 9 it is 90 now it is zero [01:37:07] both system and us idle is 100 so for this program suppose if i add one more process id that is [01:37:19] 1662 i can add that also let me see let me show you without any specific the top is going to tell [01:37:29] this is what it is going to do that means there are so many commands are running for all these [01:37:36] commands process ids are available and the process ids from 1 to 900 sorry 1 to 999 is basically [01:37:46] operating system processes that is what is referred here as system processes for example [01:37:53] if you look at it ksoft irqd or vm tool or k thread all these are the processes initiated by [01:38:03] the operating system which is point now user also is zero zero there are no requests all the processes [01:38:13] are there now you focus here what is coming in the cpu because we are going to put pressure on the cpu [01:38:22] focus here what is coming on top right now some vm tool is coming which is operating system [01:38:29] related now i am putting pressure onto the tpu how by doing some process now i'm doing it for [01:38:38] 20 seconds you should be able to see see the python 3 it is cpu is 99.7 percent [01:38:49] which is python 3 it is 1740. 1740 is our python program which is running it python 3 now we can [01:38:59] see 45.2 percent now this has come out the process is over here it has come out you can see the cpu [01:39:10] coming down so the moment you give access to the application application is giving it to operating [01:39:20] system operating system is giving it to the python program and python program knows how to run the [01:39:27] python now to access the actual processor operating system again identifies how by [01:39:36] giving the process id allocated by operating system now cpu will get instruction this is [01:39:46] what we spoke about isa instruction set architecture now here when i am giving this curl command [01:39:55] the curl first has to identify this localhost so it is going via the network then it needs to [01:40:04] identify the window that is port number in this port number what is running systemlab.python [01:40:13] okay and within systemlab i want to access the function cpu that is slash cpu and run it for [01:40:22] 20 seconds we generated cpu we observed that when we give processes request then cpu is getting [01:40:33] utilized now we can also look at in a different way the cpu but did application directly control [01:40:44] the cpu the answer is no okay now let us look at it in a different way there is an another command [01:40:53] in unix basically which is mp stat basically statistics i'm asking for all quotes [01:41:05] and i want only one so now if you look at it it is going on displaying it is now if you look at [01:41:15] here percentage user is zero percentage system also is zero and idle is 100 percent so focus on [01:41:25] this this and this three columns it will continue to run it is giving at that point of time [01:41:34] so now if I'm going to engage with the application now you'll get a different [01:41:39] view of the same now user is 100 percent zero percent idle for this particular process [01:41:50] so basically system plus user is your total for this process it doesn't mean that it is [01:41:59] now it has come down so it has stopped become zero 18 percent 35 percent so basically when i [01:42:07] stopped this it is showing average if you look at it i have two processors this is the cp [01:42:16] i have two cores that means two processors but it was using only one the moment when this become [01:42:23] hundred percent then it started using my second processor also that means only 1.89 percent [01:42:32] average user utilization so basically did application control the cpu no application [01:42:41] gave the request to operating system and operating system was controlling the cpu to which i have two [01:42:49] processors to which processor it has to be given is told by the operating system and when the first [01:42:55] processor is 100% utilized second processor is called for the duty now the total here if you [01:43:06] look at this this is let me put this this is a percentage idle now it is 97% idle this is 63% [01:43:17] idle put together these two is 80 percent idle because in processor 1.11 that is 11 percent [01:43:27] in processor 2 so these two become 0.2 and these two become 36 so that's the reason averages [01:43:37] dt here just a math calculation so now let us create it for memory now let me clear this [01:43:49] screen let me minimize this so that we are able to see all the three still our applications [01:43:55] is running and this is my command window now [01:44:00] Now, let me give some work to the memory. [01:44:09] How can I give that work? [01:44:11] In my Python program, I have a module for memory. [01:44:19] So instead of CPU, if I put any process, it will put load on the CPU. [01:44:29] but if i'm going to access something from the memory then that is going to [01:44:36] put load on the memory that is ram here i'm trying to block the memory [01:44:43] 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 [01:44:50] in the program mb is a variable here i can say mb is equal to pi 12. so now it is going to [01:44:59] block pi 12 mb of memory who is going to block this application why it will block [01:45:09] when user request comes if it requires some processing it will go to the processor if it [01:45:15] has to temporarily store some information then it will store it in the memory so i'm just going [01:45:22] to store something in the memory and now let us continue to run the same command which one not [01:45:35] mstat because that now let us see it in the htop htop is another utility i think you'll be able to [01:45:43] understand this better so this is the memory this is the swap memory now this is the load average [01:45:51] load average is nothing but the processor load average and uptime is nothing but how long this [01:46:00] almost like 34 minutes 38 seconds now you are able to see this is the command which is running [01:46:10] and this is the utilization of memory and this is the utilization of cpu which user which process id [01:46:21] You don't see 17540 coming anywhere. [01:46:25] Most of the processor is less than 999. [01:46:28] So system processor. [01:46:31] Now let me go ahead and give a load. [01:46:36] That means I'm blocking the memory. [01:46:39] So now you can see the memory is increasing. [01:46:43] So I'm doing it for 20 seconds. [01:46:46] So earlier it was, it has occupied only here. [01:46:49] now it has occupied [01:46:51] how much it is utilizing 868 [01:46:54] so basically 512 MB is what I [01:46:57] blocked [01:46:59] from 356 it added 512 [01:47:02] so it became some 868 [01:47:05] instead of that [01:47:06] let me now [01:47:08] give a scenario where it is [01:47:11] occupying 1024 [01:47:13] now how much I have [01:47:16] 3.27 gigabits I have [01:47:18] that is 3024 of that i'm going to occupy 1024 already 356 is occupied by the [01:47:28] processes that are running now so now i'm my system lab also is going to [01:47:35] use the memory so now you can see the processor has gone 100 percent the second processor went [01:47:43] up to 2%. [01:47:44] Now you can see the memory [01:47:46] 1.36 GB. [01:47:51] So if I'm going to run it [01:47:52] for a longer period of time, [01:47:55] so basically it ran for 12 [01:47:56] seconds and [01:47:58] this ran for 15 seconds [01:48:00] and it has occupied [01:48:02] 1024 [01:48:03] which we were able to see here. [01:48:07] I can also show you [01:48:08] in another way [01:48:09] wherein I can use [01:48:11] watch command [01:48:14] but before getting there [01:48:17] let me clear this screen [01:48:19] so we could clearly observe [01:48:22] that when application is needing a resource [01:48:26] it is going via the operating system [01:48:29] and operating system is allocating the resources [01:48:33] ok fine [01:48:35] now Sundar [01:48:37] you showed there are two processors in your system [01:48:41] 0 and 1 [01:48:42] whenever this [01:48:44] processor is full [01:48:46] either 0 or 1 [01:48:47] the another processor will start getting utilized [01:48:50] now how will I know [01:48:54] how much time [01:48:57] actually this program has [01:48:59] utilized [01:49:00] the CPU [01:49:01] that is called as [01:49:04] CPU time [01:49:05] what we are seeing here [01:49:08] when I am [01:49:10] giving an input you can see that [01:49:12] processor is going high [01:49:14] our memory is totally occupied [01:49:16] this will run for approximately [01:49:19] 15 seconds [01:49:20] 10 seconds [01:49:21] now it has come back again [01:49:24] so now [01:49:26] it says that [01:49:28] elapsed time is [01:49:30] 10.91 seconds [01:49:32] so that means [01:49:34] this process [01:49:35] this program [01:49:37] was utilizing the memory [01:49:39] for 10 seconds [01:49:42] no [01:49:44] This elapsed time also includes the free time. [01:49:51] Suppose if you have written something in the memory, [01:49:55] and if you are not accessing now, [01:49:57] you are accessing after 3 milliseconds, [01:50:00] then the idle time is 3 milliseconds. [01:50:05] So elapsed time includes that 3 milliseconds. [01:50:08] When it says 10.91 seconds, that includes 0.3. [01:50:13] The CPU time utilized by this program would probably be only 10.3 or 10.6. [01:50:24] Rest is an idle time. [01:50:26] Like how we had idle time for memory. [01:50:30] Here also we have idle time. [01:50:33] So elapsed time is basically processing time plus idle time. [01:50:40] That is elapsed time. [01:50:42] then how are we going to calculate [01:50:46] the CPU time [01:50:49] so that we will know [01:50:51] how much was idle [01:50:53] we are going to see that [01:50:56] but before that [01:50:58] I just wanted to [01:51:00] show you one more thing [01:51:03] which is nothing but [01:51:07] let me come out of this tool [01:51:09] let me now use the watch command [01:51:12] we saw that it is going to show this process with output we saw this command i'm going to put this [01:51:20] command under watch that means continuously we display the information so now every one second [01:51:28] it will refresh what it will refresh it will refresh this command and if you look at this [01:51:39] As of now, it is showing only 1750 because we have added 1750 only. [01:51:46] So 1750, 3.1% utilization, 0.5% memory, and Python 3 is running. [01:51:54] So let me take back the screen. [01:51:58] Now, let me give a command. [01:52:06] What is a command? [01:52:07] i'm going to look at more details let this screen be assessed now where all this information coming [01:52:18] from all this information are stored in the hard disk all this information are stored in the hard [01:52:26] desk where exactly there is a directory called slash proc that is proc basically the processes [01:52:36] so what will this processes directory will have proc directory will have it will have there are [01:52:42] 302 directories under this do you want me to list everything list so you can see there are so many [01:52:50] processes process ids are there in this one of the process id directory is 1750 so that means [01:53:03] anything related to this process id is written in 1750 so now let me go to 175040 now under this [01:53:15] also there are this is the directory under this there are files so now there are so many directories [01:53:22] also so many files also now in this there is a file called status and see this there is a stat [01:53:35] which is nothing but statistics it is a directory and there is a file called status so cat is [01:53:43] nothing but we are seeing the content of the status file oops there's so many yeah the status [01:53:52] has so many now within this let me give search for only vm size let me maximize this window [01:54:04] now this command i gave this file has all this info if you look at it name is python 3 the [01:54:13] program that is initiated this is python 3 state is sleeping which is our python program is sleeping [01:54:23] there are no requests if request comes the state will change and this is tgid ngid we'll skip that [01:54:33] will directly go to [01:54:35] there is something called [01:54:37] VM size. This is [01:54:40] virtual memory. [01:54:42] It's not virtual machine. It is virtual [01:54:44] memory. [01:54:46] The peak it has gone [01:54:48] to this. [01:54:50] The size available [01:54:52] now is only this much. [01:54:54] This is KB. That means [01:54:56] this is 7 MB. [01:54:59] So basically 107 MB. [01:55:01] When it has gone into [01:55:02] the peak it is 1.2 gb that is what we allocated to the memory in our command 1024mp which is [01:55:12] equivalent to 1 gb plus another 356 was already running so 1.2 gb so this status file will get [01:55:21] updated now and done who will update the status file the operating system the operating system [01:55:29] is going to allocate [01:55:31] process ID for every program that is [01:55:33] running in the processor and [01:55:35] for that processor it is going to [01:55:37] maintain the status also. [01:55:40] Okay. Now [01:55:41] there is an another [01:55:43] important [01:55:45] which is nothing but virtual memory [01:55:48] data. That is VM data. [01:55:51] How much it is? [01:55:52] 19 [01:55:53] MB. [01:55:55] 19 MB of data [01:55:57] was written to the virtual [01:55:59] memory through this program like this every process has its own directory with its process id [01:56:12] so if you are an administrator if you want to know more details we can get into the system processes [01:56:20] also is it sundar there is a boot yes boot also has a process id if you look at the process id [01:56:28] let me now go back here let me say zero there's nothing one see there is one there is process [01:56:40] number one if i go inside the process one is there a status in it yes there would be and if i give [01:56:48] status. Now, we will come to this. I have given this. Name is system D, which is nothing [01:56:57] but Unix operating system. System D is nothing but the system daemon. What is daemon? The [01:57:04] process that is running always, as long as this machine is running. So, system daemon [01:57:11] is running process 1. [01:57:15] What is process 1? [01:57:17] As of now, it is sleeping. [01:57:20] But in the peak, it used 24 MB of memory. [01:57:25] Size now allocated is also 24 MB. [01:57:30] Now, virtual memory data, [01:57:33] only 3 KB to put into the memory. [01:57:36] So this is the peak. [01:57:39] This is the size. [01:57:40] It has blocked. [01:57:41] the data that it is written is [01:57:44] 3.9 MP [01:57:47] now [01:57:49] we can also look at it in a different way [01:57:53] like [01:57:55] let me clear the screen [01:57:57] so that no confusion [01:57:58] we have another command [01:58:01] called the map [01:58:03] process mapping [01:58:05] and I am going to give it as [01:58:07] $PID because [01:58:09] 1740 [01:58:10] is stored in this [01:58:13] argument is [01:58:15] missing [01:58:16] p map [01:58:18] okay let me give [01:58:21] once on for zero [01:58:22] now if you [01:58:25] okay probably that [01:58:27] variable [01:58:27] got released [01:58:30] yeah there are no value [01:58:32] that's why it gave an error [01:58:34] so now if I look at this [01:58:37] for this [01:58:38] one seven five zero [01:58:40] which [01:58:41] specific physical [01:58:44] area [01:58:45] is used [01:58:47] and it is mapped by [01:58:50] what? [01:58:51] So you can see the Python 3 program is using [01:58:54] this address. [01:58:57] Python 3 requires libraries [01:58:59] library crypto.so.3 [01:59:03] library [01:59:05] lisma.so.5.8.3 [01:59:09] All this, cPython also is [01:59:11] being used to run this program [01:59:13] your program is running now [01:59:15] still our program [01:59:17] is running so it is [01:59:19] occupying so much of physical [01:59:21] letters [01:59:21] and it is using so many libraries from [01:59:25] the python to run our program because we [01:59:27] have imported [01:59:28] and it is using the library because we have used it [01:59:31] in our program so all the [01:59:33] libraries so many libraries [01:59:35] are running now you can [01:59:37] see on top [01:59:38] kilobytes is nothing but [01:59:40] memory the memory map there is something called dirty dirty is nothing but how much has been [01:59:51] swapped between hard disk and the memory this process has not swapped it but this process has [01:59:59] swapped 484 bytes out of total 616 currently it is in the hard disk not in the memory why did it do [02:00:09] because we blocked [02:00:10] 1.2 GB for our application [02:00:12] so at that point of time it has to [02:00:14] vacate some things so that [02:00:16] our program can get memory [02:00:18] moved to the [02:00:20] hard disk [02:00:21] so this is how [02:00:24] we see how [02:00:25] hard disk and other things [02:00:28] are happening [02:00:29] now let us quickly see [02:00:32] let me put back [02:00:34] this [02:00:35] now let us see [02:00:38] we can see [02:00:46] by doing the mixed [02:00:49] before that [02:00:51] let us generate [02:00:53] our disk [02:00:55] if we have [02:00:58] done utilizing the processor [02:00:59] we are done utilizing the memory [02:01:02] now we are trying [02:01:04] to use [02:01:06] the disk space actual storage [02:01:08] let me put [02:01:09] not 1024 let me put 2048 the higher number i'm going to use systemlab.py [02:01:19] and as if it is writing to the hard disk now it is writing to the disk [02:01:27] so the application is writing to a temporary debit now it says 2040 [02:01:33] because where is [02:01:36] it writing? It is actually [02:01:38] writing, first it will [02:01:39] write into the temporary [02:01:42] space [02:01:42] do we have a temporary space? Yes it is [02:01:46] now [02:01:47] if I give [02:01:51] OS [02:01:54] dot [02:01:55] it's basically the [02:01:57] Python program [02:01:59] if I give [02:02:00] OS dot sync [02:02:02] F sync, file sync [02:02:04] I will be able to see exactly where it is writing [02:02:07] you can use this to absorb this [02:02:11] but now let me give in the temporary [02:02:14] there are so many [02:02:16] this will get changed [02:02:17] but temporarily if you look at it [02:02:21] the data was written here [02:02:23] there were not sufficient space in the temporary [02:02:26] so it aborted [02:02:28] now what is the size of [02:02:31] this system lab [02:02:33] dot that [02:02:36] you can see here [02:02:38] it is taking so much [02:02:41] how much it is [02:02:42] this is 1 KB [02:02:44] that is 8 KB [02:02:45] and this is [02:02:48] MB [02:02:50] which is nothing but [02:02:51] 1.7 GB [02:02:55] so this is 1.7 GB [02:02:56] 1024 is what [02:02:58] everything we need to go higher up [02:03:01] these actual bytes [02:03:02] I can also ask for human readable [02:03:04] ls hyphen h it will give you can try it out now is it still there if it is still there [02:03:15] so let me remove this demo system lab demo dot data i'm removing do i have the file now [02:03:26] no such file or directory now let me go ahead and write 512 so now it has written it has written in [02:03:40] 0.14 seconds. That is the [02:03:42] write time. Read time is [02:03:44] 0.05. Read is [02:03:46] faster. So now [02:03:48] is it there? [02:03:51] It has [02:03:52] written in the temporary space [02:03:54] and then it has gone. [02:03:56] It has got removed. [02:03:58] Because I am not saving [02:04:00] it to the hard disk. I am [02:04:02] writing temporarily [02:04:03] and then I am coming out. [02:04:07] Instead of writing to the memory, [02:04:08] I am now writing to the disk [02:04:10] so now my program [02:04:13] is calculating how much time [02:04:15] it took to write [02:04:16] because I am writing that [02:04:18] earlier we saw that file was there [02:04:20] systemlab [02:04:22] demo.dat [02:04:23] now it is not there because [02:04:25] after writing successfully [02:04:28] we have removed that file [02:04:30] and that removal also requires [02:04:32] a reading [02:04:33] input [02:04:35] so reading time is only [02:04:38] 0.05 seconds that is 5 milliseconds writing it took 0.14 seconds it is basically 14 milliseconds [02:04:49] so now if i increase this to 1024 is it successful yes now you can see more the [02:05:01] data we are trying to write it is taking more time to write this is 0.14 seconds [02:05:08] double the size it has taken 0.03 seconds to write read 0.1 seconds so that means [02:05:19] here writing to the hard disk the slash tmp is in the hard disk writing to the hard disk is [02:05:28] lower than using the memory so memory is also storage hard disk is also storage [02:05:37] Memory has less capacity. [02:05:40] Hard disk has more capacity. [02:05:43] My memory is only 4 GB. [02:05:45] My hard disk is 60 GB. [02:05:49] Now accessing the memory and getting the data is faster. [02:05:54] Accessing the hard disk and getting the data is comparatively slower. [02:06:00] So now when I am accessing this program, this program is still running. [02:06:07] Now let me clear this screen. [02:06:09] Now I also have something called mixed. [02:06:13] We have the CPU, memory, and disk. [02:06:17] Now it is mixed. [02:06:20] Now if I am going to give this as, instead of disk, if I give mixed. [02:06:25] Mixed means all. [02:06:28] So why is it not working? [02:06:34] The URL is mixed. [02:06:37] But is it all? [02:06:44] But what is that we are supposed to give along with that? [02:06:47] We are also supposed to give the parameter for the mixed. [02:06:54] We are given for CPU memory and the disk, how much to be used. [02:07:03] But for mixed, how we are going to give? [02:07:11] sort of CPU along with that [02:07:15] we also give [02:07:16] mixed [02:07:18] how are we going to give this mixed [02:07:20] this was the command I'm going to give you [02:07:23] so now [02:07:24] since it is [02:07:26] missing this [02:07:28] double quote [02:07:30] it is waiting for it [02:07:32] now you can see URL rejected [02:07:35] malformed [02:07:36] so now let me [02:07:39] put it as [02:07:40] it is starting [02:07:44] the mixed workload [02:07:46] but [02:07:48] it is waiting for our input [02:07:50] why is it not working [02:07:52] let us look at the program [02:07:54] see I am just trying to make [02:07:56] all these mistakes [02:07:58] purposefully so that you get to [02:08:00] know where to see [02:08:01] so now if you look at here [02:08:04] error is coming [02:08:07] it is a broken type [02:08:08] so now until now we never [02:08:12] received because we gave the specific url we also gave all the parameters that is required to run it [02:08:25] now for mixed it is giving error so how can i run that server this is what we are going to see [02:08:35] we are going to see a demonstration of [02:08:39] how it is moving from operating system [02:08:43] to the resources [02:08:45] how it is opening, how it is reading, how it is writing [02:08:49] how it is closing [02:08:51] that is one thing [02:08:52] with using the mixed [02:08:55] we will continue with that [02:08:57] in our next session [02:08:59] let me stop sharing [02:09:02] let me give access in case if somebody have any queries [02:09:07] first let me see the chat are there any queries we used curl to send a request [02:09:14] op confirms the server successfully processed the simulated cpu workload returning a result [02:09:20] after an elapsed time of 20.05 seconds that's matching your requirement of 20 seconds duration [02:09:29] okay i think you have answered the query cool code is returned to create url slash yeah that [02:09:38] is right efficiency processor would be clocked up after putting the load that is right [02:09:44] zero percent cpu in htap does not itself meet the clock speed is 100 of maximum so clock speed is [02:09:54] different and [02:09:56] CPU utilization is [02:09:58] different. It is something like [02:10:00] you have a car, you have [02:10:02] seven-seater SUV [02:10:04] that is your [02:10:06] capacity. [02:10:09] And if there are only [02:10:11] five of you are sitting, [02:10:13] five of you are occupying [02:10:15] seven-seater. [02:10:17] But the clock [02:10:18] speed is something like [02:10:20] whether you have five, whether you have [02:10:22] seven, whether you have [02:10:24] 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. [02:10:42] Throttling, I wanted to see just to get an idea when performance cores come into the picture. [02:10:49] why it is sleeping [02:10:52] if it runs always [02:10:53] ok [02:10:55] now [02:10:57] you have the car [02:11:00] now you have started the car [02:11:02] you have not [02:11:04] you have started the engine [02:11:06] that is something like you have loaded [02:11:09] your python into the [02:11:10] memory [02:11:11] now only if you press the pedal [02:11:15] it will increase [02:11:17] the speed, it will get utilized [02:11:19] Otherwise, the car is idle, engine is on. [02:11:22] So the Python program is always on and it is present in the memory. [02:11:27] But if you are going to give a request to the program, then it will start working. [02:11:35] Something like how you press the pedal, car will start moving. [02:11:39] Until then, though engine is on, car is idle. [02:11:42] It's not moving. [02:11:44] PID variable was set in another screen, not in this screen. [02:11:48] know whether you set in whichever screen it is set for that server so actually i rebooted my [02:11:58] server to release 8080 port so that's the reason variable disappeared otherwise you [02:12:06] define a variable and store a value to it remotely also it will get stored [02:12:14] Temporary space is also in the same disk. [02:12:17] Yes, exactly. [02:12:18] It is also in the same disk. [02:12:20] But the allocation of temporary space will be limited. [02:12:25] There you need to go and look at the operating system partitions. [02:12:29] You will get to know how many is allocated for. [02:12:34] In my case, the allocated space for temporary is only 1.6 GB. [02:12:39] That's why when I tried 2 GB of writing, [02:12:43] into the temporary space. [02:12:45] It said you don't have any space. [02:12:47] Why accessing the data from memory is faster [02:12:50] as compared to accessing the data from the hard disk? [02:12:54] Okay. [02:12:56] It is something like this. [02:12:58] In your cupboard, [02:13:01] you have a smaller space. [02:13:06] Lesser number of items are stored. [02:13:09] It is easier for you to search an item in that [02:13:14] and another partition [02:13:16] which is a huge [02:13:18] where [02:13:19] there are so many items [02:13:25] are stored. To search [02:13:27] something in that, it will take more time. [02:13:30] So that is the logic here. [02:13:32] So RAM is [02:13:33] having lower [02:13:35] access. It will [02:13:37] store only active. [02:13:40] Hard disk is storing [02:13:41] everything. [02:13:44] Active, inactive [02:13:45] as well. [02:13:47] So it is a little slower. [02:13:51] Memory is faster. [02:13:54] That's right. [02:13:55] It's not about only missing code, more than that. [02:14:02] Fine. [02:14:04] Which tool is he using for commands? [02:14:06] I'm using, OK, I'm not sure about, you're [02:14:10] asking which tool is he using for commands. [02:14:14] I am using Putty to connect to the server remotely. [02:14:20] The tool I am using for commands, if you are referring to copy-paste, [02:14:25] I'm using memory again. [02:14:29] I'm taking the command from my notepad, copying it. [02:14:34] The moment I copy, it goes to my memory, laptop memory. [02:14:37] And then when I go to the remote server, when I paste it there, [02:14:42] It goes into the memory of my remote server. [02:14:45] But both of them are in my same laptop [02:14:47] because my Linux is a virtual machine [02:14:50] run by VMware workstation in my laptop itself. [02:14:54] Can we have it in the next session tomorrow? [02:15:00] Yes, that's what we are going to do. [02:15:02] We are expecting an additional parameter. [02:15:06] What is that? [02:15:06] How it works? [02:15:07] What we will get? [02:15:09] Everything. [02:15:09] Writing to computer memory is, yeah, I think. [02:15:12] you are answering. Okay, all these are answers to the questions. I will share the code file [02:15:23] to test in our system. I will share it, upload it in the modal. You will be able to download it. [02:15:31] It will be the form of a PDF file. You can create it. I do see Pritam. Pritam, I am allowing your [02:15:41] mic if you have any questions please quickly i have taken 15 minutes extra already um [02:15:48] and whoever is good enough no questions you can definitely log in so any feedback please let me [02:15:57] know uh because i'll be increasing my speed from the next session uh so if that is uh going to be [02:16:10] okay or not, we will know the next. What was the speed in this session? Did help you to understand [02:16:16] or not? If you have any feedback, you can also tell. Yes, Pritam. You there? It looks like [02:16:29] some saving Pritam. Okay, I am allowing Deepak. Deepak, you are there. Deepak Roy, if you are [02:16:43] talking then you are talking on mute, maybe it is Abhi [02:16:52] Krishna Chandra, I am allowing your mic, there is Krishna, see there, if you are talking then [02:17:08] I am not able to hear you, looks like Krishna is also Abhi, so Deepak Rai, you are there, [02:17:31] okay i need it i'm loving your mic now uh hi sir uh hope i'm audible yeah you are audible [02:17:43] uh yeah first of all uh yeah thank you for this station it was a great uh [02:17:48] session uh there was a lot of learning uh uh one question sir when you started this uh [02:17:54] carry cram journey you said that we suppose not to have any particular specialization around the [02:18:04] any particular operating system for example linux if you have a linux operating code if you have [02:18:09] window code if you have mac that is also good but on this call you said like you you should [02:18:17] remember linux command if i'm using mac there the command would be different to visualize [02:18:24] the similar kind of experience my first question is whether the all of the things which we have [02:18:30] done in visualization of CPU memory utilization and all of those things can it be possible on [02:18:38] Macintosh terminal second if not do we need to go through strictly through the Linux operating [02:18:47] system or we should learn the commands that you have presented today okay you will definitely be [02:18:55] able to see the same in macintosh so run this python program in your macintosh that means you [02:19:03] need to have python installed and then run it use mac commands you should be able to see the same [02:19:11] outcome in terms of cpu memory disk definitely it is possible it's not mandatory that you need to [02:19:18] learn all these commands at least it is an opportunity for all of you to learn something [02:19:28] so learning another 8 10 commands of unix is not a great thing if you are doing it well and good [02:19:36] because we don't know today's scenario in the industry uh when you'll get project for which [02:19:44] operating system so that's the reason i said otherwise it's not mandatory hope that answers [02:19:50] your question yeah yeah thanks thank you sir yeah so the question would not be like uh the [02:20:02] thank you yeah that was the question yeah thank you for clarifying that yeah okay cool so now [02:20:10] Now, that's fine. [02:20:13] So, Deepak Rai, you said you are not audible, so I raised my hand. [02:20:19] I was unable to unmute. [02:20:22] Okay, cool. [02:20:23] Fair enough. [02:20:25] Varun? [02:20:26] Yeah, hey, Sundar. [02:20:27] Yes, that was the issue. [02:20:28] So, that's why I raised my hand. [02:20:31] Okay, cool. [02:20:31] No problem. [02:20:32] Who were raised for that, please lower your hand. [02:20:36] Otherwise, if you are good, then we are good. [02:20:39] So, thank you, sir. [02:20:40] a lot of learning today's session there are some session I missed from the [02:20:44] previous but I will go through those recording from today's session I have [02:20:48] couple of questions one on the exit 86 vs is x86 64 architecture does there is [02:20:55] any difference in the memory management or the disk management on those [02:21:01] architecture perspective secondly if I create a virtual machine sometimes in [02:21:06] the in the as you i am using the azure for my as in cloud or provider and i sometimes sees the temp [02:21:15] is part of the uh the vm type i selected and sometime it goes outside the vm type i selected [02:21:22] and i need to create it as a separate disk is there as any any difference between those two [02:21:30] or they are part of, [02:21:32] they work similarly, [02:21:33] but it has some differences. [02:21:37] So that's what my second question [02:21:39] and the third question is on the... [02:21:41] If you continue to ask, [02:21:42] then I will not remember. [02:21:44] Sorry, sorry, go ahead. [02:21:46] So what is your first, [02:21:48] your observation of, [02:21:50] what was your first question? [02:21:52] So I saw that UVM that you have created [02:21:54] has an operating system of x86 and underscore 64. [02:21:58] Architecture. [02:21:59] Yes. [02:22:00] Okay, so the way the memory is managed, the way the CPU is managed is different from architecture to architecture. [02:22:10] Definitely the architecture will have its own components to manage memory. [02:22:16] And when we are speaking about the architecture, here we are speaking about the hardware architecture. [02:22:23] X86 is basically Intel motherboard. [02:22:26] you also have risk you also have other architecture so the architecture in which [02:22:33] the hardware is built the way it manages the hardware is different but the same operating [02:22:40] system will have different distributions if you go and download ubuntu it will ask for which [02:22:47] architecture you want the operating system so if you say x86 and download then x86 architecture [02:22:54] will work arm it will work but if you want ubuntu for risk then it is a different installable that [02:23:03] you need to download if you download x86 and run it on risk it will not work did i answer your first [02:23:10] query yes more or less so it means the memory management and the disk management changes with [02:23:18] the architecture we select. [02:23:19] Is it correct? [02:23:20] Yeah, definitely, definitely. [02:23:22] That's the reason the same operating system [02:23:25] has different distribution for a different architecture. [02:23:29] Perfect. My second question was on the, [02:23:33] I just created a VM on Azure and sometimes you [02:23:37] see there are some virtual machines that [02:23:39] have temp as part of the VM type that you select. [02:23:43] 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. [02:23:54] Does there is a difference between these two or it's the same thing? [02:23:58] Okay, if you are referring to the instance types like t3.micro or ie2.medium, r2. [02:24:13] dot okay all these instance type means basically it differs of how much resources are getting [02:24:19] allocated to that particular compute so when you are getting only 8 gb of hard disk [02:24:27] then the operating system is not going to create partitions for every directory that it want to [02:24:35] create it will see okay if i have only 8 gb ram then accordingly it will install the operating [02:24:42] system directory slash temp is an operating system directory so it is not going to create [02:24:48] a partition for slash temp and it is supposed to be part of the overall partition it is something [02:24:54] like this you have one room kitchen so your dining area also is part of your living area [02:25:01] so if you have two bedroom hall kitchen then you might have a dining area very specifically [02:25:11] identified and it will not be part of your living area or bedrooms it is something like that so if [02:25:19] you don't want a living area sorry if you don't want a dining area then it will not be there only [02:25:24] if you want to create one put a dining table in your living area only and use it it is something [02:25:31] similar to that so temporary is not a must partition it will create only must partitions [02:25:39] in the lower disk configuration. [02:25:43] Does that answer your query? [02:25:45] So if I understand it properly, [02:25:47] it's like it's not mandatory [02:25:49] and it also does not change [02:25:53] if whatever type of VMs we choose it, correct? [02:25:57] Only if you're choosing a configuration [02:26:01] with temp as a default one, [02:26:03] you don't need to create it. [02:26:04] Is my understanding correct? [02:26:06] No. [02:26:07] depending upon the size of your disk [02:26:11] only mandatory directories [02:26:16] directories means partitions will be created [02:26:18] so I showed you in the disk [02:26:21] there were three partitions in my disk [02:26:23] so in that slash was there [02:26:26] slash boot was there [02:26:27] my slash temp is part of that slash [02:26:31] it has not created a temporary [02:26:34] so TMP should be there [02:26:36] but it will be part of your overall partition. [02:26:41] You will not be able to see the partition slash temp [02:26:44] as part of your disk partitions. [02:26:47] But if you experience that slash TMP itself is not there, [02:26:52] then I would like to know the situation [02:26:55] so that I can answer it. [02:26:57] Slash TMP will be there [02:26:58] whether it is having a different room [02:27:00] or it is part of your living room [02:27:03] is all the question, but it will be there. [02:27:05] but if you don't want you can remove it [02:27:08] if you remove the slash temp [02:27:10] it will go no temporary space [02:27:12] will not be there [02:27:13] but in case if you are using [02:27:15] hard disk for your extended memory [02:27:18] then the slash [02:27:19] temp should be there that's all [02:27:22] so it is at the OS architecture [02:27:24] level I hope I [02:27:26] answered your query [02:27:27] yeah I think so but I [02:27:30] will make you a specific [02:27:31] screenshot in a personal chat what [02:27:34] i was referring so maybe it's a more good and one last question sir sorry i'm taking a little more [02:27:40] time is on the os disk versus data disk are they same or they are different uh when we see in any [02:27:47] instance in a in a in a cloud we wanted to create a virtual machine we get two options creating [02:27:53] using an os disk and data disk is the same disk or it has some difference in the in the meaning of [02:28:02] You are more asking about the cloud. [02:28:07] No problem, no problem. [02:28:11] See, what happens is, [02:28:13] if you are buying a hard disk with one terabyte, [02:28:17] now in that hard disk only, [02:28:19] you are going to store your operating system [02:28:21] and you are also going to store your data [02:28:25] in the same disk only physically. [02:28:27] You don't have any other disk, [02:28:29] only one disk you have. [02:28:31] So now that disk will be partitioned into operating system area and data area. [02:28:37] And whatever operating system area physically from this sector to this sector, [02:28:42] only operating system will use so that I can control that not everyone will have access to it. [02:28:49] Now data area. [02:28:52] That data area, I will give access to the user so that they can store their data, [02:28:57] retrieve, remove, whatever they wanted to do. [02:29:00] So these two are partitioned in the same physical hard disk. [02:29:04] But in case of the Cloud, [02:29:06] when it is asking about YS disk and data disk, [02:29:11] what they are trying to do is they are trying to give you a disk of 8 GB, [02:29:16] which will have only operating system. [02:29:19] If you want additional disk to store your data, [02:29:23] then you can ask for a data disk of any size you want. [02:29:26] So it will be two different disks physically, though it is virtual. [02:29:32] For your understanding, I am telling, physically you will have two disks, [02:29:36] in which one will have only 8 GB size, wherein only operating system will reside. [02:29:42] That is referred as OS disk. [02:29:44] If you don't want any extra space, don't ask for any more additional volume. [02:29:50] The additional volume is referred as data disk. [02:29:56] Make sense? [02:29:57] makes sense clear clear now okay cool okay fine i do see sorrow sorrow i'm allowing your mic and [02:30:08] this is the last question i'm going to take it's already 10 p.m now hello sir yes yeah sir i have [02:30:15] just a very basic question like as you are showing the memory uh cpu consumption uh when you are [02:30:21] trying to run the python program so there was a point where the cpu utilization reached 100 [02:30:26] percent and then it uses the core two so like is this the same way it is going to happen every time [02:30:32] like once the core one has wasted 100 percent utilization then only core two is utilized and [02:30:38] then so on like if we have portrait core for them like for two is utilizing this then we'll be moving [02:30:42] to core three is this happen the same way always okay in this system i was running only one program [02:30:52] right okay so generally in the production it will be something like this one [02:30:57] if you are running a web server it will be a web server if you are running a front end it will be [02:31:01] a front end if you are running a middleware it will be only middleware that will be running in [02:31:05] those servers okay so if you're running only one program the way it is going to utilize the [02:31:12] cores will be similar to this first it will consume the first core if it is full then it [02:31:19] it will go to the second core. [02:31:21] Now, instead of that, [02:31:23] if you are going to run two programs [02:31:25] in the same machine, [02:31:28] then first program will start utilizing core 1, [02:31:32] second program will start utilizing core 2. [02:31:35] If core 1 is full, [02:31:37] then first program will use core 2, [02:31:40] whatever is left out. [02:31:41] If that is also not available, [02:31:43] that means your CPU is 100%. [02:31:45] You should not reach that stage. [02:31:49] So you need to have a warning at 85% so that you can manage. [02:31:54] If you reach 100% of both the cores, then your system is going to hack. [02:32:00] Okay, so if I get it correctly, it is like if we're running two programs simultaneously, [02:32:04] then core 1 will be utilized by one of the program like process and another process will utilize core 2, right? [02:32:11] 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. [02:32:19] if it is available and all these things are assigned by the operating system program will [02:32:26] not know because if core 2 is 100% then operating system is going to say okay core 2 is there [02:32:33] give some more space to this process end of the day that program is identified by the [02:32:39] process number the process number will get additional memory or additional cpu that's [02:32:45] yeah so there's one of uh addition to this question like yeah we know uh we are running [02:32:55] a program but in the behind the scene i think there's the system of processors would also be [02:33:00] running right so will they be coming under the same cpu utilization or they are having something [02:33:07] different like we are saying like if it is uh using 100 so the system processors would be [02:33:13] having somewhere else running around or it is the same core or the same cpu that you would be [02:33:18] utilizing we have only two cores of cpu so that is the same cpu which a system as well as [02:33:28] application will use okay so it is like shared both by the system and the program yeah it is [02:33:38] shared by all [02:33:40] processes that is running the system [02:33:42] but it will be controlled [02:33:44] by the operating system [02:33:45] so operating system will identify [02:33:48] okay these are all my [02:33:49] processes are nothing but [02:33:52] operating system processes [02:33:54] so it will know its own [02:33:56] processes so it will not [02:33:58] allow anybody else to [02:34:00] access it it will not [02:34:02] consume more than 3 to [02:34:04] 5 percent of the CTU [02:34:06] if you still have like [02:34:08] two cores it will not take more than three to five percent that's the reason initially [02:34:15] so sir as you said like one program you will be using core one and the another program will [02:34:20] be using core two so at that moment of time where are the system processes going to be like [02:34:26] executed if our operating system has assigned the core one it will run in core one only okay [02:34:33] so it is like that decision is ultimately on the operating system where it exactly oh thank you [02:34:40] thank you sir for the clarification okay guys cool guys thank you so much i do see still there are [02:34:49] 105 attendees part of this okay cool and i do see some chat that is coming total virtual cpu and [02:35:00] memory can be greater than [02:35:02] actual memory or CPU? No. [02:35:04] That is not possible. [02:35:07] Actual CPU and [02:35:08] memory should be [02:35:10] the maximum for virtual [02:35:12] also. Okay, guys. [02:35:14] Thank you very much. It's already 10.5pm. [02:35:16] Have a great evening. [02:35:18] Thank you, sir. [02:35:19] We'll catch up next week. [02:35:22] Tomorrow we have theory. We'll catch up. [02:35:24] Thank you. Take care. Bye-bye. [02:35:27] Thank you, sir.