Use JMeter to test JSP Application Performance

Source: Internet
Author: User

If you want to test the performance of your JSP application, you can use JMeter, an open-source product developed by the Apache Software Foundation. JMeter allows you to develop test solutions to test accessible HTTP, FTP, and JDBC database servers. JMeter can use cookies and URL rewriting to process Servlet verification. Therefore, JMeter performs well in testing JSP applications. it's: http://jakarta.apache.org/jmeter

Let's take a look at JMeter. You can write a very simple JSP page to use JMeter for testing, such as test. jsp. to test this page, we first generate a thread group containing five threads, each with 100 cycles. in this way, the effect of each browser is simulated, and each browser runs the test solution 100 times.

Run jmeter. bat, a GUI window built by Java swing is displayed. right-click the test plan in the tree structure on the left, select Add> thread group option to add a thread group, and enter 5 in the number of threads to simulate 5 browsers; enter 5 in Ramp-Up Period (in seconds) and 100 in the number of cycles.

Next, you need to generate an HTTP request under the thread group and configure it to access your test. jsp page. right-click the thread group and choose add> Sampler> HTTP request. enter your host name or IP address in the server name or IP address. In this example, I write localhost. Enter the port number according to the actual situation. Mine is 8080. Enter HTTP as the Protocol, the method is Get. Enter the URL of your JSP page according to your environment. I wrote/test. jsp; other values are default.

Then add a report. right-click the thread group and choose add> listener> aggregate report. when we run this thread group, the minimum, maximum, and average response time of browsing the test page will be displayed. if you need to write the report content to a file, you can enter the file path and file name to be saved in the file name. Of course, this is optional.

Finally, click "run"> "start" to run the test plan. It may take some time to run the test. During the test, you can view the results in the aggregation report window.

JSP applications can not only generate aggregate reports, but also generate some other reports, such as Spline Visualizer (Spline Visualizer). The setting is similar to the aggregation report.

  1. Analysis of the best solution example of JSP IIS
  2. Can JSP meet the Web boom?
  3. Multi-thread synchronization in Servlet and JSP
  4. Is JSP a major failure in the Development of Java?
  5. JSP blocks the JSF light like a dark cloud

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.