From 627aaac43ecbc6bd977bb73f0bb5302dc008c176 Mon Sep 17 00:00:00 2001 From: John Bresnahan Date: Mon, 18 Oct 2010 21:04:04 -0500 Subject: [PATCH] bugs in redirector n # Please enter the commit message for your changes. Lines starting --- cumulus/cb/pycb/cbRedirector.py | 3 +-- cumulus/perf/scale1.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cumulus/cb/pycb/cbRedirector.py b/cumulus/cb/pycb/cbRedirector.py index 91c9bca8..ae8caa21 100644 --- a/cumulus/cb/pycb/cbRedirector.py +++ b/cumulus/cb/pycb/cbRedirector.py @@ -28,7 +28,6 @@ def end_connection(self, request): class cbBasicRedirector(object): def __init__(self, parser): - self.max = max_connections self.connection_count = 0 self.host_file = parser.get("load_balanced", "hostfile") self.max = int(parser.get("load_balanced", "max")) @@ -36,7 +35,7 @@ def __init__(self, parser): def new_connection(self, request): h = None self.connection_count = self.connection_count + 1 - if g_connection_count >= self.max: + if self.connection_count >= self.max: h = self.get_next_host() return h diff --git a/cumulus/perf/scale1.py b/cumulus/perf/scale1.py index 6020e6a1..d5af1b94 100755 --- a/cumulus/perf/scale1.py +++ b/cumulus/perf/scale1.py @@ -20,7 +20,7 @@ g_lock = threading.Lock() g_ctr = 0 g_bucket = "ScaleTest" -g_key_name = "tst" +g_key_name = "100MB" g_times = [] g_hostname = "c1.uc.futuregrid.org" g_port = 8888 @@ -56,7 +56,7 @@ def time_upload(file): try: my_char = threading.current_thread().getName() start_tm = datetime.now() - key = upload_file(file) + key = upload_file(file+"."+my_char) end_tm = datetime.now() delt = end_tm - start_tm @@ -79,13 +79,11 @@ def main(): its = int(sys.argv[1]) file = sys.argv[2] - size = os.path.getsize(file) - print "file %s of %d bytes" % (file, size) start_tm = datetime.now() t_a = [] - char = "abcdefghijklmnopqrstuvvxyz" + char = "abcdefghijklmnopqrstuvvxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ" for i in range(0, its): t = threading.Thread(target=time_upload, args=(file,), name=char[i%len(char)]) t_a.append(t) @@ -105,11 +103,11 @@ def main(): conn = cb_get_conn(g_hostname, g_port) bucket = conn.get_bucket(g_bucket) rs = bucket.list() - for k in rs: - try: - k.delete() - except: - pass +# for k in rs: +# try: +# k.delete() +# except: +# pass max = -1.0 min = 99999999.0 @@ -119,6 +117,8 @@ def main(): if tm < min: min = tm + size = os.path.getsize(file) + print "file %s of %d bytes" % (file, size) sizeMB = size * 1024*1024 total_bytes = size * its total_bw = float(total_bytes) / float(tm)