I really like how Perlbal does it: It opens a connection when it thinks it needs more and issues a (by default, it's configurable) "OPTIONS *" request and only after getting a successful response to the test will it send real requests on that connection (and then it will keep the connection open with Keep-Alive for further requests).
Ask