1. Page execution time query tool
Jetbrains dottrace profiler V3.0
Here: http://www.jetbrains.com/profiler/download/
2. Data Packet Analysis tools after database profile tracking
Here: http://www.cleardata.biz/cleartrace/download.aspx
3. prosql Server 2005 profiler
Install with database
4. IIS Log Analysis
Enables ODBC to record logs to the database.
5.windbgand umdhtools.exe
Tools used to analyze problems when you encounter problems that you do not know.
Download and use umdhtools here: http://support.microsoft.com/kb/268343/zh-cn
In fact, when I arrive at a new company, it is impossible for us to immediately access the core development of the company. Various supervisors generally allocate some code that has been completed by others, let's get familiar with and learn. Higher supervisors will let you learn the Code with your homework. By the way, we will prepare for the next stage of work, so the homework will come out: after reading the code, can you mention something that you think is unreasonable or can optimize the performance? OK. Let's start from the unknown code step by step.
After getting the code, I usually break it down one by one. First, I use dottrace profiler to analyze the page. Here we use the local debugging link of my personal space http://my2.csdn.net/index.htmlto show you the profiler的 (generally, we should find, solve the problem on that page, and perhaps the problem of optimization will be solved by more than half ):
OK. The page shows the write method that the page goes through and lists the execution time and number of calls of each method, at this time, we will have a general understanding of the program structure. From the logic layer above the database, we know what methods and methods are needed to open this page,, now we only have a preliminary understanding of the program. Although there is a display of execution time, we know the time here to start optimization. Let's keep it up. For now, you just have a general understanding of the process.
At this time, we can open the SQL Server Profiler and refresh the page again. OK. Now, we know the stored procedure to be executed when the page is opened. Know which stored procedures are running,
The execution time of each SP also exists. At this time, we use the File tracked by SQL Server Profiler and clear trace to help us analyze the call times and execution time of each sp, disk I/O.
At this time, we know which tables, stored procedures, and detailed information about each stored procedure are used in the database.
Now, we have a certain understanding of the Code, SP, and table used to execute the current page.
Thinking time:
- What scripts are used when the page is opened? How does one communicate with the server? Is the design of the page structure (HTML structure) reasonable, script running has been reached, and we can recognize the best status? Does the page enable compression when obtained by the client? Including CSS, script, and HTML (here we can find some clues that can be optimized)
- When this page is opened and the logic structure goes down step by step, where is unnecessary? Where can I tune it? Do I need to be called so many times in some places? Can it be reduced?
- Database sp, which of the following statements are not required? Is it possible to add redundant fields to make every database operation faster?
- Advanced thinking: Why is the overall logic structure and hierarchy designed like this on the page? (At this time, I want to ask the programmers and comments about your code. Of course, if there is nothing like the code I have taken over before, man, you have to be lucky) maybe so many calls are not only being used by the current program, but are there any other places in the company that are also called? If the code is called, can it be called independently for you to make the logic structure of the Code clearer?
- Database sp, each of which is executed in the SQL Server 2005 query analyzer to see where time is consumed. There are many articles on the Internet that tell us how to optimize the SP to reduce I/O, I will not say much about improving the execution efficiency.
- Is there any job in the database? What data can be run with a scheduled application? There is no need for real-time computing and display.
- Is it possible to separate something into a service? And perform operations?
- This is also the most difficult part: How is the cache of this program used? This problem is also the most difficult to identify, the most complex and often the most difficult to plan, and it is necessary to keep trying. Can I use ifream in some places? Can I use File Cache? Whether a third-party cache is used, such as memcache; whether the existing cache takes a long time or not.
- Highest Height: What is the server deployment structure of the program? That is, the server topology diagram. After this is clarified, a client will actually know how a request is sent to the terminal server and how it is executed. Is it possible to improve program execution performance by modifying the server topology.
It is said that the preparations for these many programs have been completed before the release. Is this the end of this thinking? The answer is yes: No. Haha
Think again:
- If this program asks you to publish it to the server, what should you do?
- What are the steps required? Are the tools required for upgrading ready? What are them?
- What other things are related to the company and must be compatible during release?
- Does the database data involve migration?
- Are all database scripts and release versions released programs ready?
- What services need to be upgraded?
- Which jobs need to be reset?
- Is there any file cache to be generated?
- The last one is directly related to your economy. are O & M personnel allowed to shut down the alarm system?
After thinking about all the above, is it over? The answer is still yes: No.
All of the above considerations are that the program we released has no problems on external servers. Is it true? Are you dreaming?
- If a problem occurs, how can we find the problem? Are our tools ready?
- Do you have contact information for all involved personnel?
Worst of all, the problem has not been solved by the morning of the next day, bro. Don't worry, calm down, persistence is victory.
If the problem persists on the third day: Brother, you are from Mars or go back to Mars (attacked by the boss)
This article is still a lot different, with the resource links and details, please complete it, take a rest, take a rest for a while 2