Es mostren els missatges amb l'etiqueta de comentaris usage. Mostrar tots els missatges
Es mostren els missatges amb l'etiqueta de comentaris usage. Mostrar tots els missatges

dilluns, 10 d’abril del 2017

Climbing the peak

Climbing the peak




Scenario

In your usual sizing efforts you need to know the peak usage% for a certain workload and server(s). What is the right averaging time to capture this peak? Let’s see possible choices.

Too long averaging time


Averaging Time = 500 min. Peak usage% = 50%.
Total loss of finer details. Does this really mean that the usage% has been the same for the 500 min? You, like me, don’t believe that!

Too short averaging time


Averaging Time =  10 s. Peak usage% = 100%.

Too much detail. This may be good for performance analysis, but it is confusing for sizing. Spikes goes up to usage%=100%, meaning that for 10 s -the averaging time-  in a row the server is 100% busy. But I wouldn’t consider that the server usage% is 100% for sizing purposes. If you do so you most probably are oversizing, a common (and safe) strategy by the way.

The right averaging time?


Averaging Time =  10 min. Peak usage% = 68%.

Eureka! This is the right amount of detail. In my point of view the right averaging time for OLTP lies somewhere between 10 min and 1 hour, depending on the workload, on the available data, and on the degree of tolerance to a high usage%.

dilluns, 20 de març del 2017

What does Usage mean?

What does Usage mean?



My objective today is to clarify the meaning of one of the most used metric in sizing and in performance analysis: the usage.

First things first

The Usage exposes the state of the service center. It is a binary quantity:
  • usage=0 when idle (not working)
  • usage=1 when busy (working)
Any service center at any point in time is idle (usage=0) or busy (usage=1).

Usage Percentage (Usage%)

This is the "usage" metric we are familiarized with. It is the average of the usage over a certain time interval, called the averaging time. Typically is expressed as percentage.

In example usage%=20% (for a certain time interval) means that for that time interval the service center has been:
  • 20% of the time busy
  • 80% of the time idle

Averaging Time

The averaging time for calculating the usage% is of capital importance. Saying 20% is not enough, saying 20% over an hour is right.

