Review Board 1.5.5

MarkUs load testing scripts

Updated 3 months, 1 week ago

Severin Gehwolf Reviewers
0.10.x markus_developers
None MarkUs Source Code Repository (Git)
Here is a first shot at a curl based script which can be used to simulate
students submitting something. I've also created a task for adding many student
users which is handy if you do some load simulation.

@branch load-test-script
@github-remote-url git://github.com/jerboaa/Markus.git
Manual. Don't plan to add a test for it at this point.
Posted 3 months, 4 weeks ago (October 26th, 2011, 3:48 a.m.)
I Severin.

I tested your script. I don't understand why it is supposed to do :-/

I started my rails application (from your branch), changed the path to localhost:3000 in your script, changed the files folder to ./db/sample_submission_files and ran lib/…/….sh 0 60.

I didn't see any submission posted. Did I missed something.
  1. Hi* Severin -_-''
  2. Benjamin, I'll write up a blog post as to how to use this. It will only work on stable MarkUs (0.11.x) at this point. I'll keep you posted. Thanks for testing, though.
lib/benchmarking/post_submissions.sh (Diff revision 1)
 
 
No error thrown if this repository doesn't exist.

Maybe we could use db/sample_submission_files ?
  1. You can set this to whatever you like. I think using ./submission_files is OK, since the script is expected to be run from the lib/benchmarking folder and in there is a submission_files folder. I'm not convinced that we should depend on something outside the lib/benchmarking folder here.
lib/benchmarking/post_submissions.sh (Diff revision 1)
 
 
Maybe change this line with localhost:3000 ;-)
  1. Will do so later.
By the way, I like the way your patch is cleaning the source code ;-) Once finished, we could integrate it to master branch :)

Thank you
Posted 3 months, 3 weeks ago (October 29th, 2011, 6:37 p.m.)
I'll wait for the blog post to test it out then. Here's some fun syntax critique.
lib/benchmarking/post_submissions.sh (Diff revision 1)
 
 
I suggest using $(cmd) instead of using `cmd` because it's the more polished way to script bash. ;)

It's also easier to read if you nest (if in the future that line happens to become..more complicated).
lib/benchmarking/post_submissions.sh (Diff revision 1)
 
 
Same as above
lib/benchmarking/post_submissions.sh (Diff revision 1)
 
 
White space!
lib/benchmarking/post_submissions.sh (Diff revision 1)
 
 
Since we're in bash and all you can use this neat syntax:

$ for ((i=$STUDENT_NUMBER_FROM; i<=$STUDENT_NUMBER_TO; i++)); do

This is in some newer versions of bash though, if you like I can find out which version is the cutoff for supporting this syntax. I'd suggest using it though because calling seq would fork to a subshell, which is more overhead. Bash can do it for you so why not use it!
  1. $ bash --version
    GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)
    Copyright (C) 2009 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    
    That version does not support this syntax (as it looks). I'll stick with seq for now.
  2. I checked up on it, the syntax was added as of 2.04-devel so I'm not sure why it didn't work for you. I tested it on CDF (figured they had an old version [below] of bash ;) ) and it ran fine. What code did you use exactly?
    
    This shouldn't make a difference but as a sanity check, could you use the spaced version? $ for (( i=$STUDENT_NUMBER_FROM ; i<=$STUDENT_NUMBER_TO ; i++ )) ; do
    
    
    greywolf:~$ bash --version 
    GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)
    Copyright (C) 2007 Free Software Foundation, Inc.
    
  3. I was using $ for i in (( something )); do echo $i; done instead of
    $ for (( something )); do echo $i; done
    
    Anyhow, I'll fix that later. I don't think it'll matter much, though :)
lib/tasks/benchmark_markus.rake (Diff revision 1)
 
 
2 white spaces ;)
Posted 3 months, 3 weeks ago (October 31st, 2011, 12:06 p.m.)
Here is the blog post as to how to use this: http://blog.markusproject.org/?p=3211
Review request changed
Updated 3 months, 2 weeks ago (November 8th, 2011, 10:55 p.m.)
Review request changed
Updated 3 months, 1 week ago (November 12th, 2011, 10:34 a.m.)
  • changed from master to 0.10.x

Here is the latest update of the scripts I have been using.
Review request changed
Updated 3 months, 1 week ago (November 12th, 2011, 10:35 a.m.)
  • changed from First shot at the curl based load testing script to MarkUs load testing scripts

Posted 3 months, 1 week ago (November 12th, 2011, 10:37 a.m.)

   

  
config/environments/production.rb (Diff revision 3)
 
 
 
 
 
 
 
If mongrel is used, this makes each mongrel server log to its own production.<port>.log instead of competing for it (production.log) with other mongrels.