File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Stress testing using JMeter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Stress testing using JMeter " Watch "Stress testing using JMeter " New topic

Stress testing using JMeter

Reema Patel
Ranch Hand

Joined: Jan 26, 2006
Posts: 169
Hello All,
I'm trying to stress-test a web app running on Tomcat 5 servlet container using JMeter. The container and JMeter are located on different physical machines on a network.

The problem that I'm facing the following problems:
(1)I'm trying to stress-test a servlet. Inside my servlet I have put some diagnostic message whits prints to the Tomcat console window just for the sake of testing if its getting called by JMeter. I have property checked the IP, port nd the resource path. But, unfortunately no message is getting printed on the sole window.

Servlet Code Snippet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
PrintWriter pw=response.getWriter();
System.out.println("some message");
�.buss logic �will move in a bean later
Is it because the request is not coming from a browser, that�s why there�s no reference to HttpServletRequest and HttpServletResponse? How can I be sure that that my doGet() method ever gets called?

(2)I'm testing a connection pooling servlet (JNDI DataSource) and another version that creates a connection object frm the scratch. But ironically the throughput of the later is better than the former.


Reema Patel
Ranch Hand

Joined: Jan 26, 2006
Posts: 169
Can anybody tell me, as to where I should install the MySQL DB and JMeter. I have Tomcat and MYSQL on the same box and JMeter on a different box. But, still the results are pretty ironical.

Pls. help...
Reema Patel
Ranch Hand

Joined: Jan 26, 2006
Posts: 169
still no help...I'm wondering how this forum is running...
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Originally posted by Reema Patel:
still no help...I'm wondering how this forum is running...

It's running on voluntary force, which means that nobody's being paid to hang out here answering questions. Luckily, there are enough individuals who love to help others when they can in order to keep things rolling.

Some things that might help you in getting your questions answered include telling the details. In this post, you're not really saying anything about how you're using JMeter so it's probably quite difficult to guess what might be wrong.

What I can tell from the details you did provide is that JMeter is not hitting your servlet. I assume that you see the "System.out.println" stuff in the Tomcat console when accessing the web application manually with a web browser?

Oh, and while you're waiting for someone to answer your questions, why not take a quick look at whether you could help someone else with their problems in the meanwhile!

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Reema Patel
Ranch Hand

Joined: Jan 26, 2006
Posts: 169
Yup! when I access the same servlet from a web browser then the message is getting printed on Tomcat console window. But, unfortunately, I don't get 2 c anything when i'm simulating a HTTP request from JMeter.

I have JMeter and MySQL installed on the same machine and JMeter on a different box. I have carefully checked HTTP Defaults nd HTTP Request in JMeter for the path and request parameters.
I agree. Here's the link:
subject: Stress testing using JMeter
It's not a secret anymore!