Theory is very simple, but in practice the averaging time is frequently dropped. Always ask for it (but don't expect to have a crystal clear response).

To stress its importance look at these graphs representing the time evolution of the usage% metric for the same workload and different averaging time.

Averaging Time = 10 s


Averaging Time = 10 min

Averaging Time = 500 min


I insist: in the three graphs the workload is the same (and the total amount of work done -the area under the usage% curve- remains the same). The short averaging time is best suited for performance analysis, the medium is for sizing, and the long is for trend analysis.

divendres, 18 de desembre del 2015

Test Your Performance Skills - 2nd Part

Ten haircuts per hour is a measure of...
  • Response Time
  • Velocity
  • Throughput
  • Utilization / usage.


The throughput of a service center measures...
  • Units of work processed per unit of time
  • The elapsed time to process one unit of work
  • The elapsed time to process many units of work


The bandwidth is...
  • The average response time of many requests
  • The maximum achievable throughput


The response time can grow to infinity (I’ve seen graphs in which response time goes to infinity!)...
  • In practical cases
  • In theoretical models
  • Never
  • Always


Is possible to be at 100% cpu usage and, at the same time, to have an acceptable response time?
  • Yes
  • No


If we move a certain workload to a new server with half performance capacity of the original one, what will happen to the response time?
  • Increase slightly
  • Increase heavily
  • Simply increase (but cannot predict how much)
  • Remain stable
  • Decrease


To get serviced a customer has to visit two desks, A and B in strict sequence,  The customer spends 5 min in A, and 10 min in B. Which is the total residence time?
  • 5 min
  • 10 min
  • 15 min
  • 7.5 min (the average of 5 and 10 min)


Which is the bandwidth of the previous service center?
  • 9 customers per hour
  • 4 customers per hour
  • 12 customers per hour
  • 6 customers per hour


You, as a great performance analyst, has been asked to place an additional clerk (to work in parallel) in one of the desks, A or B. Where would you place him/her?
  • At the entrance (for marketing purposes)
  • Desk A
  • Desk B
  • At the exit (for customer satisfaction feedback)


What of the above sentences truly quantify the improvement of your previous recommendation, if any.

  • There is hardly a performance gain
  • The new residence time is 10 min
  • The new bandwidth is 12 customers per hour
  • The new throughput is 12 customers per hour
  • The new bandwidth is 6 customers per hour

divendres, 8 d’agost del 2014

Demystifying Virtual Capacity Mini Papers



The IBM Technology Leadership Council from Brazil has translated to Portuguese and published two brief articles I have written on virtual capacity. Here are the public links:
As some of you –like me- might not be able to fully understand Portuguese, I expose below the English version for both mini papers.

Demystifying Virtual Capacity, Part I

In a virtualized system virtual machines share the underlying physical machine (PM). This physical machine has a well-defined processing capacity. Let us call virtual capacity to the actual capacity used by a virtual machine.
How much of the real physical capacity goes to a particular virtual machine (VM)? What are the parameters that determine the virtual capacity? In this paper we will briefly review these factors. Different hypervisors and virtualization technologies use different names for them, but in all the cases the underlying concepts are largely the same.
·         Physical Machine capacity. The virtualization layer distributes the PM capacity among its VMs. Of course, this PM capacity is the absolute limit of the virtual capacity: a hosted VM cannot be larger than the hosting PM. Virtualization overhead should also be taken into account. The capacity is typically measured in processor cores or aggregated CPU cycles (MHz).
·         Guaranteed capacity. This is the capacity the VM will have for sure when/if demanded. In example, consider a guaranteed capacity of 4 cores. If the VM workload demand is 2 cores, the VM will use 2 cores. But if the demand is 5 cores, it will use 4 for sure and the remaining 1 core may be used or not depending on additional factors. It is also called entitlement and reservation. It’s measured in capacity units.
·         Exclusive use attribute. Flag or binary value indicating if the guaranteed capacity is set aside for the exclusive use of the VM. If it is not, the unused guaranteed capacity is available for use by the rest of VMs sharing the PM. Other name for this parameter is dedicated use.
·         Limit / cap attribute. Flag or binary value that indicates if the guaranteed capacity can be exceeded or not. May the VM virtual capacity go beyond the guaranteed capacity in case of need? The response is yes if unlimited / uncapped, and no if limited / capped. Some hypervisors specify a limit capacity not tied to the guaranteed capacity.
·         Virtual cores. A fundamental, but sometimes tricky concept, and the link between the physical and the virtual world. The operative system inside the VM sees (virtual) cores and dispatches runnable processes to them. Then the hypervisor dispatches virtual cores to physical cores. The number of virtual cores may limit the virtual capacity: i.e. a VM with 2 virtual cores never can have a virtual capacity greater than 2 physical cores.
·         Relative priority. This parameter sets relative priorities between VMs that compete for capacity. This competence may happen when the sum of demands are greater than the PM capacity. You can find this concept under several names like uncapped weight and shares.
The actual virtual capacity depends on all the above factors. Let's go from theory to practice, and play with a simple scenario: two VMs, the red and the blue, sharing an 8 core PM.
Red and blue virtual machines are both defined in the same way:
·         Guaranteed capacity: 4 cores.
·         Exclusive use: NO.
·         Uncapped / Unlimited.
·         Virtual cores: 8.
·         Relative priority: 128.

What do you think it would happen when red customers place a demand on the red VM of 5 cores, and at the same time blue customers place a demand on the blue VM of 5 cores?
According to the above parameterization, it's possible for the red VM to use 5 physical cores because it's uncapped/unlimited and it has at least 5 virtual cores. But to be able to go beyond its guarantee (4 cores), there must be available free physical capacity. And this is not the case, because the other VM -the blue VM- is using its 4 cores of guaranteed capacity.
So the final capacity distribution in the above conditions is: the red VM is using 4 cores, and the blue VM is using 4 cores. Consequently the physical machine is 100% busy (all 8 cores used). You may conclude, from the sizer point of view, that the physical machine is undersized, not being able to meet all demands placed on it.
What would happen if the blue demand decreases from 5 to 1 core? In the forthcoming second part we will solve this and will play with more complex and subtle cases.

Demystifying Virtual Capacity, Part II

In the previous mini paper we defined the virtual capacity concept and identified the generic factors it depends on: physical machine (PM) capacity, guaranteed capacity, exclusive use attribute, limit / cap attribute and relative priority.
A very simple thought scenario was proposed: an 8-core PM with two virtual machines (VM), the red and the blue, parameterized with the following configuration:
VM
Guarant. Capacity
vCores
Exclusive Use
Limit / Cap
Priority
Red
4
8
No
No
128
Blue
4
8
No
No
128

If the red demand is 5 cores and the blue demand is 1 core, what would be the resulting capacity distribution?  
The blue will get 1 core, as this demand is well below its guaranteed 4 cores. The remaining 3 cores are not used and, as it has not the exclusive use attribute set, they are ceded back as free capacity.
The red usage increase to 5 cores, 4 of them coming from its guaranteed capacity and the additional 1 core coming from the available free capacity. Now the PM is 75% busy (6 of 8 cores) and there are no unsatisfied demands.
A general rule is that when all the VMs are uncapped and without exclusivity, and the sum of all demands are less than the PM capacity all VM demands can be satisfied.
Let’s consider a case with competence, that is, the PM capacity is not enough to satisfy the sum of VM demands (being all of them uncapped and with no exclusive use). How the scarce PM capacity is distributed?
Suppose the same 8-core PM with 3 VMs, the red, the blue and the green, with the following configuration:
VM
Guarant. Capacity
vCores
Exclusive Use
Limit / Cap
Priority
Red
3
8
No
No
128
Blue
3
8
No
No
128
Green
2
8
No
No
128

The demands are: red and blue 4 cores, and green 1 core. The sum of demands are 9 cores, more than the physical capacity (8 cores).
First group, VMs with demands less or equal than their guarantees. They are serviced and the rest of the guarantee is ceded and increase the free capacity. The green VM is in this group: it uses 1 core and cedes 1 core.
Second group, VMs with demands higher than their guarantees. They receive their guarantee plus the right proportion, according to their priorities, of the free capacity. The red and the blue are in this group, they both use 3 cores (the guaranteed) plus 0.5 cores, coming from the 1 core divided into two equal parts, as both VMs have the same priority and thus receive the same fraction. Is this situation, the PM is 100% busy and there are unsatisfied demands.
What would happen if the green VM is shutdown or its demand drops to zero? Or if the blue VM is limited/capped? Or if the red VM number of virtual cores is set to 2? Or if the green demand goes up to 4 cores?
Calculations to solve the generic case, if you know what to do and how to do them, are simple. I’ve created a spreadsheet implementing them. Simple, functional (but not fool proof): the virtual capacity demystifier. It comes with a companion presentation illustrating its usage. You should experiment with the tool to fully comprehend and understand virtual capacities.
A final word: perhaps I should have added ths following subtitle: “...in a perfect world”. In the real world there are second order effects -overheads, inefficiencies, cache misses,...- that diminish virtual capacities we have obtained. These effects belong to the realm of advanced practitioners and performance gurus, but you should be aware of them.