TCP connection overrun problems

I have my Intranet on a server With Windows Server 2018 R2(16GB RAM) and Zope Plone (2.13.8) Python version 2.6.6

I am having TCP connection overrun problems

16 instances have been created in Zope Plone, only 8 instances were started, but the problem continues.

When this happens, problems start slowing down without consuming all the resources of memory, network or CPU

How can I do to force inactive connections to close? These connections can reach more than 700 and when I restart the services of the instances the problem improves but then

Has something changed in your setup recently? (which version of Plone is this?)

I take it you mean ZEO clients?

We have created 16 services on Windows one for each instance. The version of Plone is 2.13.8, python 2.6.6 windows 32 bits.

There has been no change in the configuration

In windows it is noticed that the TCP connections increase and the slowness in the clients that use the Intranet is settled

We need to know how to configure plone to close inactive connections

there is no such version as 2.13.8 for Plone, you may be referring to Zope; then your Plone version should be something like 4.1.

sorry but you're using old and unsupported versions of both Python and Plone.

anyway, TCP issues belong to the operating system and not to the application.

Hvelarde, Is correct with reference to the version that you indicate

It is the application that determines which ports it uses

Attached is a link that defines the problem we are having.

https://blogs.technet.microsoft.com/askds/2008/10/29/port-exhaustion-and-you-or-why-the-netstat-tool-is-your-friend

I think we have a misunderstanding here; you have to describe correctly your problem: TCP connection overrun and port exhaustion seem to me 2 different issues.

you have to describe your architecture and TCP-related configuration in detail; just an example in one of the busiest sites we host:

# netstat -anp | grep 80 | wc -l
143
# netstat -anp | grep 6081 | wc -l
144
# netstat -anp | grep 8081 | wc -l
13

it makes absolutely no sense you're running out of ports on your server because even with 16 instances you should be using less than 20 ports for inbond connections in total.

check your web server configuration, specially the keepalive parameter; if it's too high, connections should be keep open unnecessarily.

in my nginx configurations I normally use:

keepalive_timeout 10;

check your logs in search of traces of DoS attacks or other problems.

I've had issues with running out of network resources. I forget the exact error. But our setup is kind of unique. We run a single ZEO with 20 databases + ZRS. When you have enough clients connecting to this it ends up with a lot of sockets since each ZEO connection and ZRS connection is to a DB not the server as a whole. I forget the number it ends up being but from memory we couldn't go past 16 clients.
I doubt that is what is going on in this case though.

For the record we are looking at fixing this problem by running a seperate ZEO instance per DB. That should also improve IO since it will help avoid GIL issues I believe.

sorry, I just saw this in you previous answer; are you using Plone directly without a front end web server? I think that's a bad idea.

anyway I just find the force-connection-close parameter and it might help you:

http-force-connection-close
Set to on to enforce Zope to set Connection: close header. This is useful if for example a 304 leaves the connection open with Varnish in front and Varnish tries to reuse the connection.

check: plone.recipe.zope2instance ยท PyPI

you should still check who is leaving the connections open using the netstat command mentioned above.