summaryrefslogtreecommitdiffstats
path: root/doc/source
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/devref/filter_scheduler.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/source/devref/filter_scheduler.rst b/doc/source/devref/filter_scheduler.rst
index 5ae5bcd4e..91cf0e5a0 100644
--- a/doc/source/devref/filter_scheduler.rst
+++ b/doc/source/devref/filter_scheduler.rst
@@ -62,7 +62,9 @@ code. For example class |RamFilter| has the next realization:
instance_type = filter_properties.get('instance_type')
requested_ram = instance_type['memory_mb']
free_ram_mb = host_state.free_ram_mb
- return free_ram_mb * FLAGS.ram_allocation_ratio >= requested_ram
+ total_usable_ram_mb = host_state.total_usable_ram_mb
+ used_ram_mb = total_usable_ram_mb - free_ram_mb
+ return total_usable_ram_mb * FLAGS.ram_allocation_ratio - used_ram_mb >= requested_ram
Here `ram_allocation_ratio` means the virtual RAM to physical RAM allocation
ratio (it is 1.5 by default). Really, nice and simple.