0

I have several Windows Services that I developed that connect to SQL Server 2008 R2 via TCP/IP on port 1433.

The application is written so that only ONE connection per service is used to connect to SQL Server. But I may see several hundred connections to port 1433 all in the Time Wait state for a given Service.

Whenever one of my Services disconnects or connects from SQL Server, I'm absolutely positive that an entry is written to a log file. Yet for the hundreds of TCP connections to SQL Server that are no log entries whatsoever.

The obvious thought is that my Service is opening and closing a connection to SQL Server for every transaction, but that is not the case here.

As a matter of fact I will see hundreds of tcp connections to SQL Server in the TIME_WAIT state on one of my Services one minute, and the next minute they will all be gone, and then a different Windows Service that I developed will have hundreds of tcp connections to SQL Server in the TIME_WAIT State. Yet both Windows Services process transactions continuously every second..

Is there any possible explanation as to how all these TCP connections to SQL Server occur without my Service actually explicitly opening and closing the database connection? Maybe a MS Bug somewhere??

Jack Allen
  • 103
  • 1
  • 7
  • Adding one more detail here.. I'm now running TCPView from SysInternals.. When running TCPView all of the open connections in the TIME_WAIT state don't appear to be coming from the Windows Services I wrote, but rather the process name is identified as System Process. – Jack Allen Mar 22 '17 at 20:11
  • I've seeing hundreds of entries in TCPView that look like the following: Process PID Protocol Local Address Local Port Remote Address Remote Port State [System Process] 0 TCP localservername 50547 remoteservername ms-sql-s TIME_WAIT What could [System Process] be, with PID of 0??? – Jack Allen Mar 22 '17 at 20:23
  • See http://stackoverflow.com/questions/22802847/tcp-connection-owned-by-pid-zero – Richard Critten Mar 22 '17 at 23:48
  • Are there any relevant entries in the Windows event log? – Rami A. Apr 10 '17 at 22:00
  • There are no relevant entries in the Windows event log. – Jack Allen Apr 11 '17 at 03:38

0 Answers0