zak100 Posted April 30, 2020 Posted April 30, 2020 Hi, I am trying to solve the following question: What is the CPU utilization if there are 5 processes running at the same time, and on average the CPU spends 30% of its time waiting on I/O completion? The formula is : Quote The formula for CPU utilization is 1−pn, in which n is number of process running in memory and p is the average percentage of time processes are waiting for I/O. What is P in this formula?: 1-P ^n I found a solution which finds the CPU utilization for each process separately. Can we do it in the following way: 1- (0.3)^5 = 0.9975 Is the above answer correct? Somebody please guide me. Zulfi.
Ghideon Posted May 2, 2020 Posted May 2, 2020 (edited) I do not know where formula comes from. In reality there are more factors to consider. On 4/30/2020 at 6:50 AM, zak100 said: What is P in this formula?: 1-P ^n It seems like you provided the answer: On 4/30/2020 at 6:50 AM, zak100 said: p is the average percentage of time processes are waiting for I/O. On 4/30/2020 at 6:50 AM, zak100 said: found a solution which finds the CPU utilization for each process separately. Can we do it in the following way: 1- (0.3)^5 = 0.9975 Is the above answer correct? Some reasoning: If each process is waiting for I/O 30% of the time and during that time not consuming CPU* then the maximum CPU usage of a single process is 70%. When many processes are started they will not only wait for I/O, they will also have to wait for the CPU. Each process will utilise the CPU less than the maximum 70% of the time that the process could run. So 0.9975 is not correct. 0.3 (30%) is the probability of a process waiting for I/O. (0.3)^5 is the probability of having all five processes waiting for I/O. So 1-(0.3)^5 then is the probability having at least one process in a running state and not waiting, hence able to consume CPU. Not sure how you wish to define CPU utilisation for a single process, maybe [math] \frac{1-p^{n}}{n} [/math] ? *) I assume a process waiting for I/O is not in a running state or performing some busy-wait Edited May 2, 2020 by Ghideon 1
zak100 Posted May 3, 2020 Author Posted May 3, 2020 Hi, Thanks. For the update otherwise I would be doing it wrongly. I found the formula which I wrote in my (Question) post from google. But your formula is looking correct also. I have to discuss it with somebody. God bless you. Zulfi.
zak100 Posted May 4, 2020 Author Posted May 4, 2020 Hi, (1-P^n)/n is the average case. < So 1-(0.3)^5 then is the probability having at least one process in a running state and not waiting, hence able to consume CPU.> I think this is the correct way. God bless you. Thanks. Zulfi.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now