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

Rafal Radecki

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 (
"available_disk_ratio Percentage of disk available for allocation by future applications/staging requests"
I tried to check this in source code ->
but I got to the point of
module Dea
class ResourceManager
"memory_mb" => 8 * 1024,
"memory_overcommit_factor" => 1,
"disk_mb" => 16 * 1024 * 1024,
"disk_overcommit_factor" => 1,
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?


Join { to automatically receive all group messages.