def core_change(self):
        global _handoff_start_time

        (activate_time, core_list) = self.cpu_bw_changes.pop(0)
        while(not self.stop.wait(1)):
            duration = time.time() - _handoff_start_time[0]
            LOG.info("control_core\t%f\t%f\t%s" % (activate_time, duration, core_list))
            if activate_time <= duration:
                # change number of core
                self._set_affinity_chilren(core_list)
                current_cores = VMOverlayCreationMode.get_num_cores()
                VMOverlayCreationMode.set_num_cores(len(core_list))
                LOG.info("control_core\t%f\tupdate all children to %s" % (duration, core_list))
                try:
                    (activate_time, core_list) = self.cpu_bw_changes.pop(0)
                except IndexError as e:
                    LOG.info("control_core\tno more data")
                    break
            else:
                continue
        LOG.info("control_core\tfinish bw control thread")
Example #2
0
def validation_mode():
    mode_list = list()
    core = 4

    mode = VMOverlayCreationMode.get_pipelined_multi_process_finite_queue()
    mode.NUM_PROC_DISK_DIFF = core
    mode.NUM_PROC_MEMORY_DIFF = core
    mode.NUM_PROC_OPTIMIZATION = core
    mode.NUM_PROC_COMPRESSION = core
    mode_list.append(mode)

    return mode_list
def validation_mode():
    mode_list = list()
    core = 4

    mode = VMOverlayCreationMode.get_pipelined_multi_process_finite_queue()
    mode.NUM_PROC_DISK_DIFF = core
    mode.NUM_PROC_MEMORY_DIFF = core
    mode.NUM_PROC_OPTIMIZATION = core
    mode.NUM_PROC_COMPRESSION = core
    mode_list.append(mode)

    return mode_list
def profiling_workload(num_cores):
    mode_list = list()
    for comp_type in (Const.COMPRESSION_LZMA, Const.COMPRESSION_BZIP2, Const.COMPRESSION_GZIP):
    #for comp_type in [Const.COMPRESSION_GZIP]:
        for comp_level in [1, 1, 2, 3, 4, 5, 6, 7, 8, 9]:
        #for comp_level in [9, 9]:
            overlay_mode = VMOverlayCreationMode.get_pipelined_multi_process_finite_queue(num_cores=num_cores)
            overlay_mode.COMPRESSION_ALGORITHM_TYPE = comp_type
            overlay_mode.COMPRESSION_ALGORITHM_SPEED = comp_level
            overlay_mode.MEMORY_DIFF_ALGORITHM = "none"
            overlay_mode.DISK_DIFF_ALGORITHM = "none"
            mode_list.append(overlay_mode)
    return mode_list
def profiling_workload(num_cores):
    mode_list = list()
    #for comp_type in (Const.COMPRESSION_LZMA, Const.COMPRESSION_BZIP2, Const.COMPRESSION_GZIP):
    for comp_type in [Const.COMPRESSION_GZIP]:
        #for comp_level in [1, 1, 2, 3, 4, 5, 6, 7, 8, 9]:
        for comp_level in [9, 9]:
            overlay_mode = VMOverlayCreationMode.get_pipelined_multi_process_finite_queue(num_cores=num_cores)
            overlay_mode.COMPRESSION_ALGORITHM_TYPE = comp_type
            overlay_mode.COMPRESSION_ALGORITHM_SPEED = comp_level
            overlay_mode.MEMORY_DIFF_ALGORITHM = "none"
            overlay_mode.DISK_DIFF_ALGORITHM = "none"
            mode_list.append(overlay_mode)
    return mode_list
Example #6
0
    def core_change(self):
        global _handoff_start_time

        (activate_time, core_list) = self.cpu_bw_changes.pop(0)
        while (not self.stop.wait(1)):
            duration = time.time() - _handoff_start_time[0]
            LOG.info("control_core\t%f\t%f\t%s" %
                     (activate_time, duration, core_list))
            if activate_time <= duration:
                # change number of core
                self._set_affinity_chilren(core_list)
                current_cores = VMOverlayCreationMode.get_num_cores()
                VMOverlayCreationMode.set_num_cores(len(core_list))
                LOG.info("control_core\t%f\tupdate all children to %s" %
                         (duration, core_list))
                try:
                    (activate_time, core_list) = self.cpu_bw_changes.pop(0)
                except IndexError as e:
                    LOG.info("control_core\tno more data")
                    break
            else:
                continue
        LOG.info("control_core\tfinish bw control thread")
