O & M is no longer professional, saving fire, and PHP is still used to identify code performance problems

Source: Internet
Author: User
Tags apm
O & M is no longer professional fire fighting, PHP still finds code performance problems. SA (O & M) on the Internet all lament the hard work of their profession, Why? Let me tell you: The APP is crashing, the website cannot be opened, the website is 502, the search is slow, the application is stuck, and O & M is accessible. the operations, project managers, and bosses are surrounded by O & M to see how it can help. Some O & M personnel are even accused of poor technology, inadequate preparation, and poor server optimization. In the face of thousands of projects, why is O & M always fighting and suffering, while R & D is constantly making bugs.

Problem locating

In case of a fault, you usually first check the log, locate some servers and projects through log analysis, and then narrow down the scope to a project. Finally, the SA works with R & D to locate and fix the problem.

After each emergency fire, O & M personnel always ask: why can't problems be found in advance? Whether there is a tool that allows O & M/development to detect and eliminate problems in advance, or launch the tool to quickly locate and stabilize faults. Everyone should realize that it is very inefficient to identify code problems through conventional methods, and it is a great test of technical staff's familiarity with the business and personal technical capabilities.

Solution

In my daily work, people often ask me how to find the cause when a problem occurs in my system or occasionally. besides providing a solution, I always tell him: try APM, it helps you quickly identify problems and locate the causes of problems. Today, I want to introduce SA to a domestic independently developed APM product, transparent video.

Transparent treasure function

APM is short for Application Performance Management. it performs code-level real-time monitoring and analysis on the IT system to detect system operation bottlenecks and issue alerts and warnings, helps O & M and development quickly locate system problems. Transparent Video Bao includes four functions: APM (Application Performance Management), mobile, browser, and host:

Piaobao installation

The installation of transparent treasure is relatively simple, and the official documents of transparent treasure are also very clear.

Please read the document directly: http://portal.toushibao.com/app/create

Host management

After installing the Smart Agent, log on to the Apsara stack console and you will be able to see the newly added host, for example:

Today's topic is not "host". since we have mentioned it, I will simply show you the basic host monitoring under the transparent video.

Server CPU, memory, process, Nic, and TCP metrics are all available. If these basic monitoring functions meet your needs, you can discard the difficult open-source monitoring products such as Zabbix. Check the monitoring results:

APM of piaobao

APM currently supports mainstream Java, PHP, Python, and ,. net code performance monitoring in four languages. PHP monitoring has supported the latest official PHP 7 version. let's take PHP as an example to learn about the power of APM.

Note: At first we were going to use ttlsa.com for experience. for various reasons, we finally switched to another test site. the number of requests was a little small, but the method for tracking PHP performance problems was the same, this helps us identify code performance problems.

Click the application and select the domain name you want to track. you can find out the PHP performance problem through the three items: request, database, and error.

APM requests

First, let's look at the overview diagram, focusing on the slow, very slow, and wrong rate. if it is relatively high, we should pay attention to it.

Normal: <500 milliseconds, slow: 2000-milliseconds, very slow:> milliseconds

Aliware lists all request URLs and the response time and number of requests corresponding to the URI.

Sort by response time. click a URL with a long response time. the following record appears on the right.

Click record to track the top five methods that consume the entire request. you can trace the code, obtain request parameters, and obtain SQL statements to restore the current environment.

  • Overview

  • Tracking details

This is very important, the longer the time (MS) function/method description can be worse. Thus, basically has located the performance problem Code, the corresponding method for R & D. Found? You can also capture PHP performance code without understanding the code.

  • Request parameters

Restore the site with the most authentic request parameters

  • SQL statement

A slow response request is partly caused by improper code writing, and partly by inefficient slow SQL statements. Pixinbao can track all SQL statements contained in a request. as a result, we can quickly locate SQL problems and submit them to R & D/DBA for optimization.

APM database

The APM can identify the code with poor performance and slow SQL statements with low performance through the "request. Pixinbao can use "database" to find slow SQL statements with low performance and find the corresponding requests for slow SQL statements ." "Database" is recommended for DBAs to frequently browse and regularly optimize slow SQL statements.

Toutizebao provides clear and easy-to-understand SQL performance charts, allowing developers to clearly understand the current SQL usage, such as the SQL operation response time (TOPS), throughput (including select, delete, insert, update)

Pixinbao will list all SQL operations, sort by average response time, and select the SQL records to be resolved to locate the interface/page corresponding to the request time consumed and the corresponding slow SQL statements.

Slow SQL tracking

APM errors

In addition to discovering problems through requests and databases, we should always pay attention to "errors ".

Appendix: Transparent treasure plug-in

The SendProxy, Discover, and OSAgent plug-ins are the default basic plug-ins of the Smart Agent. Currently, the plug-ins provided by the Smart Agent are shown in the following table.

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.