#!/usr/bin/env python

import os, sys
import commands
import time
import utils

FILEPATH = os.path.dirname(os.path.realpath(__file__))
SERVER_NAME = utils.get_machines_from_file('execs.backend')
ORDER_NAME = utils.get_machines_from_file('orders.backend')
FILTER_NAME = utils.get_machines_from_file('filters.backend')
PROPERTY_FILE = sys.argv[1]

all_machines = utils.get_machines()

print 'Killing Java processes on needed machines...'

for m in all_machines:
    print 'Killing processes on: ' + m
    os.system(
        'ssh %s \'killall java 2> /dev/null \' > /dev/null 2> /dev/null ' % m)

print 'Done machine cleaning.'

agent_path = '-agentlib:hprof=cpu=samples,interval=100,depth=10'

num_servers = int(
    commands.getstatusoutput('grep \"EXEC.* =\" %s| wc -l' % PROPERTY_FILE)[1])
num_orders = int(
    commands.getstatusoutput('grep \"ORDER.* =\" %s| wc -l' %
                             PROPERTY_FILE)[1])
Пример #2
0
#!/usr/bin/env python

import os, sys
import commands
import time
import utils

FILEPATH = os.path.dirname(os.path.realpath(__file__))
SERVER_NAME = utils.get_machines_from_file('execs.backend')
PROPERTY_FILE = sys.argv[1]

all_machines = utils.get_machines()
agent_path = '-agentlib:hprof=cpu=samples,interval=100,depth=10'

# TODO why is this commented out?
num_servers = int(
    commands.getstatusoutput('grep \"EXEC.* =\" %s | wc -l' %
                             PROPERTY_FILE)[1])
print 'num_servers: ', num_servers

print 'start exec nodes'
no_server_machines = len(SERVER_NAME)
for i in range(0, num_servers):
    current_machine = SERVER_NAME[i % no_server_machines]
    print 'start exec at ' + current_machine
    # The number after test.properties.backend represents the number of objects stored on the backend server for modification
    # ... %s test.properties.backend 1 <--- 10
    debugPort = 5000 + i
    #-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=%s
    cmd_template = 'java -ea %s -Xms2G -Xmx4G -Djava.library.path=. -cp lib/zookeeper-3.2.2.jar:lib/log4j-1.2.15.jar:lib/bft.jar:lib/FlexiCoreProvider-1.6p3.signed.jar:lib/CoDec-build17-jdk13.jar:lib/netty-3.2.1.Final.jar:lib/h2.jar:lib/zookeeper-3.2.2.jar:lib/commons-javaflow-2.0-SNAPSHOT.jar:lib/commons-logging-1.1.3.jar Applications.benchmark.BenchServer %s %s 1000 10 2> jh_log/backend-exec_%s_err >> jh_log/backend-exec_%s_out &' % (  ##str(debugPort),
        agent_path, str(i), PROPERTY_FILE, str(i), str(i))
Пример #3
0
#!/usr/bin/env python

import os, sys
import commands
import time
import utils

# os.system('cp *.sh /users/manos/script_backup/')
# os.system('cp *.py /users/manos/script_backup/')
# os.system('cp *.properties* /users/manos/script_backup/')

FILEPATH = os.path.dirname(os.path.realpath(__file__))
SERVER_NAME = utils.get_machines_from_file('execs')
VERIFIER_NAME = utils.get_machines_from_file('verifiers')
FILTER_NAME = utils.get_machines_from_file('filters')

property_file = sys.argv[1]
agent_path = '-agentlib:hprof=cpu=samples,interval=100,depth=10'

num_servers = int(commands.getstatusoutput('grep \"EXEC.* =\" %s | wc -l' % property_file)[1])
num_verifiers = int(commands.getstatusoutput('grep \"VERIFIER.* =\" %s | wc -l' % property_file)[1])
num_filters = int(commands.getstatusoutput('grep \"FILTER.* =\" %s | wc -l' % property_file)[1])

num_dbclients_on_webserver = int(commands.getstatusoutput('grep \"toleratedCrashes =\" %s.backend| wc -l' % property_file)[1])

if num_dbclients_on_webserver < 1:
    print 'Invalid property file.'
    exit(0)

print 'Number of DB clients on Web Server is: ' + str(num_dbclients_on_webserver)
Пример #4
0
#!/usr/bin/env python

import os, sys
import commands
import time
import utils

print "Starting middle"

# These directories don't exist anymore
# os.system('cp *.sh /home/ren/script_backup/')
# os.system('cp *.py /home/ren/script_backup/')
# os.system('cp *.properties* /home/ren/script_backup/')

FILEPATH = os.path.dirname(os.path.realpath(__file__))
SERVER_NAME = utils.get_machines_from_file('execs')

print "servers", SERVER_NAME

property_file = sys.argv[1]
backend_property_file = sys.argv[2]
log_prefix = ''
if len(sys.argv) == 4:
    log_prefix = sys.argv[3]
else:
    log_prefix = 'middle'
agent_path = '-agentlib:hprof=cpu=samples,interval=100,depth=10'
num_servers = int(commands.getstatusoutput('grep \"EXEC.* =\" %s | wc -l' % property_file)[1])
print 'num_servers: ', num_servers

Пример #5
0
    num_clients_per = 4000
num_clients = (o / num_clients_per)

# TODO Does this need to match the backend? Trace these parameters to understand
NUM_OBJECTS = 1000
LOCALITY = 1000
# Does this need to match the loops? What does this change?
REQUEST_SIZE = 1000
LOOP_NUM = int(sys.argv[3])
# If you change this, you need to make sure it matches the processing scripts TODO ???
TOTAL_OPS = 1000
PROPERTY_FILE = sys.argv[4]

NO_PROGRESS_WINDOW = 1  # 10

CLIENT_NAME = utils.get_machines_from_file('clients')

num_client_machines = len(CLIENT_NAME)  # TODO it is not used

machine_txt_file = '%s/jh_log/machine.txt' % FILEPATH
# TODO why there is %N in two lines below and why 13?
# TODO we should update linux server machines
record_start = 'startTime=`date +%%s%%N`; echo startTime ${startTime:0:13} >> %s;' % machine_txt_file
#record_start = 'startTime=`date +%%s000`; echo startTime ${startTime:0:13} >> %s;' % machine_txt_file
record_end = 'endTime=`date +%%s%%N`; echo endTime ${endTime:0:13} >> %s;' % machine_txt_file
#record_end = 'endTime=`date +%%s000`; echo endTime ${endTime:0:13} >> %s;' % machine_txt_file

i = 0
threads = []
time.sleep(30)  #wait everything to be set up
while i < num_clients * num_clients_per: