Ejemplo n.º 1
0
def get_flumina_latencies_throughputs(flumina_dirs):
    flumina_dirs = list(flumina_dirs)
    flumina_latencies = [
        results.get_erlang_latencies(dir) for dir in flumina_dirs
    ]
    flumina_throughputs = [
        results.get_erlang_throughput(dir) for dir in flumina_dirs
    ]
    return flumina_latencies, flumina_throughputs
Ejemplo n.º 2
0
def get_flumina_latencies_throughputs(flumina_dirs,
                                      experiment='value-barrier'):
    flumina_dirs = list(flumina_dirs)
    flumina_latencies = [
        results.get_erlang_latencies(dir, experiment) for dir in flumina_dirs
    ]
    flumina_throughputs = [
        results.get_erlang_throughput(dir) for dir in flumina_dirs
    ]
    return flumina_latencies, flumina_throughputs
Ejemplo n.º 3
0
def plot_scaleup(erlang_subdirs, flink_subdirs, output_file):
    erlang_latencies = [
        results.get_erlang_latencies(subdir) for subdir in erlang_subdirs
    ]
    erlang_latencies_mean = [p50 for p10, p50, p90 in erlang_latencies]
    erlang_latencies_diff_10 = [
        p50 - p10 for p10, p50, p90 in erlang_latencies
    ]
    erlang_latencies_diff_90 = [
        p90 - p50 for p10, p50, p90 in erlang_latencies
    ]
    erlang_throughputs = [
        results.get_erlang_throughput(subdir) for subdir in erlang_subdirs
    ]

    flink_latencies = [
        results.get_flink_latencies(subdir) for subdir in flink_subdirs
    ]
    flink_latencies_mean = [p50 for p10, p50, p90 in flink_latencies]
    flink_latencies_diff_10 = [p50 - p10 for p10, p50, p90 in flink_latencies]
    flink_latencies_diff_90 = [p90 - p50 for p10, p50, p90 in flink_latencies]
    flink_throughputs = [
        results.get_flink_throughput(subdir) for subdir in flink_subdirs
    ]

    plt.rcParams.update({'font.size': 18})
    fig, ax = plt.subplots()
    ax.set_xlabel('Throughput (events/ms)')
    ax.set_ylabel('Latency (ms)')
    plt.yscale('log')
    ax.errorbar(erlang_throughputs,
                erlang_latencies_mean,
                [erlang_latencies_diff_10, erlang_latencies_diff_90],
                linestyle='-',
                marker='o',
                label='Flumina',
                linewidth=1,
                capthick=1,
                capsize=3,
                color='tab:blue')
    ax.errorbar(flink_throughputs,
                flink_latencies_mean,
                [flink_latencies_diff_10, flink_latencies_diff_90],
                linestyle='--',
                marker='^',
                label='Flink',
                linewidth=1,
                capthick=1,
                capsize=3,
                color='tab:red')
    ax.legend()

    plt.tight_layout()
    #plt.savefig(output_file)
    plt.show()
