Search This Blog

October 20, 2010

Benchmarking Web Application with Autobench

When it comes to do performance testing of a web application, there crops up crazy many questions like,  "What all aspects of the web application do we need to cover as part of performance testing?", "What are the different tools that are readily available?", "How much money can we or the company spend in this effort?", "Where do I start from?", "What all tools should I consider?", "On what basis should I filter some of them for further consideration?", etc.

I'm not going to provide insight on what is the best way to go about it or even publish how we went about doing it all. I will however blog on those points sooner or later. If you however have crossed these points and made up your mind to spike or consider using Autobench, then read on......and share me your experience or comments.

What is Autobench?
Autobench is an open-sourced tool to do fairly decent performance testing of any web application. It is a wrapper on top of another open-sourced tool called Httperf. This is a command-line tool like its partner Httperf.

What are its features?
Some of the feature of Autobench are as follows:
  • Its open-sourced.
  • Its commnad-line tool.
  • It can generate reports in tsv (tab seperated view) or csv (comma seperated view) formats.
  • From the tsv report, graphs can be generated with accompanying tool called bench2graph that gets installed along with autobench.
  • Easy to install.

What are its drabacks?
Some of its drawbacks being:
  • Its graphs are not very intutive enough in the sense that x-axis and y-axis are not marked with requests/sec and responses/sec respectively.
  • Its not very handy tool to do soak-testing of an application.

What is the installation procedure?
  • Download the Autobench source tarball from http://www.xenoclast.org/autobench/ (For the purpose of example, let it be autobench-2.1.2.tar.gz)
  • Untar it with the following command:
    • $ tar xvfz autobench-2.1.2.tar.gz
  • Now change present working directory to the extracted directory (autobench-2.1.2)
    • $ sudo make
      Command output:
      gcc -O2 -Wall -o crfile crfile.c
      crfile.c: In function ‘write_buffer’:
      crfile.c:81: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
      crfile.c: In function ‘main’:
      crfile.c:173: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
      gcc -O2 -Wall -o sesslog sesslog.c 

  • And finally run the below mentioned command:
    • $ sudo make install
      Command output:
      mkdir -p /usr/local/bin /usr/local/etc /usr/local/man/man1
      perl -pi -e 's/my \$MASTER_CONFIG =.*$/my \$MASTER_CONFIG = "$ENV{AB_CFG}";/' autobench
      cp crfile autobench autobenchd autobench_admin sesslog bench2graph /usr/local/bin
      cp autobenchd.1 autobench_admin.1 crfile.1 autobench.1 sesslog.1 bench2graph.1 /usr/local/man/man1
      cp autobench.conf /usr/local/etc


Testing/Using autobench and bench2graph


$ autobench
    Autobench configuration file not found
     - installing new copy in /home/karthik/.autobench.conf
    Installation complete - please rerun autobench
Note that, /usr/local/etc/autobench.conf
Default configuration file, copied into the user's home directory when autobench is first run.


$HOME/.autobench.conf   #The active autobench configuration file.


$ bench2graph
    Usage          : bench2graph PARAM_1 PARAM_2 [PARAM_3 ... PARAM_N]
    Parameter 1    : autobench results file
    Parameter 2    : name of the postscript output file
    Parameter 3..N : [optional] columns to display in the graphic

$ bench2graph autobench_results.tsv autobench_results_graph.ps
    Enter the title : Test Graphical Results For All Data
    /usr/local/bin/bench2graph: 90: gnuplot: not found


[Work In Progress...Do visit again...]



October 19, 2010

FAQ on RVM - Ruby Version Manager


How do I manage different versions of Ruby and its associated gems in my system? The obvious answer is RVM. I have been using it for quite a while now and started to put the frequently used commands (fuc) and questions that keep cropping up in my mind in this page. I should come handy as cheatsheet or whatever when I need to quickly get the answer. I very humbly acknowledge that I have been perusing for answers at http://rvm.beginrescueend.com/ but felt the need for a one-stop-page to look for quick answers. So did this page happen. I will keep updating this page with all relevant questions/problems that I have/faced possibly with right answers/solutions.
  1. What is the command to know if RVM is currently loaded in the opened shell?
    $ type rvm | head -n1 (If this shows "rvm is a function", you're good to go)  
  2. What is the command to install a specific version of Ruby, say 1.9.1?
    $ rvm install 1.9.1
  3. What is the command to use a specific version of ruby installed in rvm, let's say Ruby 1.9.1?
    $ rvm use 1.9.1 or equivalently
    rvm 1.9.1
  4. What is the command to find the version of Ruby currently in use by rvm?
    $ ruby -v
  5. What is the command to show currently installed rubies?
    $ rvm list
  6.  Output will be something like below (where => denotes the ruby that is currently being used by ruby):
       rvm rubies
             jruby-1.3.1 [ i386-java ]
             jruby-1.5.2 [ i386-java ]
       => ruby-1.8.7-p302 [ i386 ]
             ruby-1.9.1-p378 [ i386 ]
  7. What is the command to find the installation directory of Ruby in use?
    $ which ruby
  8. What is the command to use any Ruby not managed by RVM?
    $ rvm system
  9.  The above command tells the current shell to act as if you haven't run any "rvm use" commands yet.
  10. What is the command to make one specific version of Ruby as default when a new terminal shell is opened?
    $ rvm --default ruby-head
  11. What is the command to switch to RVM's user chosen default ruby?
    $ rvm default
  12. What is the command to find which version/flavour of Ruby/JRuby is the default?
    $ rvm list default
  13. What is the command to display Ruby information for the current shell?
    $ rvm info
  14. What is the command to switch to gems directory for current ruby?
    $ rvm gemdir
  15. What is the command to switch to the system gems directory?
    $ rvm gemdir system
  16. What is the command to switch to the system user's gems directory?
    rvm gemdir system user
  17. What is the command to reset to pre-RVM state?
    $ rvm reset
  18. What is the command to uninstall RVM installed, say,1.8.7 version of Ruby?
    $ rvm uninstall 1.8.7
  19. What is the command to install gems from system gem dir (osx: /Library/Ruby/Gems/1.8) using current ruby?
    $ rvm system ; rvm gemset export system ; rvm 1.8.7 ; rvm gemset import system
  20. [More to come...]
References: