Zend Server Best Practices > Development > Monitoring Rules > Slow Query Execution

Slow Query Execution

Description: When a specific query runs longer then a specified duration it generates an event. The “Slow Query Execution” Rules contains a list of functions that trigger eventsAn event is a collection of runtime-related information collected by the Monitor component. This information is collected when an event is triggered, according to the conditions defined by the Monitoring Rules. either severe or normal.

Information Collected:

The most important details are:

In most cases, these details alone should be enough to indicate what happened to trigger an event.

Applicable Diagnostic Actions:

Click on a link to see how to perform each action  tools are listed in order of relevance to helping solve the event:

Possible Causes and Solutions:

Slow queries in general indicate that there is a performance problem and they generally appear when there is a heavy load, which in turn causes Web applications to perform poorly.

 

Check the following:

Bottlenecks caused by un-optimized queries or multiple queries, such as un-joined queries, slow queries and multiple short queries. Use the Profiler to see how many queries are running at the same time or set thresholds to find queries that take a long time to run.

Check to see if a different CPU intensive process was running in the background taking up the CPU and making everything run slowly.

Look at the amount of calls to the function - are there too many? add breakpoints and run again to manually trace per query what happened. Possible Solution: cache the information using a Data Cache API as a PHP array or use the Page Cache to cache the presentation layer.

Profiler results - analyze the profiler results and isolate functions/areas that consume the majority of the time and analyze each function/area code separately to isolate the possible cause of the problem.

 

 

Related Links

Related Links:

Advanced Diagnostics with Zend Server 

 

 

 

© 1999-2013 Zend Technologies, Ltd. All rights reserved.