5 Replies Latest reply on Oct 11, 2017 9:56 AM by LucD

    measuring_disk_latency_powercli

    jvm2016 Expert

      Hi Luc,

       

      i was checking following script to calculate maxIOPS .

      Get the maximum IOPS - LucD notes

       

      could you tell me how to get following expresion

      $metrics = "disk.numberwrite.summation","disk.numberread.summation"

       

      can we have similar for disk latency?

       

       

      Thanks in advance.

        • 1. Re: measuring_disk_latency_powercli
          LucD Guru
          User ModeratorsvExpertCommunity Warriors

          If you look at the Disk I/O Counters, you'll find the disk.deviceReadLatency.average and the disk.deviceWriteLatency.average counters.

          But be aware that they require statistics level 2 (for aggregate) or 3 (for device) when you go in the Historical Intervals

          • 2. Re: measuring_disk_latency_powercli
            jvm2016 Expert

            i run the following lines to check just to get realtime stats .

             

             

            $metrics ="disk.devicereadlatency.average","disk.devicewritelatency.average"

            $start = (Get-Date)

             

             

            $vms = Get-VM | where {$_.PowerState -eq "PoweredOn"}

            $stats = Get-Stat -Realtime -Stat $metrics -Entity $vms -Start $start

             

            but got follwoingerror:

             

            ----------------------------------------------------------------------------------------------------------------------------------------

             

            also could you suggest if the following code makes any sense this is not related to latency thing.

             

             

             

            $tab = @()

             

             

            foreach ($vm in (get-vm|?{$_.powerstate -eq "poweredon"}))

             

            {

            $vm.numcpu|%

            {

            $tab[$_.numcpu] = $vm.name

            }

            }

            $tab

            • 3. Re: measuring_disk_latency_powercli
              LucD Guru
              Community WarriorsvExpertUser Moderators

              For VMs you will need to use different metrics (the above ones are for HostSystems).

              But be aware that they are only present in Statistics Level 4 (for Historical Intervals).

               

              $stat = 'virtualDisk.readLatencyUS.latest','virtualDisk.writeLatencyUS.latest'

              $entity = Get-VM -Name MyVM

               

              Get-Stat -Entity $entity -Stat $stat -Realtime -MaxSamples 1

               

               

               

              No, that doesn't really make sense.

              I would do it like this

               

               

              Get-VM | where{$_.PowerState -eq 'PoweredOn'} |

              Group-Object -Property NumCpu |

              select @{N='NumCpu';E={$_.Name}},

                  @{N='VM';E={$_.Group.Name -join ','}}

              • 4. Re: measuring_disk_latency_powercli
                jvm2016 Expert

                Thanks. appreciate your help.

                so i run to check for one of the vms.

                 

                and got following for realtime and max sample 1 .i think these values are normal as per my understanding latency more than  25 to 30 ms is point of concern.

                could you comment on this.

                 

                 

                ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 

                 

                also could you tell more about following code specifically in blue line .

                 

                 

                 

                $lunTab = @{}

                foreach($ds in (Get-Datastore -VM $vms | where {$_.Type -eq "VMFS"}))

                {

                    $ds.ExtensionData.Info.Vmfs.Extent | %{

                        $lunTab[$_.DiskName] = $ds.Name

                    }

                }

                • 5. Re: measuring_disk_latency_powercli
                  LucD Guru
                  Community WarriorsvExpertUser Moderators

                  A latency of 25-30 ms would be somewhat acceptable for classical HDD, but nowadays, with extended cache and SSD, I would say values over 10 ms might be of concern.

                  But again these are guidelines, and should be viewed in relation to your specific environment.

                   

                  The variable $lunTab is a hash table.
                  I used it in those lines to map the CanonicalName of a LUN with the name of the datastore defined on that LUN.

                  The key into the hash table is the CanonicalName ($_.DiskName).