Questions tagged [time-wait]

The TIME_WAIT TCP port state

Indicates that both endpoints of a connection have closed it, and that the local end is keeping the local port in TIME_WAIT state. The system is waiting for any remaining packets to expire before closing the port. This state only lasts 2*MSL seconds where MSL is the maximum segment lifetime, typically 60 or 120 seconds.

The TIME_WAIT state is often erroneously regarded as a performance problem. It isn't, except for the length of netstat displays. However it can be avoided altogether by being the end which receives the first FIN. In practice this means the client should close the connection before the server, so that the ports in TIME_WAIT state accumulate at the client, where they are few, rather than at the server, where they are very many.

108 questions
1
vote
3 answers

server to handle 70 requests a second each with a response time less than 50 milli seconds

I receive a large number of http GET requests from limited number of IPs (< 4) from nearby servers. Task is to maintain a response time <= 50 milli-seconds for every request. I have enabled TCP connection reuse by setting tcp_tw_reuse to 1.…
haltTm
  • 534
  • 1
  • 6
  • 25
1
vote
1 answer

Linux: wake_up and sleep_on functions

I am trying to learn how to program loadable kernel modules for linux. I was wondering if anyone could tell me what the functions sleep_on and wake_up do? In examples I am looking at &WaitQ is always passed into them and static…
sam
  • 2,469
  • 8
  • 37
  • 57
1
vote
1 answer

TCP TIME_WAIT problem

I have read a TCP and socket programming book. I have a question, The TIME_WAIT state of the TCP should remain 2MSL time period as the book said. But how then a internet explore like application does not have this problem? According to the…
sandundhammika
  • 11
  • 1
  • 1
  • 2
1
vote
2 answers

How to Add Modal Box Like Waiting Cursor on WPF App

In my WPF App, there are certain time consuming actions which are activated when the user clicks a button. What I would like to do is, show the User a Modal Box like Waiting Cursor, much like its done one Web Apps, to indicate that process is going…
Shamim Hafiz - MSFT
  • 21,454
  • 43
  • 116
  • 176
1
vote
0 answers

Waiting on a threadpool in C#

Duplicate of Wait for pooled threads to complete. I have X number of functions waiting to be given to a threadpool and the threadpool has a maxnumber of threads as 5.I need to find a solution to make the main thread wait until all the X functions…
LoyalBanana
  • 183
  • 6
  • 17
1
vote
1 answer

C#: Wait certain time on external method invocation to notify timeout

this is my question: How could I handle a timeout on a method execution, the scenario is the following: I have a C# .Net framework 4.0 Windows Service application. I added a reference to a external COM assembly (of a specific software of certain…
lidermin
  • 2,782
  • 11
  • 43
  • 48
1
vote
0 answers

Due to TIME_WAIT, when the server wants to close a connection, isn't it better to tell the client to close it on their end?

If the server wants to close a connection, the server will have to wait TIME_WAIT seconds before its able to clean up the connection. Whereas if you tell the client to close the connection, the server side doesn't wait TIME_WAIT seconds because the…
1
vote
1 answer

Asyncio close connection leave connection in TIME_WAIT state

Hi I have a script that kept pooling port state of my device, this is the simplified version. When connection is success ( device is exist ) then I close the connection the state of connection become TIME_WAIT. On time this connection is pilling and…
wpsd
  • 303
  • 3
  • 21
1
vote
1 answer

On which versions of Windows (if any) can SO_EXCLUSIVEADDRUSE prevent rebinding a port that has residual connections?

Consider the following situation, on Windows: listen socket 1 has the SO_EXCLUSIVEADDRUSE option set, and binds to a port listen socket 1 receives an incoming connection, which it accepts to create a connected socket listen socket 1 is closed, but…
Nathaniel J. Smith
  • 11,613
  • 4
  • 41
  • 49
1
vote
1 answer

Lot of connections in TIME_WAIT

I had some networking issues on my Windows server, and find out (by using NETSTAT) that I have more than 90,000 (!) connections in TIME_WAIT which didn't closed. I've changed the TcpTimedWaitDelay param in registry, but apparently a server restart…
Roei
  • 319
  • 4
  • 15
1
vote
0 answers

Logstash opening thousands of ports when capturing syslog via UDP 514

I have recently started using Logstash to capture syslog data from from the default UDP 514 port. The program runs correctly and gives me the data I am looking for, however, looking in netstat during runtime, it opens thousands of ports on the…
L.Popov
  • 11
  • 3
1
vote
1 answer

TCP connection is never in established state

I have cloned a Spark project from git which I surely know works and operates correctly. When I run the program, the Jetty server ignites and looks like listening with no problem. Here is the console for that: [Thread-0] INFO…
ACS
  • 11
  • 4
1
vote
0 answers

Need An Explanation: TIME_WAIT for PHP5-FPM Stays Open for 60 Seconds

I ran into an issue the other day where my nginx web server stopped processing php scripts and gave a 504 Gateway Timeout. I've got php5-fpm setup on port 9000. When I ran netstat | grep 9000 I got the following result, hundreds of times with…
jcaruso
  • 950
  • 11
  • 19
1
vote
1 answer

TIME_WAIT on Loopback Interface

Why is it that TCP connections to a loopback interface end up in TIME_WAIT (socket closed with SO_DONTLINGER set), but identical connections to a different host do not end up in TIME_WAIT (they are reset/destroyed immediately)? Here are scenarios to…
Brian
  • 3,457
  • 4
  • 31
  • 41
1
vote
1 answer

Lot of TIME_WAIT connections while using RestTemplate?

I am using Spring RestTemplate to make a HTTP Calls to my RestService. I am using spring framework 3.2.8 version of RestTemplate. I cannot upgrade this since in our company we have a parent POM in which we are using Spring Framework version 3.2.8 so…
john
  • 11,311
  • 40
  • 131
  • 251