Browse Source

add --pipeline to wrk command for plaintext test

Patrick Falls 12 years ago
parent
commit
68ed8bc1ee
2 changed files with 7 additions and 6 deletions
  1. 2 2
      benchmarker.py
  2. 5 4
      framework_test.py

+ 2 - 2
benchmarker.py

@@ -245,7 +245,7 @@ class Benchmarker:
       if os.name == 'nt':
         return True
       subprocess.check_call("sudo sysctl -w net.core.somaxconn=5000".rsplit(" "))
-      subprocess.check_call("sudo -s ulimit -n 8192".rsplit(" "))
+      subprocess.check_call("sudo -s ulimit -n 16384".rsplit(" "))
       subprocess.check_call("sudo sysctl net.ipv4.tcp_tw_reuse=1".rsplit(" "))
       subprocess.check_call("sudo sysctl net.ipv4.tcp_tw_recycle=1".rsplit(" "))
       subprocess.check_call("sudo sysctl -w kernel.shmmax=134217728".rsplit(" "))
@@ -266,7 +266,7 @@ class Benchmarker:
     p = subprocess.Popen(self.ssh_string, stdin=subprocess.PIPE, shell=True)
     p.communicate("""
       sudo sysctl -w net.core.somaxconn=5000
-      sudo -s ulimit -n 8192
+      sudo -s ulimit -n 16384
       sudo sysctl net.ipv4.tcp_tw_reuse=1
       sudo sysctl net.ipv4.tcp_tw_recycle=1
       sudo sysctl -w kernel.shmmax=2147483648

+ 5 - 4
framework_test.py

@@ -38,7 +38,7 @@ class FrameworkTest:
       echo " {wrk} {headers} -d {duration} -c $c -t $(($c>{max_threads}?{max_threads}:$c)) http://{server_host}:{port}{url}"
       echo "---------------------------------------------------------"
       echo ""
-      {wrk} {headers} -d {duration} -c "$c" -t "$(($c>{max_threads}?{max_threads}:$c))" http://{server_host}:{port}{url}
+      {wrk} {headers} {pipeline} -d {duration} -c "$c" -t "$(($c>{max_threads}?{max_threads}:$c))" http://{server_host}:{port}{url}
       sleep 2
     done
   """
@@ -280,7 +280,7 @@ class FrameworkTest:
       if self.plaintext_url_passed and (self.benchmarker.type == "all" or self.benchmarker.type == "plaintext"):
         sys.stdout.write("BENCHMARKING Plaintext ... ") 
         sys.stdout.flush()
-        remote_script = self.__generate_concurrency_script(self.plaintext_url, self.port, wrk_command="wrk-pipeline", intervals=[256,1024,4096,16384])
+        remote_script = self.__generate_concurrency_script(self.plaintext_url, self.port, wrk_command="wrk-pipeline", intervals=[256,1024,4096,16384], pipeline="--pipeline 64")
         self.__run_benchmark(remote_script, self.benchmarker.output_file(self.name, 'plaintext'))
         results = self.__parse_test('plaintext')
         self.benchmarker.report_results(framework=self, test="plaintext", results=results['results'])
@@ -447,13 +447,14 @@ class FrameworkTest:
   # specifically works for the variable concurrency tests (JSON
   # and DB)
   ############################################################
-  def __generate_concurrency_script(self, url, port, wrk_command="wrk", intervals=[]):
+  def __generate_concurrency_script(self, url, port, wrk_command="wrk", intervals=[], pipeline=""):
     if len(intervals) == 0:
       intervals = self.benchmarker.concurrency_levels
     return self.concurrency_template.format(max_concurrency=self.benchmarker.max_concurrency, 
       max_threads=self.benchmarker.max_threads, name=self.name, duration=self.benchmarker.duration, 
       interval=" ".join("{}".format(item) for item in intervals), 
-      server_host=self.benchmarker.server_host, port=port, url=url, headers=self.headers, wrk=wrk_command)
+      server_host=self.benchmarker.server_host, port=port, url=url, headers=self.headers, wrk=wrk_command,
+      pipeline=pipeline)
   ############################################################
   # End __generate_concurrency_script
   ############################################################