Tomcat7+java the high CPU in the process of pressure measurement to troubleshoot and solve the problem

Source: Internet
Author: User

Ring Architecture Environment:

Front-end Haproxy as reverse proxy, backend n+1 Tomcat+java service


A problem occurred:

The environment is new, this week in the beginning of the pressure test normal, with the increase in volume, causing the CPU has been soaring.


Solutions and ideas:


1.) Use the top command to view the CPU-high PID

# according to the top command, the discovery of a process with a PID of 2195 and 975 consumes up to%200+ of CPU, which clearly fails

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/84/5A/wKiom1eN7X2xg8jPAADUmZy5BSc283.jpg-wh_500x0-wm_3 -wmp_4-s_2116617270.jpg "title=" 1.jpg "alt=" Wkiom1en7x2xg8jpaadumzy5bsc283.jpg-wh_50 "/>


2.) through Top-h-P PID command view, found 2275 3302 3375 These processes consume CPU time 8 minutes

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/84/5A/wKioL1eN7gOwF8w4AAEyVJbRqTQ637.jpg-wh_500x0-wm_3 -wmp_4-s_3234734211.jpg "title=" 2.jpg "alt=" Wkiol1en7gowf8w4aaeyvjbrqtq637.jpg-wh_50 "/>

3.) convert the thread PID to 16, for example: The PID process above is converted to 3375 for d2f .

command:printf "%x\n" 3375

4.) Use the jstack command to output Java stack information for convenience or output to text for easy viewing.

command:jstack 2195 |grep d2f-a 30

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/84/5B/wKiom1eN8R6COSc_AAJk4M-yZkE497.jpg-wh_500x0-wm_3 -wmp_4-s_1810559371.jpg "title=" 3.jpg "alt=" Wkiom1en8r6cosc_aajk4m-yzke497.jpg-wh_50 "/>


5.) send the output information to the developer for confirmation so that the problematic code can be identified .

This article is from the "Destiny." blog, be sure to keep this provenance http://hypocritical.blog.51cto.com/3388028/1827833

Tomcat7+java the high CPU in the process of pressure measurement to troubleshoot and solve the problem

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.