[freetds] [PATCH] Configurable TCP KeepAlives

Peter Deacon peterd at iea-software.com
Tue Aug 12 16:08:17 EDT 2008


On Mon, 11 Aug 2008, James K. Lowden wrote:

> So, here's my threshold.  Someone has to describe to me a situation on a
> correctly configured network -- no borked firewall -- wherein a keepalive
> timer will give the application better information than can be had in its

Experimentally playing with a packet sniffer the default for the MS driver 
seems to be to send TCP keep-alives at 30 sec intervals continually for 
the duration of the TCP session.

(Keep-Alive messages are similiar to send()ing 0 bytes)

A good experiment I guess would be to run WAITFOR DELAY '00:01:00' on a 
client system without a query timeout and pull the computers network 
cable.  Try it with freetds vs the MS driver and see what the results are.

It was interesting setting up an experiment that worked..

If you stop the server the OS sends an ICMP hint that disconnects the 
client. If you pull the clients network cable the OS will ususally 
invalidate the connections itself (On windows anyway)

Ended up putting an MSSQL server on a vmware session and pausing the
session to simulate the problem.

The FreeTDS driver waits forever (Let it go for about 10 mins)
The MS driver times out after about a minute.

take care,
Peter



More information about the FreeTDS mailing list