How to diagnose Application service performance issues (Tomcat, WebLogic Middleware)

Source: Internet
Author: User

In our web project, our common Web application servers are tomcat, Weblogic, and WebSphere. They are infrastructure software for Internet applications, also called "middleware," which handles dynamic on-page requests, provides names, transactions, security, messaging, data access, and so on, and provides the development, deployment, operation, and management capabilities that should be built.

How do we better monitor and diagnose performance problems when we do performance tests on our projects? Below is my analysis of some performance monitoring methods for Tomcat and WebLogic:

1. Tomcat Performance monitoring and analysis

Tomcat is a free open source Web application Server software that is primarily used to support running Java servlet/jsp. Tomcat runtime occupies a small system resources, scalability, support load balancing and messaging services, such as the common features of development applications, and it is constantly improved and perfected, using Tomcat as a Web application server, in the system application performance of a great help, Here are a few ways to monitor tomcat performance:

1) Tomcat's own monitoring function

People who have used Tomcat probably know that it comes with a monitoring page that modifies the Tomcat-users.xml file in the configuration file/conf directory, adds permissions to the monitored user, and needs to add a role called "Manager-gui" as follows:

1 <  rolename= "Manager-gui"/>23<   Username= "Monitor"  password= "123456"  roles= "Manager-gui"  />4  

After saving, access Http://localhost:8088/manager/status, to view Tomcat performance status

2) Monitor Tomcat with Lambdaprobe

Download probe compressed files online, http://www.lambdaprobe.org/decompression, you can see there is a Probe.war file, and then need to modify two files

A, modify the tomcat under the Conf/tomcat-users.xml file, add the following code:

1 <rolerolename= "Manager"/> 2 <rolerolename= "PowerUser"/> 3 <rolerolename= "Poweruserplus"/> 4 <rolerolename= "Probeuser"/> 5 <Userusername= "Probe"Password= "123456"Roles= "Manager,probeuser,poweruser,poweruserplus"/>6  

B, modify the Tomcat under Bin/catalina.bat file, add the following code:

After you start Tomcat, Access http://localhost:8088, enter your username: Probe, password 123456, log in,

In the page "WAR file to deploy" click "Browse" to publish the Probe.war file to the Tomcat app

Visit http://localhost:8088/probe/to see the performance of Tomcat-running applications,

3) LoadRunner scripting for Tomcat performance monitoring

LR does not support direct monitoring of Tomcat, but it is possible to write scripts in Vugen to get performance data, in fact writing a number of association functions Web_reg_sava_param () and Lr_user_data_point functions, for example:

1 DoubleAtofConst Char*string);2 3externChar* Strtok (Char* token,Const Char*delimiter);4 5 Collectmetrics () {6 7 intcountp, Counts, countf, countf, Countr, COUNTK;8 9 intnumvalues;Ten  One Static intLoggedversioninfo =FALSE; A  -Lr_save_string ("127.0.0.1" ," ServerName "); -  theWeb_set Max_html_param_len (65565); -  - web_set_user ("admin", "admin", "{ServerName}"); -  + lr_start_transaction ("Monitor Tomcat"); -  +Web_reg_save_param ("Jvmfreememory", "Lr=free Memory", "RB=MB", "ord=1", last); A  at It's a little bit .....  Multiple monitoring metrics are added here -  - lr_end_transaction ("Monitor Tomcat", Lr_auto); -  -   -  in Write Tomcat JVM metrics data -  to lr_user_data_point ("Tomcat JVM free Memory", Atof (Lr_eval_string ("{jvmfreememory}" )); +  - } the  

Then set the data collection interval "pacing" in run-time, preferably set in 5-10s, and finally set up the script to run in the controller, after the scene has finished running, add "User Defined data Points" In the analysis results icon "To view the Tomcat performance data that was collected.

4) JMX Monitoring Tomcat

Using JMX to monitor Tomcat, you need to write a JMX-provided implementation class that any Java program can call to access, write Java programs to collect Tomcat performance data, and skip it!

5) Optimizing the JVM to improve Tomcat performance

A, modify the Tomcat Startup/maximum running memory to monitor the impact of performance indicators, that is, modify the Bin/catalina.bat file;

java_opts=-xms512m-xmx1024m

b, modify the value of Server.xml file MaxThreads in the Conf directory to adjust the maximum number of connection threads for Tomcat;

C, ibid, modify the value of the ConnectionTimeout to adjust the connection timeout number;

D, ibid, modify the value of the Acceptcount to adjust the maximum number of queues;

2, WebLogic middleware monitoring performance analysis

A, adjust the session strategy on the WebLogic console page;

b, JDBC connection number monitoring and parameter adjustment, such as initial capacity, Maximum capcity, etc.;

C, JVM monitoring analysis, can set the JVM startup parameters;

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.