Interface performance analysis and tuning process for a simple web system

Source: Internet
Author: User
Tags web database

When testing a simple system interface performance pressure, press to a certain amount, the program always crashes, view relevant machine related data, CPU, memory, IO Occupy is not high, the problem naturally occurred elsewhere
Introduce the system component architecture first

The resin version is:
[Email protected] lib]# Java-classpath/resin.jar com.caucho.Version
Resin-3.2.1 (built Fri, Oct-04:11:01 PDT)
Copyright (c) 1998-2008 Caucho technology. All rights reserved

The MySQL version is:
Server version:5.5.39


When running the interface pressure, when the TPS reaches 100, the program when the error prompts for resin restart

[ .-Geneva- at  A: -: -] JDK detected deadlock. Restarting Resin. [ A: -:17.929] {resin- A} JDK detected deadlock. Restarting Resin. [ .-Geneva- at  A: -: -]"001"Id= -BLOCKED on [email protected] owned by"http--80-32"Id= -

How to solve the problem? Here, let's talk about a solution to the bottleneck of performance problems:
1, check whether it is a server hardware bottleneck, which involves CPU, memory, IO Read and write, we can be observed through Vmstat, SAR or iostat; by observing, in this case, there is no hardware bottleneck in the problem.
2, network bottlenecks, can be determined by viewing the network utilization, a lot of ways, here is not introduced; but if it is in the LAN, and this is just a Web service type Web site, and the video class site is different, so in this case there is no network problem
3, Linux operating system bottlenecks, Linux on the performance of the design to the kernel parameters too many, here can be the parameters of "Linux Server Performance Tuning", as a reference book use; In this example, the Linux TCP connection release time has been adjusted, but the problem remains;
4, the middleware bottleneck, here refers to the third-party middleware, such as Tomcat, JVM, database and so on, generally in the network after the download of the program, you need to adjust according to the actual situation of the server; In this example, after adjusting the relevant parameters, performance improved, but the individual interface still have problems;
5, the application of bottlenecks, which needs to be debugged with the development, such as business logic, SQL optimization, algorithms and so on

In this example, the Linux kernel parameter adjustment, the network has more detailed parameters, please refer to:

11 1

In this test, the adjustment of the relevant one-piece is as follows:
1, Resin to handle the adjustment of the service:
Conf\resin.xml file parameter adjustment under Resin directory

<jvm-arg>-server</jvm-arg><jvm-arg>-xmx512m</jvm-arg><jvm-arg>-xms256m </ jvm-arg><jvm-arg>-xss256k</jvm-arg><memory-free-min>10m</memory- free -min><thread-max></thread-max><socket-timeout>20s</socket-timeout>< Keepalive-timeout>15s</keepalive-timeout>


Specific adjustment methods, you can refer to the JVM performance tuning related articles, such as: http://uule.iteye.com/blog/2114697

2, Web database connection parameter adjustment
In some programs, the processing power of the Web connection data is limited, in this case, the default initial processing power is 1, here to modify

dbinitialcapacity="1"  (initialization processing power) dbmaxcapacity="5" (Maximum processing capacity

3, MySQL database performance processing adjustment
Specific parameters MySQL database performance can be adjusted, according to the machine memory, CPU adjustment, you can refer to blog:http://www.educity.cn/shujuku/692462.html
In this example, the maximum number of connections, connection pooling has been adjusted

--max_connections= --innodb_buffer_pool_size=2500m

4, program internal problems, such as the landing reached the maximum number of open files, and so on
This is designed to be an internal program.

Resources:

Linux Performance tuning: http://download.csdn.net/detail/machen_smiling/7736543

MySQL Performance tuning: http://www.educity.cn/shujuku/692462.html

Linux Performance monitoring command: http://os.51cto.com/art/201412/460698_all.htm

Interface performance analysis and tuning process for a simple web system

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.