Virtual memory and BW oversubscription implementation: when a Cloudlet requests more RAM or BW than there is available, its execution should be delayed
manoelcampos opened this issue · comments
An UtilizationModel
defines how a Cloudlet
will use Vm
's RAM. When a Cloudlet
requests more RAM than the Vm
has available at the moment, it's shown a warning message, but the Cloudlet
execution finishes at the expected time.
WARN: CloudletSchedulerTimeShared: Cloudlet 12 requested 1000 MB of Bandwidth but no amount is available.
Virtual Memory
In operating systems, when this situation happens, the OS uses virtual memory to swap data belonging to idle processes from the RAM to the disk. This opens up RAM space for the requesting application. However, since the disk is a very slow device compared to RAM, this swapping process will slow down application execution, since the app will have to wait for the SO to perform this process and then allocate the requested memory.
CloudSim Plus has classes such as HarddriveStorage
that simulates an HD/SSD and enables defining some parameters, namely: transfer rate, seek time and latency time. Using such devices from a Host, we could delay the execution of the Cloudlet when it requests more RAM than there is available.
This way, instead of just printing a warning message informing that there isn't enough RAM, we could print a message informing that virtual memory will be used and delay Cloudlet's execution.
If the cloudlet also requires a given amount of BW which isn't available, just the available amount is allocated, but that should delay the cloudlet processing too.
For instance, if the required bandwidth is 10mbps, that means the cloudlet is willing to transfer 10 mbits in one second. If just 8 mbps is allocated to the cloudlet, to transfer the same 10 mbits it will take 0,25 second more.
BW oversubscription
Concerning BW allocation, when a Cloudlets requests more BW than there is available, only the capacity available will be allocated, which must slow down cloudlet data transfer and consequently, increase cloudlet finish time. Consider the following table with sample data:
required bw (mbps) | allocated bw | additional delay | total tranfer time |
---|---|---|---|
10 | 10 | 0 | 1 |
10 | 8 | 0,25 | 1,25 |
The additional delay should be computed as required/allocated - 1
and the total transfer time as 1 + additional delay
.
A brief explanation of why you think this feature is useful
This will enable more accurate and realistic simulations.
References
Examples
hello, I hope that when the task does not have enough resources, it will stop and wait for the resources to be released like the PES.
How should I implement this function
Usually, you can't stop an app due to lack of RAM if you have virtual memory enabled, which all regular operating systems have. Unless your app is requesting a huge amount of memory, it must not stop. If the app starts to use virtual memory (disk), that one is much slower than primary memory (RAM). That is why apps should be delayed in such situations.
Finished implementation in PR #312. Check available example in the issue description above.