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
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:
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.