Mercurial > hg > Members > shoshi > jungle_benchmark_script
changeset 0:28b900ca0be8 default tip
hg init
author | Shoshi TAMAKI |
---|---|
date | Mon, 11 Mar 2013 15:05:24 +0900 |
parents | |
children | |
files | calc_avg.sh loop_qsub.sh stress_read_5000.rb stress_read_5000_cassandra.rb stress_read_cassandra.rb stress_read_cassandra.sh stress_read_jungle.rb stress_read_jungle.sh stress_write_10000.rb stress_write_cassandra.rb stress_write_cassandra.sh stress_write_jungle.rb stress_write_jungle.sh test.sh test2.sh |
diffstat | 15 files changed, 250 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calc_avg.sh Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,18 @@ +#!/bin/sh + +function average() { + total=0.0 + count=0 + while read time + do + total=`echo $total + $time | bc` + count=`echo $count + 1 | bc` + done + avg=`echo "scale=4;$total/$count" | bc` + echo "$count,$avg" +} + +for arg in $@ +do + average < $arg +done
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loop_qsub.sh Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,17 @@ +#!/bin/sh + +start=1 +finish=45 + +for i in `seq $start $finish` +do + echo "current count = $i" + qsub -v times=5000,schedule=`expr $(date +%s) + 5` -l nodes=$i:ppn=4 stress_write_jungle.sh + while [ "x`qstat`" != "x" ] + do + echo "waiting for job to complete" + sleep 5 + done + echo "job complete" + sleep 15 +done
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_read_5000.rb Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,16 @@ +#!/usr/bin/ruby + +require 'net/http' +require 'benchmark' + +puts Benchmark.measure { + schedule = ARGV[0].to_i + time = Time.now.to_i + sleepTime = schedule - time + #puts "sleeping ",sleepTime + sleep(sleepTime) + 5000.times {|i| + puts i + Net::HTTP.get('133.13.56.60','/showBoardMessage?bname=hello%20world&uuid=c52f3ee0-72ae-11e2-87ba-3295b3de4854&author=shoshi&key=0&msg=hogehoge',8080) + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_read_5000_cassandra.rb Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,16 @@ +#!/usr/bin/ruby + +require 'net/http' +require 'benchmark' + +puts Benchmark.measure { + schedule = ARGV[0].to_i + time = Time.now.to_i + sleepTime = schedule - time + sleep(sleepTime) + + 5000.times {|i| + Net::HTTP.get('133.13.56.60','/showBoardMessage?bname=hello%20world',8080) + } +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_read_cassandra.rb Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,18 @@ +#!/usr/bin/ruby + +require 'net/http' +require 'benchmark' + +tms = Benchmark.measure { + schedule = ARGV[0].to_i + time = Time.now.to_i + sleepTime = schedule - time + sleep(sleepTime) + + count = ARGV[1].to_i + count.times {|i| + Net::HTTP.get('133.13.56.174','/showMessage?bname=hello%20world',8080) + } +} +puts tms.real +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_read_cassandra.sh Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,18 @@ +#!/bin/sh +# +#PBS -q tqueue +#PBS -N read_cassandra_4core +#PBS -l walltime=00:05:00 + +script=/home/mass/share/student/k118585/stress_read_cassandra.rb + +function run() { + while read serv + do + ssh $serv -o "StrictHostKeyChecking no" "/usr/bin/ruby $script $schedule $times" & + done + wait +} + +uniq $PBS_NODEFILE /tmp/nodes +run < /tmp/nodes
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_read_jungle.rb Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,18 @@ +#!/usr/bin/ruby + +require 'net/http' +require 'benchmark' + +tms = Benchmark.measure { + schedule = ARGV[0].to_i + time = Time.now.to_i + sleepTime = schedule - time + sleep(sleepTime) + + count = ARGV[1].to_i + count.times {|i| + Net::HTTP.get('133.13.56.60','/showBoardMessage?bname=hello%20world',8080) + } +} +puts tms.real +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_read_jungle.sh Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,18 @@ +#!/bin/sh +# +#PBS -q tqueue +#PBS -N read_jungle_kvm_bldsv10 +#PBS -l walltime=00:05:00 + +script=/home/mass/share/student/k118585/stress_read_jungle.rb + +function run() { + while read serv + do + ssh $serv "/usr/bin/ruby $script $schedule $times" & + done + wait +} + +uniq $PBS_NODEFILE /tmp/nodes +run < /tmp/nodes
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_write_10000.rb Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,16 @@ +#!/usr/bin/ruby + +require 'net/http' +require 'benchmark' + +puts Benchmark.measure { + schedule = ARGV[0].to_i + time = Time.now.to_i + sleepTime = schedule - time + #puts "sleeping ",sleepTime + sleep(sleepTime) + 5000.times {|i| + #ret = Net::HTTP.get('133.13.56.60','/editMessage?bname=hello%20world&uuid=c52f3ee0-72ae-11e2-87ba-3295b3de4854&author=shoshi&key=0&msg=hogehoge',8080) + ret = Net::HTTP.get('133.13.56.60','/editMessage?bname=hello%20world&uuid=0&author=shoshi&key=0&msg=hogehoge',8080) + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_write_cassandra.rb Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,17 @@ +#!/usr/bin/ruby + +require 'net/http' +require 'benchmark' + +r = Benchmark.measure { + schedule = ARGV[0].to_i + time = Time.now.to_i + sleepTime = schedule - time + #puts "sleeping ",sleepTime + sleep(sleepTime) + count = ARGV[1].to_i + count.times {|i| + ret = Net::HTTP.get('133.13.56.174','/editMessage?bname=hello%20world&uuid=d3891320-74fd-11e2-afe9-0050568b006b&author=shoshi&key=0&msg=hogehoge',8080) + } +} +puts r.real
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_write_cassandra.sh Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,18 @@ +#!/bin/sh +# +#PBS -q tqueue +#PBS -N write_cassandra_4cores +#PBS -l walltime=00:05:00 + +script=/home/mass/share/student/k118585/stress_write_cassandra.rb + +function run() { + while read serv + do + ssh $serv "/usr/bin/ruby $script $schedule $times" & + done + wait +} + +uniq $PBS_NODEFILE /tmp/nodes +run < /tmp/nodes
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_write_jungle.rb Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,16 @@ +#!/usr/bin/ruby + +require 'net/http' +require 'benchmark' + +r = Benchmark.measure { + schedule = ARGV[0].to_i + time = Time.now.to_i + sleepTime = schedule - time + sleep(sleepTime) + count = ARGV[1].to_i + count.times {|i| + Net::HTTP.get('133.13.56.60','/editMessage?bname=hello%20world&uuid=0&author=shoshi&key=0&msg=hogehoge',8080) + } +} +puts r.real
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_write_jungle.sh Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,18 @@ +#!/bin/sh +# +#PBS -q tqueue +#PBS -N write_jungle +#PBS -l walltime=00:05:00 + +script=/home/mass/share/student/k118585/stress_write_jungle.rb + +function run() { + while read serv + do + ssh $serv "/usr/bin/ruby $script $schedule $times" & + done + wait +} + +uniq $PBS_NODEFILE /tmp/nodes +run < /tmp/nodes
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test.sh Mon Mar 11 15:05:24 2013 +0900 @@ -0,0 +1,18 @@ +#!/bin/sh +# +#PBS -q tqueue +#PBS -N test +#PBS -l walltime=00:05:00 + +script=/home/mass/share/student/k118585/stress_read_cassandra.rb + +function run() { + while read serv + do + ssh $serv -o "StrictHostKeyChecking no" "hostname" & + done + wait +} + +uniq $PBS_NODEFILE /tmp/nodes +run < /tmp/nodes