Test Servlet Performance

Source: Internet
Author: User

Servlet performance testing mainly considers the following Servlet version running methods:

I. Servlet Running Mechanism in Web containers

1. Run a single stateless Servlet instance

That is, the running mode of a Servlet instance is called by multiple threads in the Web container.

2. Multiple Servlet instances

There are multiple Servlet Instance Object pools in the Web Container and multiple Web Container threads to call and execute them separately.

Ii. Servlet connection to the database

1. One-to-one

Each Servlet instance has a direct database connection.

Specific methods include:

◆ The database connection is called every time in each processing method of the Servlet instance. Then, the connection is used for database query and other operations. Finally, the connection is closed and released.

◆ Connect to a "long" database connection during Servlet instance initialization until the Servlet instance closes and releases the database connection during destroy.

Because the current database operations are mainly queries, and there are no operations such as adding or modifying databases, multi-User Service Query, multi-threaded Web containers, and operations on the same database connection of a Servlet should not cause data operation synchronization and other problems.

2. Use the Web Container Data Source

Here we mainly use the data source of the Web Container-database connection pool.

Theoretically, this method can provide the best performance. This is also a test of the performance of various Web Container products in the database connection pool.

Here we mainly look at the optimal configuration of Web containers in various application scenarios.

How to connect a Servlet to a data source:

Servlet directly retrieves the data source and its connection object from the Web container configuration, and then operates the database through this connection object. The Web Container manages database connection objects.

Iii. Considerations for Servlet performance testing:

1. Transmission of large data volumes

After the large data volume is obtained from the database through the Servlet instance, how can it be effectively transmitted to the client IE, and how can the Servlet instance effectively process the large data volume in the Web container.

2. Test various JDBC versions

That is to say, different databases use their own dedicated JDBC for connection, and the performance should be better.

Here, we can also compare the difference between JDBC in Weblogic Server and various databases such as MSSQL and Oracle, from the test results, can we see that the technical instance of Weblogic Server and whether the database connection and other processing are optimized.

3. Optimizing Weblogic Server Configuration

3.1 Object pool Configuration

Including the object pooling of application logic processing objects and the optimized configuration of the database connection object pool when using the data source in various application environments.

3.2 thread pool Configuration

The above two aspects involve object pooling and serialization processing strategies.

3.3 configuration of Weblogic Server configuration parameters

◆ Java vm) parameter configuration in various application scenarios.

◆ Weblogic Server Parameters

Servlet performance testing is a step-by-step task, and you may need to pay attention to it during the Servlet performance testing process.

  1. Get database connection in JSP
  2. When JSP is converted to Servlet
  3. Analysis on the working principle of JSP + JavaBean + Servlet Structure
  4. Analysis of the best solution example of JSP IIS
  5. Introduction to JSP Elements

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.