Re: Runner's /varz endpoint - how "available_disk_ratio" is computed?


CF Runtime
 

Hi Rafal

Available disk ratio is computed by the formula 1 - (reserved_disk /
disk_capacity)
https://github.com/cloudfoundry/dea_ng/blob/5381c9561137258d7a97fdc488a90aa0d25a527d/lib/dea/resource_manager.rb#L53

disk_capacity is indeed calculated from the disk_mb and multiplied by the
disk_overcommit_factor
https://github.com/cloudfoundry/dea_ng/blob/5381c9561137258d7a97fdc488a90aa0d25a527d/lib/dea/resource_manager.rb#L15

If you set your disk_mb value to be exactly the size of the disk on the
runner vm you are using with an overcommit factor of 1 the /varz reported
available_disk_ration should exactly track how much available disk you have
on each runner. This is not recommended, however, as you may want to
increase your overcommit factor in order to most efficiently use the disk
space on your runner VMs.

Instead, you can use `bosh vms --vitals` to get system level information
about disk usage of each available VM.

Best,
Zak Auerbach
CF Release Integration


On Thu, Oct 8, 2015 at 2:45 AM, Rafal Radecki <radecki.rafal(a)gmail.com>
wrote:

Hi :)

I tried to find in the source code on one of my runners how
available_disk_ratio is computed. Initially I thought that it will show how
much space there is available on my runner, for example:

df -h /var/vcap/data/
Filesystem Size Used Avail Use% Mounted on
/dev/xvdb2 820G 12G 767G 2% /var/vcap/data

So on my runner I see that 98% of space is free but in /varz I see that

available_disk_ratio -> 0.97152

From cf documentation (
http://docs.pivotal.io/pivotalcf/customizing/use-metrics.html):
"available_disk_ratio Percentage of disk available for allocation by
future applications/staging requests"
I tried to check this in source code ->

/var/vcap/data/packages/dea_next/b4fe12b3a1243a6724e8b80c39f5ee62c47b3168.1-e0eb07312ea47e31e414c7fb70474ff7d99a6cd2/lib/dea/bootstrap.rb

/var/vcap/data/packages/dea_next/b4fe12b3a1243a6724e8b80c39f5ee62c47b3168.1-e0eb07312ea47e31e414c7fb70474ff7d99a6cd2/lib/dea/resource_manager.rb
but I got to the point of
module Dea
class ResourceManager
DEFAULT_CONFIG = {
"memory_mb" => 8 * 1024,
"memory_overcommit_factor" => 1,
"disk_mb" => 16 * 1024 * 1024,
"disk_overcommit_factor" => 1,
}.freeze
in resource_manager.rb.
Can anyone tell me how available_disk_ratio is exactly computed? I am not
sure but base on the lines for DEFAULT_CONFIG I think that it may be
computed based on statically set "disk_mb" value ;)
Overall I need this to my monitoring. Are there maybe other ways to tell
how many disc space is available on a given runner?

BR,
Rafal.

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.