def profiling_workload():
    NUM_CPU_CORES = 1
    mode_list = list()
    for repeat in xrange(3):
        for diff in ("xor", "xdelta3", "bsdiff", "none"):
            for comp_type in (Const.COMPRESSION_LZMA, Const.COMPRESSION_BZIP2, Const.COMPRESSION_GZIP):
                for comp_level in [1, 1, 2, 3, 4, 5, 6, 7, 8, 9]:
                    overlay_mode = VMOverlayCreationMode.get_pipelined_multi_process_finite_queue(num_cores=NUM_CPU_CORES)
                    overlay_mode.COMPRESSION_ALGORITHM_TYPE = comp_type
                    overlay_mode.COMPRESSION_ALGORITHM_SPEED = comp_level
                    overlay_mode.MEMORY_DIFF_ALGORITHM = diff
                    overlay_mode.DISK_DIFF_ALGORITHM = diff
                    mode_list.append(overlay_mode)
    return mode_list
Example #8
0
def serial_vs_pipe():
    # serial vs pipeline
    mode = VMOverlayCreationMode.get_serial_single_process()
    mode.COMPRESSION_ALGORITHM_TYPE = Const.COMPRESSION_LZMA
    mode.COMPRESSION_ALGORITHM_SPEED = 5
    mode.MEMORY_DIFF_ALGORITHM = "xdelta3"
    mode.DISK_DIFF_ALGORITHM = "xdelta3"
    mode.NUM_PROC_DISK_DIFF = core
    mode.NUM_PROC_MEMORY_DIFF = core
    mode.NUM_PROC_OPTIMIZATION = core
    mode.NUM_PROC_COMPRESSION = core
    mode_list.append(mode)
    mode_list = list()

    return mode_list
def serial_vs_pipe():
    # serial vs pipeline
    mode = VMOverlayCreationMode.get_serial_single_process()
    mode.COMPRESSION_ALGORITHM_TYPE = Const.COMPRESSION_LZMA
    mode.COMPRESSION_ALGORITHM_SPEED = 5
    mode.MEMORY_DIFF_ALGORITHM = "xdelta3"
    mode.DISK_DIFF_ALGORITHM = "xdelta3"
    mode.NUM_PROC_DISK_DIFF = core
    mode.NUM_PROC_MEMORY_DIFF = core
    mode.NUM_PROC_OPTIMIZATION = core
    mode.NUM_PROC_COMPRESSION = core
    mode_list.append(mode)
    mode_list = list()

    return mode_list
Example #10
0
def scaling_test():
    mode_list = list()
    # scale
    for core in (1, 1, 4):  #(1, 1,2,3,4):
        mode = VMOverlayCreationMode.get_pipelined_multi_process_finite_queue()
        mode.COMPRESSION_ALGORITHM_TYPE = Const.COMPRESSION_LZMA
        mode.COMPRESSION_ALGORITHM_SPEED = 5
        mode.MEMORY_DIFF_ALGORITHM = "xdelta3"
        mode.DISK_DIFF_ALGORITHM = "xdelta3"
        mode.NUM_PROC_DISK_DIFF = core
        mode.NUM_PROC_MEMORY_DIFF = core
        mode.NUM_PROC_OPTIMIZATION = core
        mode.NUM_PROC_COMPRESSION = core
        mode_list.append(mode)

    return mode_list
Example #11
0
def profiling_workload():
    NUM_CPU_CORES = 1
    mode_list = list()
    for repeat in xrange(3):
        for diff in ("xor", "xdelta3", "bsdiff", "none"):
            for comp_type in (Const.COMPRESSION_LZMA, Const.COMPRESSION_BZIP2,
                              Const.COMPRESSION_GZIP):
                for comp_level in [1, 1, 2, 3, 4, 5, 6, 7, 8, 9]:
                    overlay_mode = VMOverlayCreationMode.get_pipelined_multi_process_finite_queue(
                        num_cores=NUM_CPU_CORES)
                    overlay_mode.COMPRESSION_ALGORITHM_TYPE = comp_type
                    overlay_mode.COMPRESSION_ALGORITHM_SPEED = comp_level
                    overlay_mode.MEMORY_DIFF_ALGORITHM = diff
                    overlay_mode.DISK_DIFF_ALGORITHM = diff
                    mode_list.append(overlay_mode)
    return mode_list
