VS Connections being held onto despite Connection: Close
search cancel

VS Connections being held onto despite Connection: Close

book

Article ID: 98175

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

While doing a performance test for a VS, after the VSM sends the response, the connections are being held for about 50 -60 seconds despite Connection: Close and Keep-Alive: Close values being returned in the response.
 
How to shorten the time the connection is being held? 

By default TCP ports hold connections for 60 secs.

Environment

All supported DevTest releases.

Cause

Linux system limitation

Resolution

This is just the way TCP works on Linux systems 

TCP port has a default 60 sec timeout value and it could be controlled by few system property settings.  

Steps to follow:

1) Run the following command to find out what the current setting for time_wait cleanup is: 

cat /proc/sys/net/ipv4/tcp_fin_timeout 

2) If the above command returns 60, it is running the timeout clean up every 60 seconds. Change the setting to 30 seconds. To change it temporarily on your Unix machine, need to have Admin privileges and here is the command: 

echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout 

NOTE: IF THE LINUX MACHINE GETS RE-BOOTED, THE TIMEOUT SETTING WILL REVERT BACK TO 60 

To change it permanently on Unix machine, run the below steps with Admin privileges: 

1) edit /etc/sysctl.conf 
2) add the following line: 
net.ipv4.tcp_fin_timeout=30 

Note: Recommending the above properties should work, but it is entirely up to the user to make these changes in an environment, and are fully aware of the side effects of changing it.