21.01.2014 Views

A simulation model to implement multiple client class server-client ...

A simulation model to implement multiple client class server-client ...

A simulation model to implement multiple client class server-client ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Scheduler: The scheduler <strong>implement</strong>s the resource allocation decisions required. For instance,<br />

if the decision is <strong>to</strong> maintain 15 and 5 resource units for A and B <strong>client</strong> <strong>class</strong>es respectively,<br />

this component <strong>implement</strong>s these decisions until the next decision is made. It has the<br />

access <strong>to</strong> the Queue instances of each <strong>client</strong> <strong>class</strong>, resource units and other state variables. In<br />

each tick it executes the following algorithm for each <strong>client</strong> <strong>class</strong>. Say S i and i util are integer<br />

variables representing the allocated resources of i th <strong>client</strong> <strong>class</strong> and currently utilized resources<br />

by i th <strong>client</strong> <strong>class</strong>, respectively. Calculate the number of resources that can be allocated in this<br />

time instance, by Di f i = S i −i util . Get the Di f i amount of requests from the Queue corresponding<br />

<strong>to</strong> A <strong>client</strong> <strong>class</strong> and then the ResourceUnit instances are initialized with these requests. Further,<br />

the i util variable is updated at the same time. Here, we have taken the design decision of<br />

centralized scheduler, instead of each ResourceUnit <strong>class</strong> taking the responsibility of scheduling.<br />

This is because, it is easy <strong>to</strong> track and validate the resource utilizations compared <strong>to</strong> a distributed<br />

algorithm.<br />

StatisticCalula<strong>to</strong>r: This is the component that computes the measurement required <strong>to</strong> <strong>implement</strong><br />

the control systems. In particular, it calculates average response time, throughput and<br />

resource utilizations for each <strong>client</strong> <strong>class</strong> on specified time periods. It has a list of completed<br />

requests for each <strong>client</strong> <strong>class</strong>, which is populated by the ResourceUnit <strong>class</strong> after servicing the<br />

requests. The designer specifies the time interval <strong>to</strong> calculate the statistics, which we call as the<br />

sample instance. The statistic report generated will be used by the external entities for analysis<br />

and make runtime decisions. Afterwards, the request lists are cleared <strong>to</strong> accumulate the completed<br />

requests till the next sample instance. Following equations summarize how some of the<br />

statistics are calculated for <strong>client</strong> <strong>class</strong> i.<br />

Given the completed request list for <strong>client</strong> <strong>class</strong> List i , Throughput of the system T P i =<br />

Count(List i ), i.e, the number of items in the list. The response time of the j th request r i, j =<br />

r i, j .endtime − r i, j .starttime.<br />

The <strong>to</strong>tal response time of all requests in the list<br />

Tot i =<br />

Count(List ∑ i )−1<br />

j=0<br />

Average response time is calculated by R i = Tot i<br />

T P i<br />

r i, j (1)<br />

MainProgram: The designer can use this <strong>class</strong> <strong>to</strong> <strong>implement</strong> the required <strong>simulation</strong> depending<br />

on the requirements. Depending on the number of <strong>client</strong> <strong>class</strong>es Queue instance have <strong>to</strong> be<br />

created, then the required workload scripts have <strong>to</strong> be specified in <strong>client</strong> <strong>class</strong> specific workload<br />

genera<strong>to</strong>r objects. In addition, the number of resource units that is available in the system has <strong>to</strong><br />

be specified in the scheduler. Further, probability distributions <strong>to</strong> simulate resource reservation<br />

time and sample period has <strong>to</strong> be given depending on the <strong>simulation</strong> objectives.<br />

Assumptions<br />

1. Typically, the resource allocation decisions made by the management system are <strong>implement</strong>ed<br />

at each sample instance. However, some of the resource units are maybe occupied<br />

by the requests that are being processed at that time instance. This may indicate that some<br />

<strong>class</strong>es have more than the resources they are allocated for that time instance. Hence, <strong>to</strong><br />

<strong>implement</strong>ation of the resource allocation decisions can be done in two different ways,<br />

including preemptive and non- preemptive. In the preemptive setting, the number of over<br />

utilized resources are forcefully taken away in order <strong>to</strong> allocate that resource <strong>to</strong> specified<br />

4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!