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
2
votes
0 answers

Why linux reuses 'time_wait' port?

As I know, tcp port in 'time_wait' stat cann't be used. However, in my experiment, server reuses the 'time_wait' port? Why? Firstly, in client machine, type command ehco 40000 40001 > /proc/sys/net/ipv4/ip_local_port_range. So, the maximum number of…
Pengcheng
  • 439
  • 1
  • 4
  • 14
2
votes
2 answers

Why does java thread wait() work only with time limit in here?

I am trying to get familiar with Java threads for the SCJP and I had a question. In the below-written code i simply created: two Runnables with a common data storage (an array) and a synchronized write() method to fill it with data successively…
Abutalib
  • 23
  • 5
2
votes
1 answer

Wait until the webpage loads in Scrapy

I am using scrapy script to load URL using "yield". MyUrl = "www.example.com" request = Request(MyUrl, callback=self.mydetail) yield request def mydetail(self, response): item['Description'] =…
Prabhakar
  • 1,138
  • 2
  • 14
  • 30
2
votes
1 answer

node application with too many time_wait

Is there any relationship with http.Agent.maxSockets and the number of sockets created on the server? I set maxSockets to 30 using http.Agent(), but there are still TIME_WAIT signals a lot. It seems like more than 30. Is that impossible to control…
user2884721
  • 217
  • 1
  • 3
  • 8
2
votes
1 answer

TCP listening socket is not created

I'm developing a Qt application and experience rather weird network issue. Let me show how it looks from end-user perspective. First I start up my server and verify that it's listening on a target port: [user@host server]$ sudo netstat -anp | grep…
krakovjak
  • 51
  • 1
  • 7
2
votes
1 answer

waiting for infinte time when timeout is given

I have a test code for wait(timeout). public static void main(String[] args) throws Exception { Runnable r = new Runnable() { public void run() { while (true) { int random =…
2
votes
1 answer

Can a lot of TIME_WAIT bring down a server?

I have read the related question: What is the cost of many TIME_WAIT on the server side? But I'm still lost. We have two application servers and a database server (all are virtual machines provided by a cloud service). Today the database server…
ADTC
  • 8,999
  • 5
  • 68
  • 93
2
votes
1 answer

Too many connections to memcached in TIME_WAIT state

I have troubles with connections to memcached. I assume there are no free local ports at busy hours. netstat -n | grep "127.0.0.1" | grep TIME_WAIT | wc This command give me 36-50k connections, possible it is more at busy hours How could extend port…
andreyvlru
  • 41
  • 1
  • 5
2
votes
2 answers

Lots of requests as TIME_WAIT - will this cause concurrency issues for a node.js server?

As I was running apachebench on a nginx -> node.js server, I noticed after a certain number of concurrent requests were set, some of the requests were not being followed through to completion. The results of ss -s output are as follows: TCP: 26006…
dsp_099
  • 5,801
  • 17
  • 72
  • 128
2
votes
2 answers

Http connection using apache.DefaultHttpClient goes into TIME_WAIT not getting reused

We have a pool(GenericObjectPool) of HttpClient(apache.DefaultHttpClient) objects. HttpPost objects are put into for execution through these clients may Post request are sent simultaneously. The protocol used is: HTTP/1.1 with keepalive. Observed…
2
votes
2 answers

Is there any chance of data of old TCP connection to sneak into new TCP connection on same port

I am setting SO_REUSEADDR option on sockets. Suppose a socket is closed from one end. And socket descriptor got reassigned to other process. Is there any chance of data from old TCP connection to sneak into new TCP connection? Did anybody observe…
Chandu
  • 1,837
  • 7
  • 30
  • 51
2
votes
2 answers

Receive data on socket in TIME_WAIT state

What happens, in below scenarios, when a socket in TIME_WAIT receives a segment a) When it receives lost ACK b) When sending node wants to establish another new connection using same src_ip:src_port on the server to same dst_ip:dst_port for which…
Mardanian
  • 191
  • 2
  • 11
2
votes
3 answers

how can Sikuli be used for wait for the button untill it displayed it and then click on it?

i m applying a sikuli skript on a webpage so that it when page loads it waits for the specific button when it appears it clicks it if not it wait for the certain time until button appears on the webpage..i have done the following script ..it works…
Irfanz Sheikh
  • 37
  • 1
  • 3
  • 10
2
votes
1 answer

How to pause a frame from loading in actionscript

I have a game in which a flight will shoot bullets and when the bullet hits an enemy ship a blast effect comes and another frame loads. Now the problem i'm facing with is the blast effect and the next frame are loading at a time. So, I've added this…
Pramod
  • 1,411
  • 11
  • 35
  • 66
2
votes
3 answers

How can I make timeout = 1 second for wait_event_timeout function?

How can I make timeout = 1 second for wait_event_timeout function? Function : wait_event_timeout (wq,condition,timeout); How can I make timeout = 1 second. And if call function like that : wait_event_timeout(queue,flag!='n',30*HZ); timeout =???
phuongnd
  • 123
  • 1
  • 6