Exemple #1
0
                # CPU range was 6-8, but will lock-up on 4-core system when clamped to 3-3 and client also clamped to 3
                "resources": {
                    "ado_cores": (core_count() < 8 and core_range(1, 2)
                                  or core_range(core + 5, core + 5 + 2)),
                    "ado_manager_core":
                    core_clamp(core)
                }
            })


class config_ado(config):
    """ configuration with ado specification """
    def __init__(self, shard_proto_, ado, count_=1):
        config.__init__(self, shard_proto_, count_)
        self.merge(ado)


if __name__ == '__main__':
    print("core_count: ", core_count())
    core = 0
    from shard_protos import shard_proto, shard_proto_ado
    from stores import mapstore
    print(
        "config_secure: ",
        config_secure(shard_proto("127.0.0.1", mapstore(), core=core)).json())
    print("ado_resources: ", ado_mixin(1).json())
    print(
        "config_ado: ",
        config_ado(shard_proto_ado("127.0.0.1", mapstore(), core=core),
                   ado_mixin(core=core + 1)).json())
Exemple #2
0
 def __init__(self, addr):
     config_secure0.__init__(self, shard_proto(addr, mapstore()))
Exemple #3
0
            self,
            {
                "ado_path": "%s/bin/ado" % (install_prefix, ),
                # Special case for CPUs with less than 8 cores
                # CPU range was 6-8, but will lock-up on 4-core system when clamped to 3-3 and client also clamped to 3
                "resources": {
                    "ado_cores": (core_count() < 8 and core_range(1, 2)
                                  or core_range(6, 8)),
                    "ado_manager_core":
                    core_clamp(1)
                }
            })


class config_ado0(config_0):
    """ configuration with ado specification """
    def __init__(self, shard_proto_):
        config_0.__init__(self, shard_proto_)
        self.merge(ado_mixin())


if __name__ == '__main__':
    print("core_count: ", core_count())
    from shard_protos import shard_proto, shard_proto_ado
    from stores import mapstore
    print("config_secure0: ",
          config_secure0(shard_proto("127.0.0.1", mapstore())).json())
    print("ado_resources: ", ado_mixin().json())
    print("config_ado: ",
          config_ado0(shard_proto_ado("127.0.0.1", mapstore())).json())
Exemple #4
0
 def __init__(self, ipaddr, port=11911, core=0):
     config_secure.__init__(self, shard_proto(ipaddr, mapstore(), cores=range(core, 112), port=port))
Exemple #5
0
 def __init__(self, ipaddr, core=0):
     cores = range(core,112)
     config.__init__(self, shard_proto(ipaddr, mapstore(), cores=cores), 1)