Cant establish TCP connections from server

Posted on 2007-11-19
Last Modified: 2013-11-13
We are experiencing a tcp connection problem on our server lately. This means that we cant establish a tcp connection from the server to any host/service untill the server has been restarted.
The server is a servicing as a webserver with Apache/2.0.59 (Win32) PHP/4.4.6.
Then suddendly for some reason, after some days the server goes into an "error state" where it isnt possible to establish TCP connections from the server, until a restart.
I then checked if was even possible to telnet to the database or any other remote TCP service. Telnet returned error:" Connecting to <servername/ip> ...Could not open connection to the host, on port <TCP service number>: connect failed"
After the restart, the server works fine again for a couple of days.
I have checked our firewall, as this is between the webserver and the database. No errors
Windows event log doesnt give me any errors either.
As I cant establish a tcp connection from command prompt, I assume this is OS and not Apache related.
Have any been experiencing similar, or have any suggestions how to solve this?
Kind regards
Question by:Scanbox

Expert Comment

ID: 20312056
>As I cant establish a tcp connection from command prompt, I assume this is OS and not Apache related.

not correct.  by default for example , you cant telnet to  a server using port 80/443( because no service is using these ports). but if the server is running IIS or apache, then yes, you will able to telnet to 80/443.

in your case, i dont think it is firewall related. it could be apache causing intermittent problem.

Author Comment

ID: 20312506
Hi binary
Thanks for your answer. I am aware that there must be a service running, to be able to connect to the service :)
Last time the server was in that error state, i tried establishing an outgoing telnet connection to our mailserver on TCP25, which gave the same result. You are propertly right that its Apache that is causing this problem, but why is it preventing the OS to establish any TCP connections at all? Could it be something with tcp sockets in windows, or any other TCP/IP related service?
Im a bit lost here..

Expert Comment

ID: 20313352
what OS aer you using? what is the name of the firewall?  when you said "but why is it preventing the OS to establish any TCP connections at all"  do u mean non of the tcp ports work? can u list out the port numbers?

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.


Expert Comment

ID: 20316814
are utilizing TCP Offload?  I think SP2 may automatically enable tcp or 'chimney' offload which can cause alot of issues. If you are try disabling it,

Netsh int ip set chimney DISABLED  
should do it from a cmd prompt without a reboot.

Author Comment

ID: 20326515
OS is windows server 2003 SP2
Firewall is Juniper SSG-550
As I dig deeper into this problem, my focus is more and more on the TCP/IP protocol, stack or other network related service on my webserver.
The most annoying is that I dont have any error events, logs or other to diagnose.
Thats why its do damn hard to troubleshoot.
Anyone know of a TCP/IP diagnostic tools?

Author Comment

ID: 20338404
Anyone with a thought about this?

Expert Comment

ID: 20346252
trying downloading  "ip-tools."

Author Comment

ID: 20364711
I finaly found the solution.
On the server, I had a program creating a socket to 8 different websites whitin a time window.
This program was trying to connect to a SSL website through port 80, which of course dont work.
This somehow used up all sockets on the server, and had the server crashing after some time.
Funny thing why I couldnt see any errors in windows event log, on the NIC or anywere else.
I fixed the program to connect to the right port, and this solved the problem :)
Thanks for all your suggestions and help

Accepted Solution

Computer101 earned 0 total points
ID: 20532226
PAQed with points refunded (250)

EE Admin

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
This video teaches viewers about errors in exception handling.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question