Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have an ASP .NET web application that relies heavily on databases hosted on separate hardware. We're looking to expose an endpoint (probably just a simple .aspx page) that can be used by external tools/interested parties to determine whether or not the web application is "up and running". Let's call this endpoint the Status Monitor.

Since the web application relies so heavily on the database tier, we want the Status Monitor to ensure that it's able to hit the database. That said, the Status Monitor could be hit many times per hour so we want this database check to be as cheap as possible.

I was thinking we'd have the Status Monitor open a DB connection and do a quick "select @@version" query as a means to ensure that database connectivity is up and running.

Are there cheaper methods and/or queries to establish that the web server is indeed able to connect to and query the database tier?

share|improve this question
add comment

1 Answer

I was thinking we'd have the Status Monitor open a DB connection and do a quick "select @@version" query as a means to ensure that database connectivity is up and running.

That's just about the best way. Confirming not only is the DB machine is running, but the database is running and connectivity is possible. A ping (for instance) or a WMI check would not check the last.

Remember .NET pools connections, so this would not necessarily mean a complete new connection (with authentication etc. overhead).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.