def scaling_test():
    mode_list = list()
    # scale
    for core in (1,1,4): #(1, 1,2,3,4):
        mode = VMOverlayCreationMode.get_pipelined_multi_process_finite_queue()
        mode.COMPRESSION_ALGORITHM_TYPE = Const.COMPRESSION_LZMA
        mode.COMPRESSION_ALGORITHM_SPEED = 5
        mode.MEMORY_DIFF_ALGORITHM = "xdelta3"
        mode.DISK_DIFF_ALGORITHM = "xdelta3"
        mode.NUM_PROC_DISK_DIFF = core
        mode.NUM_PROC_MEMORY_DIFF = core
        mode.NUM_PROC_OPTIMIZATION = core
        mode.NUM_PROC_COMPRESSION = core
        mode_list.append(mode)

    return mode_list
    num_core = 1
    bandwidth = [5, 10, 15, 20, 25, 30, 30]
    bandwidth.reverse()
    #num_cores_list = [4,4,3,2,1]; network_bw = 10

    for (base_path, overlay_path) in workloads:
        for network_bw in bandwidth:
        #for num_core in num_cores_list:
            # confiure network using TC
            cmd = "sudo %s restart %d" % (os.path.abspath("./traffic_shaping"), network_bw)
            LOG.debug(cmd)
            LOG.debug(subprocess.check_output(cmd.split(" ")))
            #VMOverlayCreationMode.USE_STATIC_NETWORK_BANDWIDTH = network_bw

            # generate mode
            VMOverlayCreationMode.LIVE_MIGRATION_STOP = VMOverlayCreationMode.LIVE_MIGRATION_FINISH_USE_SNAPSHOT_SIZE
            overlay_mode = VMOverlayCreationMode.get_pipelined_multi_process_finite_queue(num_cores=num_core)
            overlay_mode.COMPRESSION_ALGORITHM_TYPE = Const.COMPRESSION_GZIP
            overlay_mode.COMPRESSION_ALGORITHM_SPEED = 1
            overlay_mode.MEMORY_DIFF_ALGORITHM = "none"
            overlay_mode.DISK_DIFF_ALGORITHM = "none"

            LOG.debug("network-test\t%s-%s (Mbps)" % (network_bw, num_core))
            is_url, overlay_url = PackagingUtil.is_zip_contained(overlay_path)
            #run_file(base_path, overlay_url, overlay_mode)
            run_network(base_path, overlay_url, overlay_mode)

            time.sleep(30)

Example #14
0
    for (base_path, overlay_path) in workloads:
        for network_bw in bandwidth:
            # confiure network using TC
            cmd = "sudo %s restart %d" % (os.path.abspath("./traffic_shaping"),
                                          network_bw)
            LOG.debug(cmd)
            LOG.debug(subprocess.check_output(cmd.split(" ")))
            VMOverlayCreationMode.USE_STATIC_NETWORK_BANDWIDTH = network_bw

            # start controlling number of cores
            cpu_control = CPUCoreControl()
            cpu_control.start()

            # generate mode
            VMOverlayCreationMode.LIVE_MIGRATION_STOP = VMOverlayCreationMode.LIVE_MIGRATION_FINISH_USE_SNAPSHOT_SIZE
            overlay_mode = VMOverlayCreationMode.get_pipelined_multi_process_finite_queue(
                num_cores=num_core)
            overlay_mode.COMPRESSION_ALGORITHM_TYPE = Const.COMPRESSION_GZIP
            overlay_mode.COMPRESSION_ALGORITHM_SPEED = 1
            overlay_mode.MEMORY_DIFF_ALGORITHM = "none"
            overlay_mode.DISK_DIFF_ALGORITHM = "none"

            overlay_mode.set_num_cores(num_core)
            LOG.debug("network-test\t%s-varying (Mbps)" % (num_core))
            is_url, overlay_url = PackagingUtil.is_zip_contained(overlay_path)
            run_network(base_path, overlay_url, overlay_mode)

            cpu_control.terminate()
            cpu_control.join()
            time.sleep(30)