21.1.6 Using the 2.3 Agent Proxy

21.1.6.1 Enabling Query Analyzer by Changing the MySQL Client Application
21.1.6.2 Enabling Query Analyzer by Changing MySQL Server
Note

The MySQL Enterprise Agent Proxy Service is not available with MySQL Enterprise Monitor 3.0.0, so Proxy users must install and use it with the 2.3 Agent.

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

Example 21.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 ! 127.0.0.1 -p tcp --dport 3306 -j REDIRECT --to-ports 6446

Disabling (with -D):

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

Important

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 the 2.3 agent installation. If you did not enable Query Analyzer during the installation of the agent, check the following elements within the main 2.3 mysql-monitor-agent.ini configuration file:

Note

mysql-monitor-agent.ini does not exist with version 3.0 of the Agent, but is used with the 2.3 Agent.

For more information on these configuration options, see Section D.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: