Question

'Reuse Sockets' option in Service Definer Connection

  • 28 March 2022
  • 5 replies
  • 75 views

Is there any documentation about what the 'Reuse Sockets' option in the Service Definer's Connection settings does?


5 replies

Userlevel 1

Hey Marc,

I don’t think its in the documentation. It should be in Connections | USoft Community but it isn’t.. I can give u a short description of what it does and Ill create a ticket for R&D to document this feature.

For the Service Framework to communicate with the Rules Service it will create a socket connection. When you connect to a RulesService, with the port 7777 for example, your operating system will also use a port to communicate back to the Service Framework. Because these ports are limited (something in the 60k), and the ports are not released instantly by the operating system, it can occur that you cannot create a connection to the Rules Service because there is no temporary port available. This issue can occur when you handle a queue for example and there is a decent amount of connecting to the Rules Service. 

When you use the option “Reuse Sockets” the service definer will not let go of the Socket after its request is done. It will be kept in a pool for a little while. When there is another request to the Rules Service, the Service Framework will take that connection from the pool and the same temporary port is used to communicate from the Rules Service back to the Service Framework. This results in less temporary ports used and the possibility of running out of port is reduced.

I hope this makes it a little clearer for you :)

Gert

I think it does :-). We currently increase the number of available ports in the registry:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPorts

The ‘Reuse Sockets’ option should (help) prevent running out of ports, correct?

Badge +2

Hi Marc,

In an environment where USoft applications were communicating heavily with an enterprise service bus, we always added the DWord “TcpTimedWaitDelay” to the registry key you mentioned for each Windows server:

TcpTimedWaitDelay: 0x1E (30 seconds)

This reduces the time a socket is kept open. By default sockets are kept alive 4 minutes on Windows systems.

I believe this was the source of our knowledge at the time:

https://www.ibm.com/docs/en/sva/7.0.0?topic=SSPREK_7.0.0%2Fcom.ibm.isam.doc_80%2Fameb_perftuning_guide%2Fconcept%2Fcon_wintimewaitdelay.html

 

Cheers,

Robert

 

Thanks for the tip, Robert

I believe this was the source of our knowledge at the time:

https://www.ibm.com/docs/en/sva/7.0.0?topic=SSPREK_7.0.0%2Fcom.ibm.isam.doc_80%2Fameb_perftuning_guide%2Fconcept%2Fcon_wintimewaitdelay.html

 

Thank you for the link. That worked for me!

Reply