Ejemplo n.º 4
0
def main():
    parser = argparse.ArgumentParser(description='Run Flink experiments')
    group = parser.add_mutually_exclusive_group()
    group.add_argument('-s', '--suite', help='Run the given experiment suite')
    group.add_argument('-l',
                       '--list',
                       help='List experiment suites',
                       action='store_true')
    group.add_argument(
        '-f',
        '--flink-results',
        help='Process Flink results from the given output directory')
    group.add_argument(
        '-e',
        '--erlang-results',
        help='Process Erlang results from the given output directory')
    args = parser.parse_args()

    if args.list:
        for name, suite in suites.items():
            print('\n\t'.join([f'{name}:\n' + '=' * (1 + len(name))] +
                              [str(exp) for exp in suite.experiments]) + '\n')
        exit(0)

    if args.flink_results is not None:
        p10, p50, p90 = results.get_flink_latencies(args.flink_results)
        throughput = results.get_flink_throughput(args.flink_results)
        network_data = results.get_network_data(
            args.flink_results) / 1024.0 / 1024.0
        print(f'Latency percentiles (ms):  {p10:.0f}  {p50:.0f}  {p90:.0f}')
        print(f'Mean throughput (events/ms): {throughput}')
        print(f'Network data (MB): {network_data:0.1f}')
        exit(0)

    if args.erlang_results is not None:
        p10, p50, p90 = results.get_erlang_latencies(args.erlang_results)
        throughput = results.get_erlang_throughput(args.erlang_results)
        network_data = results.get_network_data(
            args.erlang_results) / 1024.0 / 1024.0
        print(f'Latency percentiles (ms):  {p10:.0f}  {p50:.0f}  {p90:.0f}')
        print(f'Mean throughput (events/ms): {throughput}')
        print(f'Network data (MB): {network_data:0.1f}')
        exit(0)

    if args.suite not in suites:
        parser.print_usage()
        exit(1)

    suites[args.suite].run()
Ejemplo n.º 5
0
def plot_hb_ratio_scaleup(erlang_dir, flink_dir, output_file):
    ratios = [1, 2, 5, 10, 100, 1000, 10_000]
    erlang_subdirs = [
        path.join(erlang_dir,
                  f'ab_exp5_15_10000_{hb_ratio}_5_optimizer_greedy')
        for hb_ratio in ratios
    ]
    flink_subdirs = [
        path.join(flink_dir, f'n5_r15_q10000_h{hb_ratio}')
        for hb_ratio in ratios
    ]

    erlang_latencies = [
        results.get_erlang_latencies(subdir) for subdir in erlang_subdirs
    ]
    erlang_latencies_mean = [p50 for p10, p50, p90 in erlang_latencies]
    erlang_latencies_diff_10 = [
        p50 - p10 for p10, p50, p90 in erlang_latencies
    ]
    erlang_latencies_diff_90 = [
        p90 - p50 for p10, p50, p90 in erlang_latencies
    ]
    erlang_network_data = [
        results.get_network_data(subdir) / (1024.0 * 1024.0)
        for subdir in erlang_subdirs
    ]

    flink_latencies = [
        results.get_flink_latencies(subdir) for subdir in flink_subdirs
    ]
    flink_latencies_mean = [p50 for p10, p50, p90 in flink_latencies]
    flink_latencies_diff_10 = [p50 - p10 for p10, p50, p90 in flink_latencies]
    flink_latencies_diff_90 = [p90 - p50 for p10, p50, p90 in flink_latencies]
    flink_network_data = [
        results.get_network_data(subdir) / (1024.0 * 1024.0)
        for subdir in flink_subdirs
    ]

    plt.rcParams.update({'font.size': 18})
    fig, ax = plt.subplots()
    ax.set_xlabel('Network data (MB)')
    ax.set_ylabel('Latency (ms)')
    plt.xscale('log')
    plt.yscale('log')
    plt.xticks(erlang_network_data, [
        '' if item < 0.7 else f'{item:.1f}' if item < 100.0 else f'{item:.0f}'
        for item in erlang_network_data
    ],
               rotation=-60)
    ax.errorbar(erlang_network_data,
                erlang_latencies_mean,
                [erlang_latencies_diff_10, erlang_latencies_diff_90],
                linestyle='-',
                marker='o',
                label='Flumina',
                linewidth=1,
                capthick=1,
                capsize=3,
                color='tab:blue')
    ax.errorbar(flink_network_data,
                flink_latencies_mean,
                [flink_latencies_diff_10, flink_latencies_diff_90],
                linestyle='--',
                marker='^',
                label='Flink',
                linewidth=1,
                capthick=1,
                capsize=3,
                color='tab:red')
    ax.legend()

    plt.tight_layout()
    plt.savefig(output_file)
