Basic monitoring: Databases
Download this article in PDF format
Database monitoring is an essential piece to your server
monitoring solution. Problems with the
database server, the database engine, or database queries can cause misleading
errors as slow response times of web pages.
Two approaches to database monitoring can be taken: First, use monitoring during the development phase
to ensure that as data is added and the database structure changes no adverse
affects are observed. Second, use
monitoring of production data to ensure unanticipated problems do not arise
occasionally and ensure there do not show a negative trend.
The most effective way to monitor a database is to connect
and query.
First, ensure that a connection can be made to the database
on a regular basis. The connection
should take less than 1 second – at best the connection should have zero
latency. If a connection takes over 1
second for an extended period of time, red flags should go up.
Second, monitor for database integrity by running a simple
query. Ideally, the query should be a
select statement that does not affect the data adversely. Query results should be tested for accuracy
by searching for expected text and responses should be within expected
times. Queries that take longer than
expected may indicated the need for SQL query optimization where as trending
slowness may indicate a better database optimization strategy, e.g. indexes,
table structure, etc.
|