service_capacity_modeling/models/org/netflix/rds.py
def _estimate_rds_requirement(
    instance: Instance, desires: CapacityDesires, db_type: str
) -> CapacityRequirement:
    """Estimate the capacity required for one region given a regional desire. Unlike
    Cassandra RDS instances are deployed per region, not zone. The input desires
    should be the **regional** desire, and this function will return the regional
    capacity requirement
    """

    if db_type == "postgres":
        needed_cores = sqrt_staffed_cores(desires) * 1.2  # 20% head room for VACUUM
    else:
        needed_cores = sqrt_staffed_cores(desires) * 1.1  # Just a guess!

    needed_cores = math.ceil(
        max(1, needed_cores // (instance.cpu_ghz / desires.core_reference_ghz))
    )

    # 20% head room For replication, backups etc.
    needed_network_mbps = simple_network_mbps(desires) * 1.2
    needed_disk = round(desires.data_shape.estimated_state_size_gib.mid, 2)

    if (
        desires.data_shape.estimated_working_set_percent
        and desires.data_shape.estimated_working_set_percent.mid
    ):
        working_set_percent = desires.data_shape.estimated_working_set_percent.mid
    else:
        working_set_percent = 0.10

    needed_memory = (
        desires.data_shape.estimated_state_size_gib.mid * working_set_percent
    )

    return CapacityRequirement(
        requirement_type="rds-regional",
        core_reference_ghz=desires.core_reference_ghz,
        cpu_cores=certain_int(needed_cores),
        mem_gib=certain_float(needed_memory),
        disk_gib=certain_float(needed_disk),
        network_mbps=certain_float(needed_network_mbps),
    )
Estimate the capacity required for one region given a regional desire. Unlike
    Cassandra RDS instances are deployed per region, not zone. The input desires
    should be the **regional** desire, and this function will return the regional
    capacity requirement
    
Estimate the capacity required for one region given a regional desire. Unlike
Cassandra RDS instances are deployed per region, not zone. The input desires
should be the **regional** desire, and this function will return the regional
capacity requirement
Estimate the capacity required for one region given a regional desire . Unlike Cassandra RDS instances are deployed per region not zone . The input desires should be the ** regional ** desire and this function will return the regional capacity requirement
def _estimate_rds_requirement(
    instance: Instance, desires: CapacityDesires, db_type: str
) -> CapacityRequirement:
    if db_type == "postgres":
        needed_cores = sqrt_staffed_cores(desires) * 1.2  
    else:
        needed_cores = sqrt_staffed_cores(desires) * 1.1  
    needed_cores = math.ceil(
        max(1, needed_cores // (instance.cpu_ghz / desires.core_reference_ghz))
    )
    needed_network_mbps = simple_network_mbps(desires) * 1.2
    needed_disk = round(desires.data_shape.estimated_state_size_gib.mid, 2)
    if (
        desires.data_shape.estimated_working_set_percent
        and desires.data_shape.estimated_working_set_percent.mid
    ):
        working_set_percent = desires.data_shape.estimated_working_set_percent.mid
    else:
        working_set_percent = 0.10
    needed_memory = (
        desires.data_shape.estimated_state_size_gib.mid * working_set_percent
    )
    return CapacityRequirement(
        requirement_type="rds-regional",
        core_reference_ghz=desires.core_reference_ghz,
        cpu_cores=certain_int(needed_cores),
        mem_gib=certain_float(needed_memory),
        disk_gib=certain_float(needed_disk),
        network_mbps=certain_float(needed_network_mbps),
    )
def _estimate_rds_requirement ( instance : Instance , desires : CapacityDesires , db_type : str ) -> CapacityRequirement : if db_type == "postgres" : needed_cores = sqrt_staffed_cores ( desires ) * 1.2 else : needed_cores = sqrt_staffed_cores ( desires ) * 1.1 needed_cores = math . ceil ( max ( 1 , needed_cores // ( instance . cpu_ghz / desires . core_reference_ghz ) ) ) needed_network_mbps = simple_network_mbps ( desires ) * 1.2 needed_disk = round ( desires . data_shape . estimated_state_size_gib . mid , 2 ) if ( desires . data_shape . estimated_working_set_percent and desires . data_shape . estimated_working_set_percent . mid ) : working_set_percent = desires . data_shape . estimated_working_set_percent . mid else : working_set_percent = 0.10 needed_memory = ( desires . data_shape . estimated_state_size_gib . mid * working_set_percent ) return CapacityRequirement ( requirement_type = "rds-regional" , core_reference_ghz = desires . core_reference_ghz , cpu_cores = certain_int ( needed_cores ) , mem_gib = certain_float ( needed_memory ) , disk_gib = certain_float ( needed_disk ) , network_mbps = certain_float ( needed_network_mbps ) , )
Estimate the capacity required for one region given a regional desire.
Estimate the capacity required for one region given a regional desire .
"""Estimate the capacity required for one region given a regional desire. Unlike
    Cassandra RDS instances are deployed per region, not zone. The input desires
    should be the **regional** desire, and this function will return the regional
    capacity requirement
    """ # 20% head room for VACUUM # Just a guess! # 20% head room For replication, backups etc.
instance
Instance
desires
CapacityDesires
db_type
str