Ejemplo n.º 6
0
def main():
    parser = argparse.ArgumentParser(description='Run Flink experiments')
    group = parser.add_mutually_exclusive_group()
    group.add_argument('-s', '--suite', help='Run the given experiment suite')
    group.add_argument('-e', '--experiment', help='Run the given experiment')
    group.add_argument('-l', '--list', help='List experiment suites', action='store_true')
    group.add_argument('-k', '--flink-results', help='Process Flink results from the given output directory')
    group.add_argument('-f', '--flumina-results', help='Process Flumina results from the given output directory')
    parser.add_argument('--flink-workers', help='File containing a list of Flink worker hostnames')
    parser.add_argument('--total-values', type=int)
    parser.add_argument('--value-nodes', type=int)
    parser.add_argument('--value-rate', type=float)
    parser.add_argument('--vb-ratio', type=int)
    parser.add_argument('--hb-ratio', type=int)
    parser.add_argument('--total-pageviews', type=int)
    parser.add_argument('--total-users', type=int, default=2)
    parser.add_argument('--pageview-parallelism', type=int)
    parser.add_argument('--pageview-rate', type=float)
    parser.add_argument('--sequential', action='store_true')
    parser.add_argument('--manual', help='Run Flink with a manually implemented Flumina-like synchronization',
                        action='store_true')
    parser.add_argument('--attempts', type=int, default=1)
    parser.add_argument('--rmi-host', help='Host that is running the Java RMI registry')
    args = parser.parse_args()

    if args.list:
        for name, suite in suites.items():
            print('\n\t'.join(
                [f'{name}:\n' + '=' * (1 + len(name))]
                + [str(exp) for exp in suite.experiments]) + '\n')
        exit(0)

    if args.flink_results is not None:
        p10, p50, p90 = results.get_flink_latencies(args.flink_results)
        throughput = results.get_flink_throughput(args.flink_results)
        #network_data = results.get_network_data(args.flink_results) / 1024.0 / 1024.0
        print(f'Latency percentiles (ms):  {p10:.0f}  {p50:.0f}  {p90:.0f}')
        print(f'Mean throughput (events/ms): {throughput}')
        #print(f'Network data (MB): {network_data:0.1f}')
        exit(0)

    if args.flumina_results is not None:
        p10, p50, p90 = results.get_erlang_latencies(args.erlang_results)
        throughput = results.get_erlang_throughput(args.erlang_results)
        network_data = results.get_network_data(args.erlang_results) / 1024.0 / 1024.0
        print(f'Latency percentiles (ms):  {p10:.0f}  {p50:.0f}  {p90:.0f}')
        print(f'Mean throughput (events/ms): {throughput}')
        print(f'Network data (MB): {network_data:0.1f}')
        exit(0)

    if args.experiment is not None:
        if args.experiment.startswith("value-barrier"):
            exps = [ValueBarrierEC2(args.value_nodes, args.total_values, args.value_rate, args.vb_ratio, args.hb_ratio,
                                    manual=args.manual, sequential=args.sequential, attempt=a)
                    for a in range(1, args.attempts + 1)]
        elif args.experiment.startswith("pageview"):
            exps = [PageViewEC2(args.total_pageviews, args.total_users, args.pageview_parallelism, args.pageview_rate,
                                manual=args.manual, sequential=args.sequential, attempt=a)
                    for a in range(1, args.attempts + 1)]
        elif args.experiment.startswith("fraud-detection"):
            exps = [
                FraudDetectionEC2(args.value_nodes, args.total_values, args.value_rate, args.vb_ratio, args.hb_ratio,
                                  manual=args.manual, attempt=a)
                for a in range(1, args.attempts + 1)]
        ExperimentSuite(args.experiment, exps).run(args)
        exit(0)

    if args.suite not in suites:
        parser.print_usage()
        exit(1)

    suites[args.suite].run(args)