问题
how the timeshared in cloudsim work, there is no variable that represent a time slice or quantum, so how the concept of round robin is verified in cloudsim?
If we have 50 cloudlets,10 VMs
回答1:
In fact, the CloudletSchedulerTimeShared in CloudSim does not implement the concept of time slice/quantum. Consider we have a VM with 1 CPU (PE) of 1000 MIPS and 2 Cloudlets running inside it. CloudSim's CloudletSchedulerTimeShared provides an oversimplified implementation that allocates 500 MIPS for each Cloudlet, making them run at the same time on the same CPU.
If the VM had only one Cloudlet with a length of 5000 MI, then the Cloudlet would take 5 seconds to finish. Since there are 2 Cloudlets, in a time-shared scheduler for that single-core VM, each Cloudlet running interchangeably would take 10 seconds to finish. Allocating only half of the CPU capacity (500 MIPS) for each one of the 2 Cloudlets, making them run in parallel as if there were 2 CPU cores, will produce the exact same result: each Cloudlet finishing in 10 seconds.
The point is that there is no waiting time for any Cloudlet. These Cloudlets will run as if the VM had 2 CPUs with 500 MIPS each. If you are assessing Cloudlets' wait time in your simulations, such results are just wrong. If the wait time is not a concern, the results are fine.
If you really need to assess Cloudlets' pre-emption process, you can check CloudSim Plus, it's a full-featured, state-of-the-art, completely re-engineered and actively maintained CloudSim fork. It provides an implementation of the Completely Fair Linux Scheduler that performs actual preemption and considers a time slice to run Cloudlets. Check the CloudletSchedulerCompletelyFair and the LinuxCompletelyFairSchedulerExample.
回答2:
[If we have 50 cloudlets,10 VMs. CloudChedular and VmSchedular( Time shared) class in cloudsim will distribute resources as per total number of jobs (cloudlets) to be executed. For instance when requested capacity is more than the current capacity, failures will occur and it will cause SLA violations.
来源:https://stackoverflow.com/questions/51779655/how-the-timeshared-in-cloudsim-work-in-cloudsim