def Run(benchmark_spec):
    """Runs mutilate against memcached and gathers the results.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.

  Returns:
    A list of sample.Sample instances.
  """
    clients = benchmark_spec.vm_groups['client']
    server = benchmark_spec.vm_groups['server'][0]
    server_ip = server.internal_ip
    metadata = {
        'memcached_version': memcached_server.GetVersion(server),
        'memcached_server_size': FLAGS.memcached_size_mb,
        'memcached_server_threads': FLAGS.memcached_num_threads,
        'smp_affinity': FLAGS.set_smp_affinity
    }

    samples = mutilate.Run(clients, server_ip, memcached_server.MEMCACHED_PORT)
    for sample in samples:
        sample.metadata.update(metadata)

    return samples
def Run(benchmark_spec):
    """Runs memtier against memcached and gathers the results.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.

  Returns:
    A list of sample.Sample instances.
  """
    client = benchmark_spec.vm_groups['client'][0]
    server = benchmark_spec.vm_groups['server'][0]
    server_ip = server.internal_ip
    samples = []
    metadata = {
        'memcached_version': memcached_server.GetVersion(server),
        'memcached_server_size': FLAGS.memcached_size_mb,
        'memcached_server_threads': FLAGS.memcached_num_threads
    }

    for pipeline in FLAGS.memtier_pipeline:
        for client_thread in FLAGS.memtier_threads:
            logging.info(
                'Start benchmarking memcached using memtier:\n'
                '\tmemtier threads: %s'
                '\tmemtier pipeline, %s'
                '\tmemtier connection, %s', client_thread, pipeline,
                FLAGS.memtier_pipeline)
            tmp_samples = memtier.Run(client, server_ip,
                                      memcached_server.MEMCACHED_PORT,
                                      client_thread, pipeline)
            for sample in tmp_samples:
                sample.metadata.update(metadata)
            samples.extend(tmp_samples)
    return samples
Exemplo n.º 3
0
def Run(benchmark_spec):
  """Runs mutilate against memcached and gathers the results.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.

  Returns:
    A list of sample.Sample instances.
  """
  clients = benchmark_spec.vm_groups['client']
  server = benchmark_spec.vm_groups['server'][0]
  memcached_server.StopMemcached(server)
  time.sleep(60)
  for idx in range(_NUM_INSTANCES.value):
    port = memcached_server.MEMCACHED_PORT + idx
    memcached_server.ConfigureAndStart(
        server, port=port, smp_affinity=_SMP.value)

  server_ip = server.internal_ip
  metadata = {
      'memcached_version': memcached_server.GetVersion(server),
      'memcached_server_size': FLAGS.memcached_size_mb,
      'memcached_server_threads': FLAGS.memcached_num_threads,
      'memcached_local_instances': _NUM_INSTANCES.value,
      'smp_affinity': _SMP.value
  }

  samples = mutilate.Run(clients, server_ip, memcached_server.MEMCACHED_PORT,
                         _NUM_INSTANCES.value)
  for sample in samples:
    sample.metadata.update(metadata)

  return samples
Exemplo n.º 4
0
def Run(benchmark_spec):
  """Runs memtier against memcached and gathers the results.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.

  Returns:
    A list of sample.Sample instances.
  """
  client = benchmark_spec.vm_groups['client'][0]
  server = benchmark_spec.vm_groups['server'][0]
  server_ip = server.internal_ip
  metadata = {'memcached_version': memcached_server.GetVersion(server),
              'memcached_server_size': FLAGS.memcached_size_mb,
              'memcached_server_threads': FLAGS.memcached_num_threads}
  samples = memtier.RunOverAllThreadsPipelinesAndClients(
      client, server_ip, memcached_server.MEMCACHED_PORT)
  for sample in samples:
    sample.metadata.update(metadata)

  return samples