3.1.5 Using the Agent Proxy Enabling Query Analyzer by Changing the MySQL Client Application Enabling Query Analyzer by Changing MySQL Server

There are three different ways of feeding Query Analyzer using the proxy component of the MySQL Enterprise Monitor Agent:

Example 3.1 Routing with Proxy and IP tables on Linux

This example assumes that default ports are used, it's on localhost, the proxy is installed on to the database box itself, and that it will not work on an intermediary server.

Enabling (with -I):

sudo iptables -t nat -I PREROUTING -s ! -p tcp --dport 3306 -j REDIRECT --to-ports 6446

Disabling (with -D):

sudo iptables -t nat -D PREROUTING -s ! -p tcp --dport 3306 -j REDIRECT --to-ports 6446


MySQL Query Analyzer gathers query performance information from a variety of sources. Query Analyzer uses a new agent plug-in to proxy your queries and collect performance data that is then transmitted to the Enterprise Monitor. This is a new role for the Agent: it is no longer just monitoring, it is now optionally between your MySQL client application and the MySQL server.

Depending upon your system load, it is possible to overload the proxy or have the proxy/agent consume system resources needed by mysql itself. In particular, the memory needed by the MySQL Agent for basic monitoring is fairly small and consistent and depends on the number of rules you have enabled. However, when the Query Analyzer is enabled, the Agent can use significantly more memory to monitor and analyze whatever queries you direct through it. In this case, the amount of memory used depends on the number of unique normalized queries, example queries and example EXPLAINs being processed plus the network bandwidth required to send this query performance data to the Service Manager. In general, the amount of memory used for the Query Analyzer is well-bounded, but under heavy load or, in some cases under older versions of linux, RAM usage by Query Analyzer could be too high for your environment and load.

Therefore, we advise you to use this release of Query Analyzer extensively in development, test and stage environments under load for an extended period of time before considering usage in a production environment. For all deployments:

  1. Carefully monitor the Agent's resource consumption using the new graph Memory Usage - Agent graphs available on the Graph tab. You can also add an SMTP or SNMP notification to the new Heat Chart rule MySQL Agent Memory Usage Excessive.

  2. If the amount of memory consumed is too high, consider sampling queries during nonpeak hours or monitoring only a subset of queries on this system.

Note: zone-specific memory usage is not available for 32-bit Solaris operating systems.

If you experience any problems with Query Analyzer, we are interested in working with you closely and quickly to resolve them. Please open a service request right away. We are working hard on optimizing Agent/proxy RAM usage.

Note that you must enable Query Analyzer within the proxy during agent installation. If you did not enable Query Analyzer during the installation of the agent, check the following elements within the main mysql-monitor-agent.ini configuration file:

For more information on these configuration options, see Section C.2.1, “MySQL Enterprise Monitor Agent Configurable Options”.

You might also need to make some additional changes to the security configuration on your server to ensure that queries are correctly reported to MySQL Enterprise Service Manager: