Thursday, December 13, 2007

JMeter Load Testing - how to use the test file

The following represents rough directions on how to do load testing with the mdss jmeter test file.

1) Open the file in JMeter (File->Open)
2) You will need to give the test file your MyProxy login information for the tests to work.
- In the left hand navigation, click on the HTTP request titled "Proxymanager (request proxy)"
- Enter your username in the username field, and password in the password field
3) If you want to increase the load, just add more users (and respective files to upload)
- In the left hand navigation, click on the "User parameters" link
- Click the "Add User" button at the bottom of the screen
- Add a corresponding "FileName", "usernameValue", and "mdssFileIndex" for each new user
- mdssFileIndex should be one higher than the corresponding value for the previous user
4) Decide on how many users you want to run this test with
- Click on the "Thread Group" link at the top of the left-hand navigation
- In the "Number of Threads" input box, enter how many users you want to run the test with (note: it is limited by the number of users you have specified in step number 3 above).
5) Run the test
- Click the "Run" dropdown menu at the top toolbar, then select "Start"
- The green square at the top right of the screen means the tests are still running
- To see the test results live, click on "View Results Tree" in the left hand navigation at the bottom
6) Analyze results
- Click on the "View results tree", "Graph Results" etc.. links in the left-hand navigation at the bottom to see statistics on the results of the test-run.

MDSS/BigRed Load Testing

I am working on a JMeter testing file to test the uploading and downloading capabilities of the file-manager portlet via connecting to MDSS (HPSS) and BigRed.


Important notes of the testing scheme:
- Each "user thread" within JMeter represents a unique portal user who will upload, transfer, and download a unique file
- To do more intense load testing, just add new users and new files for those users. Right now the test is set up to have a maximum of 3 users
- Sending the file from MDSS to BigRed requires knowing the "index" of the file. These all need to be hard-coded. For example, for my MDSS account, the first file is hard-coded to be at index 12 in the file-manager list, the second file is index 13, and the next at 14.. and so on. This is the case because whenever you upload a file to MDSS, it gets placed at the bottom of the list. My mdss account had 12 files originally (index starts from zero), so after the first upload, the newest file was given an index of 12 (remember index starts from zero).

Thursday, December 6, 2007

How to upload different files for each user thread in JMeter

The way to have each individual JMeter thread (user) upload a different file to a remote web server is to add entries to the "User Parameters" module.

1) In your thread-group, Add Pre Processors > User Parameters to Thread Group
2) To add variables specific to each user, see: http://jakarta.apache.org/jmeter/usermanual/component_reference.html#User_Parameters

JMeter Load Testing on IU HPSS/MDSS

Here is the scenerio I'm proposing:

Test files:
+ 1-10MB
+ 50-200MB
+ 1GB+

Steps in load testing:
1) Log into OGCE
2) Get MyProxy credentials
3) Open file-manager portlet
4) Open connection to BigRed on left
5) Open connection to MDSS on right
6) Upload test file to MDSS
7) Transfer test file from MDSS to BigRed
8) Delete test file from MDSS
9) Transfer test file from BigRed to MDSS
7) Download test file
8) Repeat step 6 with other test files

Friday, November 16, 2007

Random build failures with maven

Some builds are seemingly failing at random, the cause is the fact that maven is downloading corrupted jar files during build time. A possible cause for this is network timeout.

What I am planning to do to correct for this is to try rebuilding the portal up to 3 times if the build fails. Below is script code for how to detect build failures and rebuild if necessary.
The key line is: "if test $? -ne 0; then"
This detects a maven build failure.


maven-2.0.7/bin/mvn -e clean install

if test $? -ne 0; then
echo ----------- MAVEN BUILD FAILED, TRYING AGAIN.. ATTEPMT 1 -----------
maven-2.0.7/bin/mvn -e clean install
fi

if test $? -ne 0; then
echo ----------- MAVEN BUILD FAILED, TRYING AGAIN.. ATTEPMT 2 -----------
maven-2.0.7/bin/mvn -e clean install
fi


if test $? -ne 0; then
echo ----------- MAVEN BUILD FAILED, TRYING AGAIN.. ATTEPMT 3 -----------
maven-2.0.7/bin/mvn -e clean install
fi


if test $? -ne 0; then
echo ----------- MAVEN BUILD FAILED, EXITING -----------
exit 0
fi

Thursday, November 1, 2007

Crontab

To get an NMI build running nightly, use a crontab as such:

1) Type:
> crontab -e
2) Enter the following into the crontab file:

MAILTO=youremail@domain.com
20 12 1 11 4 (. /nmi/bin/config.sh && nmi_submit <$HOME/yoursubmitfile.submit>)


The above crontab entry runs "nmi_submit <$HOME/yoursubmitfile.submit>" at 12:20noon, 1st day of the month, november (11), at 4th day of the week (thursday).
Consult this webpage for more details about cron: http://www.adminschoice.com/docs/crontab.htm

Tuesday, October 30, 2007

Build process steps for NMI

These are the important steps for establishing nightly builds on NMI
1) Set your project name: OGCE
2) Make sure $JAVA_HOME is set correctly - currently I am setting it manually in my build scripts
3) Put email addresses in NMI submit file so that relevant people are informed
4) Add cron tabs for scripts

Friday, October 26, 2007

Problem compiling portal through NMI testbed on Linux distros

For some reason, the portal will not compile on any of the NMI testbed linux distros; however, it will compile for macos_10.4

These are the types of compile time errors I was getting:

[WARNING] repository metadata for: 'artifact org.apache.maven.plugins:maven-clean-plugin' could not be retrieved from repository: central due to an error: Specified destination directory cannot be created: /home/vm1-user/.m2/repository/org/apache/maven/plugins/maven-clean-plugin
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------



[INFO] Error executing ant tasks

Embedded error: Directory /home/vm1-user/.globus/GridPortRepository creation was not successful for an unknown reason




The reason for the above errors is that both the .m2 directory and the .globus directory are using the incorrect $HOME value. I fixed the .m2 repository directory path by modifying maven/conf/settings.xml

${env.HOME}/.m2/repository


The incorrect globus directory is all over the place, need to fix it still

Friday, October 5, 2007

NMI Build & Test issues

I'm trying to build the OGCE portal on NMI framework, but I'm getting some problems.


The script I'm using is further down, but anyways whenever it tries to build using the script, I get the following error from maven:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks

Embedded error: The following error occurred while executing this line:
/Users/condor/execute/dir_26580/userdir/ogce-portal-only/containers/gridsphere/gridsphere-2.1.5/config/build/build-compile.xml:22: /Users/condor/execute/dir_26580/ogce-portal-only/portal_deploy/apache-tomcat-5.5.12/common/lib not found.



----------------------------------------------
The script I made:

echo
echo --------- Which java are we running? ---------
which java
java -version

echo
echo --------- What about javac? ---------
which javac
javac -version


## Untar apache tomcat server and move it to portal dir ##
cd ogce-portal-only/portal_deploy
tar xzf apache-tomcat-5.5.12.tar.gz

## extract maven and move it to portal dir ##
cd ..
tar xzf maven*.tar.gz

## do the ogce portal maven build ##
maven-2.0.7/bin/mvn install

Tuesday, September 18, 2007

Grid Proxy/Credential set up

Check list for making sure your grid-credential files and setup is correct:
  1. Make sure you have non-expired grid credential files in your .globus directory
    1. usercert.pem
    2. userkey.pem
  2. Be sure you have your proxy on myproxy.teragrid.org (or wherever you need to keep it)
    1. myproxy-init -s myproxy.teragrid.org
  3. Make sure your ".globus/certificates" folder has the right certificates files, get them from your CA's certificates folder and makes sure you have all of the ones listed in the CA's folder.
  4. Remove any ".r0" files in your ".globus/certificates" folder. These are unnecessary.

Friday, September 14, 2007

Runtime error checking

The question often arises, which error messages should one check for to make sure everything is working?
The following are the runtime error message patterns I am checking for using JMeter (via Assertion Response):

Portlet (gpir-browser-2) specific:
  • "Error message" <-- Appears in most exception messages
  • "An error has occurred!" <-- Appears in most exception messages
  • "Stack Trace:" <-- Appears in most exception messages
  • "Portlet Exception" <-- Appears in most exception messages
  • "at java.lang.Thread.run" <--- appears in most java exception messages
  • "Portlet unavailable!" <-- caused by a misconfigured portlet pom.xml file
  • "Error contacting web service" <-- caused by incorrect webservice URL in portlet.xml for gpir-browser-2 portlet
  • "The requested resource.*is not available" <-- caused by incorrectly configuring portlet in web.xml
Main gridsphere page specific:
  • "GridSphere portal failed to initialize!" <-- Caused by a misconfigured pom.xml file
  • "Stack Trace:" <-- Appears in most exception messages

Maintaining login session with JMeter

I was facing a problem where I was testing my Gridsphere based portal with JMeter, but the only page that was getting recorded was the page immedietely after the login screen. All the other pages (when simulated using JMeter) only showed the login screen when they should have actually shown some content. Basically the problem was that the "login session" was not being maintained across the JMeter thread, and only the first page (because the user entered login/password information) showed up in JMeter's simulation.

The way to maintain "login session" is to add a "HTTP Cookie Manager" to the thread group.
Go: Thread Group->Add->Config Element->HTTP Cookie Manager

And select your browser type.

Thursday, September 13, 2007

Fixed error of gridsphere not loading

With Marlon's help, fixed the problem of getting to the Gridsphere login page, and seeing this error message:

GridSphere portal failed to initialize!

Unable to create portlet web application: portlets-driver Stack Trace:
Unable to create portlet web application: portlets-driver Caused by: Unable to load portlets from: portlets-driver + due to mapping error!


Problem was that I had run the command: mvn install from the "portlets" directory and not the root directory of the OGCE installation. So remember to always run mvn install or mvn compile from the top-most directory.

Friday, September 7, 2007

JMeter proxy w/ localhost server

Seems to be some configuration problem. When I'm using JMeter's proxy, it only seems to record responses from non-local servers. For example, google.com and yahoo.com will record results in JMeter, but nothing from localhost seems to be recording.

Possible explainations:
  • JMeter only handles HTTP responses, ie only things from servers running on port 80 (but I have apache2 running on port 80, why doesn't anything record from that?)

JMeter proxy success

I was able to get a JMeter test-plan to work via JMeter's proxy server.
I used the following tutorial to do it:
http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf
A few questions still in my mind, hopefully I'll have an answer soon:
  • Why was it necessary to specify 'jakarta.apache.org' in the HTTP Request Defaults section? Does this make sure that only traffic to/from this server is recorded?
  • What is the aggregate report doing? What do the numbers mean exactly?

Thursday, September 6, 2007

First Post

This blog will include relevant discussion on JMeter testing, Grid Portlets, and NMI testbed.