Mercurial > hg > Members > nobuyasu > jungle_benchmark
changeset 11:223af50e60d5
Added some files
author | Nobuyasu |
---|---|
date | Mon, 20 Jan 2014 02:59:12 +0900 |
parents | f94fc7812cd8 |
children | c69a41ffc439 |
files | distributed/capistrano_jungle.rb distributed/get_node_list.rb distributed/get_node_name.rb distributed/loop_qsub.sh distributed/nodes.txt distributed/nodes_stress_write_jungle.rb distributed/test_cluster_get.rb stress_write_jungle.rb |
diffstat | 8 files changed, 135 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/distributed/capistrano_jungle.rb Mon Jan 20 02:59:12 2014 +0900 @@ -0,0 +1,77 @@ +set :user, "mass" + + +# +# 62.1(mass01) and 62.48(mass48) remove from the list. +# + +# bldsv03 : use mass12 ~ mass15 (All : mass12 ~ mass17) +#role :pall00, "mass12.cs.ie.u-ryukyu.ac.jp","mass13.cs.ie.u-ryukyu.ac.jp","mass14.cs.ie.u-ryukyu.ac.jp","mass15.cs.ie.u-ryukyu.ac.jp" + +# bldsv04 : use mass18 ~ mass21 (All: mass18 ~ mass23) +#role :pall01, "mass18.cs.ie.u-ryukyu.ac.jp","mass19.cs.ie.u-ryukyu.ac.jp","mass20.cs.ie.u-ryukyu.ac.jp","mass21.cs.ie.u-ryukyu.ac.jp" + +# bldsv05 : use mass24 ~ mass27 (All: mass24 ~ mass29) +#role :pall02, "mass24.cs.ie.u-ryukyu.ac.jp","mass25.cs.ie.u-ryukyu.ac.jp","mass26.cs.ie.u-ryukyu.ac.jp","mass27.cs.ie.u-ryukyu.ac.jp" + +# bldsv06 : use mass30 ~ mass33 (All: mass30 ~ mass35) +#role :pall03, "mass30.cs.ie.u-ryukyu.ac.jp","mass31.cs.ie.u-ryukyu.ac.jp","mass32.cs.ie.u-ryukyu.ac.jp","mass33.cs.ie.u-ryukyu.ac.jp" + +# bldsv07 : use mass36 ~ mass38 (All: mass36 ~ mass41) +#role :pall04, "mass36.cs.ie.u-ryukyu.ac.jp","mass37.cs.ie.u-ryukyu.ac.jp","mass38.cs.ie.u-ryukyu.ac.jp","mass39.cs.ie.u-ryukyu.ac.jp" + +# bldsv08 : use mass42 ~ mass45 (All: mass42 ~ mass48) +#role :pall05, "mass42.cs.ie.u-ryukyu.ac.jp","mass43.cs.ie.u-ryukyu.ac.jp","mass44.cs.ie.u-ryukyu.ac.jp","mass45.cs.ie.u-ryukyu.ac.jp" + +role :pall00, "mass12.cs.ie.u-ryukyu.ac.jp","mass18.cs.ie.u-ryukyu.ac.jp","mass24.cs.ie.u-ryukyu.ac.jp","mass30.cs.ie.u-ryukyu.ac.jp" +role :pall01, "mass13.cs.ie.u-ryukyu.ac.jp","mass19.cs.ie.u-ryukyu.ac.jp","mass25.cs.ie.u-ryukyu.ac.jp","mass31.cs.ie.u-ryukyu.ac.jp" + +# max number of cluster is 24 + +task :mkdir_maven do + run "sudo mkdir /usr/local/apache-maven" +end + +task :maven_cp do + run "sudo cp -r /home/mass/share/student/k128576/maven_download/apache-maven-3.0.5 /usr/local/apache-maven" +end + +task :maven_zshrc do + run "echo \"# maven \" >> /home/mass/.zshrc " + run "echo 'export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.5\' >> /home/mass/.zshrc " + run "echo 'export M2=$M2_HOME/bin\' >> /home/mass/.zshrc " + run "echo 'export PATH=$M2:$PATH\' >> /home/mass/.zshrc " +end + +task :run_jungle do + run "/usr/local/apache-maven/apache-maven-3.0.5/bin/mvn " +end + +task :python_cp do + run "mkdir -p /home/mass/student/k128576/" + run "cp -r /home/mass/share/student/k128576/hg/Python-2.7 /home/mass/student/k128576/Python27 " +end + +task :make_python do + run "make -C /home/mass/student/k128576/Python27" +end + +task :m2_cp do + run "cp -r /home/mass/share/student/k128576/m2 /home/mass/.m2" +end + +task :run_jungle do + run "sleep 0.$RANDOM && /usr/local/apache-maven/apache-maven-3.0.5/bin/mvn -f /home/mass/share/student/k128576/hg/jungle-network/pom.xml exec:java -Dexec.mainClass='app.bbs.DistributeApp' -Dexec.args='-level fatal -host bldsv12.cr.ie.u-ryukyu.ac.jp -port 10000 -p 20000 -bp 8080' " +end + +task :killjava do + run "pkill java" +end + +task :hostname do + run "hostname" +end + +task :df_awk do + run "df | awk 'NR==3'" +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/distributed/get_node_list.rb Mon Jan 20 02:59:12 2014 +0900 @@ -0,0 +1,18 @@ +module GetNodeList + def get_node_list(filename) + f = open(filename,"r") + nodes = [] + f.each { |line| + if /.+jp/ =~ line then + nodes.push(line.chomp) + end + } + hostname = `hostname` + mynum = 0 + if /[0-9]+/ =~ hostname then + mynum = $&.to_i + end + nodes = nodes.rotate(mynum) + return nodes + end +end
--- a/distributed/get_node_name.rb Fri Jan 17 11:31:28 2014 +0900 +++ b/distributed/get_node_name.rb Mon Jan 20 02:59:12 2014 +0900 @@ -1,5 +1,5 @@ -module GetNodeName - def get_node_name(filename) +module GetNodeList + def get_node_list(filename) f = open(filename,"r") nodes = [] f.each { |line| @@ -7,12 +7,6 @@ nodes.push(line) end } - hostname = `hostname` - mynum = 0 - if /[0-9]+/ =~ hostname then - mynum = $&.to_i - end - nodenum = mynum % nodes.size - return nodes[nodenum] + return nodes end end
--- a/distributed/loop_qsub.sh Fri Jan 17 11:31:28 2014 +0900 +++ b/distributed/loop_qsub.sh Mon Jan 20 02:59:12 2014 +0900 @@ -1,7 +1,7 @@ #!/bin/sh start=1 -finish=45 +finish=13 for i in `seq $start $finish` do
--- a/distributed/nodes.txt Fri Jan 17 11:31:28 2014 +0900 +++ b/distributed/nodes.txt Mon Jan 20 02:59:12 2014 +0900 @@ -1,2 +1,9 @@ -bldsv12.cr.ie.u-ryukyu.ac.jp -bldsv10.cr.ie.u-ryukyu.ac.jp \ No newline at end of file +mass12.cs.ie.u-ryukyu.ac.jp +mass13.cs.ie.u-ryukyu.ac.jp +mass18.cs.ie.u-ryukyu.ac.jp +mass19.cs.ie.u-ryukyu.ac.jp +mass24.cs.ie.u-ryukyu.ac.jp +mass25.cs.ie.u-ryukyu.ac.jp +mass30.cs.ie.u-ryukyu.ac.jp +mass31.cs.ie.u-ryukyu.ac.jp +
--- a/distributed/nodes_stress_write_jungle.rb Fri Jan 17 11:31:28 2014 +0900 +++ b/distributed/nodes_stress_write_jungle.rb Mon Jan 20 02:59:12 2014 +0900 @@ -3,19 +3,21 @@ require 'net/http' require 'uri' require 'benchmark' -require '/home/mass/share/student/k128576/jungle_benchmark/distributed/get_node_name.rb' -include GetNodeName +require '/home/mass/share/student/k128576/jungle_benchmark/distributed/get_node_list.rb' +include GetNodeList schedule = ARGV[0].to_i time = Time.now.to_i sleepTime = schedule - time sleep(sleepTime) -nodename = get_node_name("/home/mass/share/student/k128576/jungle_benchmark/distributed/nodes.txt") +nodelist = get_node_list("/home/mass/share/student/k128576/jungle_benchmark/distributed/nodes.txt") r = Benchmark.measure { count = ARGV[1].to_i - uri = URI.parse('http://' << nodename.chomp << ':8080/editMessage?bname=hello%20world&uuid=0') + nodeSize = nodelist.size count.times {|i| + nodename = nodelist[i%nodeSize] + uri = URI.parse('http://' << nodename << ':8080/editMessage?bname=hello%20world&uuid=0') res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"hogehoge #{i}"}) } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/distributed/test_cluster_get.rb Mon Jan 20 02:59:12 2014 +0900 @@ -0,0 +1,19 @@ +#!/usr/bin/ruby + +require 'net/http' +require 'uri' +require 'benchmark' +require '/home/mass/share/student/k128576/jungle_benchmark/distributed/get_node_list.rb' +include GetNodeList + +nodelist = get_node_list("/home/mass/share/student/k128576/jungle_benchmark/distributed/nodes.txt") + +nodelist.each { |nodename| + puts "connect " + nodename + begin + ret = Net::HTTP.get(nodename,'/showBoardMessage?bname=hello%20world',8080) + rescue Errno::ECONNREFUSED + puts "Failed : get request to " + nodename + end +} +
--- a/stress_write_jungle.rb Fri Jan 17 11:31:28 2014 +0900 +++ b/stress_write_jungle.rb Mon Jan 20 02:59:12 2014 +0900 @@ -11,7 +11,8 @@ r = Benchmark.measure { count = ARGV[1].to_i - uri = URI.parse('http://bldsv12.cr.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=0') +# uri = URI.parse('http://bldsv12.cr.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=0') + uri = URI.parse('http://mass48.cs.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=0') count.times {|i| res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"hogehoge #{i}"}) }