From 7f1301976d6c9520f79bfc4964b95e7f3ad67281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Gracia?= Date: Thu, 20 Feb 2020 11:02:06 +0100 Subject: [PATCH] Issue 61: Fixed calculation of additional direct memory for segment stores (#62) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the calculation of additional direct memory added to Segment Stores to be used as cache. Signed-off-by: Raúl Gracia --- pravega-provisioner/cluster_provisioner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pravega-provisioner/cluster_provisioner.py b/pravega-provisioner/cluster_provisioner.py index ef564c0..52f521e 100644 --- a/pravega-provisioner/cluster_provisioner.py +++ b/pravega-provisioner/cluster_provisioner.py @@ -156,12 +156,12 @@ def resource_based_provisioning(vms, vm_cpus, vm_ram_gb, vm_local_drives, zookee bookkeeper_servers, segment_stores, controllers)[1] print("Allocation of pods on nodes: ", the_cluster) # Finally, we need to check how much memory is left in the nodes so we can share it across Segment Stores for cache. - # In the worst case, we will have [math.ceil(vms/segment_stores)] Segment Store instances on a single node. Also, + # In the worst case, we will have [math.ceil(segment_stores/vms)] Segment Store instances on a single node. Also, # in the worst case, this could be the node with the least available memory available. For this reason, the # in-memory cache size for a Segment Store would be as follows: min_vm_mem_available = min(mem for (cpu, mem, disks, processes_in_vm) in the_cluster) - max_segment_stores_per_vm = math.ceil(vms / segment_stores) - new_direct_memory = Constants.segment_store_direct_memory_in_gb + int(min_vm_mem_available/max_segment_stores_per_vm) + max_segment_stores_per_vm = math.ceil(segment_stores / vms) + new_direct_memory = Constants.segment_store_direct_memory_in_gb + int(min_vm_mem_available / max_segment_stores_per_vm) print("--------- Segment Store In-Memory Cache Size (Pravega +0.7) ---------") print("Segment Store pod memory limit: ", Constants.segment_store_jvm_size_in_gb + new_direct_memory, "GB") print("Segment Store JVM Size (-Xmx JVM Option) : ", Constants.segment_store_jvm_size_in_gb, "GB")