On 31.03.2020 15:30, Mark Thomas wrote:
On 31/03/2020 13:29, André Warnier (tomcat/perl) wrote:
On 31.03.2020 14:20, Mark Thomas wrote:
On 31/03/2020 11:20, Aditya Kumar wrote:
Tomcat 9.0.30 on Windows Server 2012 / Java 1.8

I've noticed on a freshly installed version of tomcat 9, upon startup
there
are several connections to and from localhost on different ports

For example on my tomcat server there are 4 connections to and from
localhost (output from netstat)

   TCP    0.0.0.0:8080           0.0.0.0:0
LISTENING       3972
   TCP    127.0.0.1:55618        127.0.0.1:55619
ESTABLISHED     3972
   TCP    127.0.0.1:55619        127.0.0.1:55618
ESTABLISHED     3972
   TCP    127.0.0.1:55620        127.0.0.1:55621
ESTABLISHED     3972
   TCP    127.0.0.1:55621        127.0.0.1:55620
ESTABLISHED     3972
   TCP    [::]:8080              [::]:0
LISTENING       3972

These can grow to a large number (several thousand) on a busy system.
What
are these connections used for? What caused them? What thread are they
attributed to?

The Java NIO implementation on Windows uses TCP for intra-process
signalling. It opens a pair of self-connected sockets for every Selector.

Mark


While we're at it, under Linux, are the following for a similar reason ?

output of :  netstat -pan | grep 27514   (tomcat's JVM PID = 27514)
[...]
unix  2      [ ]         STREAM     CONNECTED     167427210 27514/java
unix  2      [ ]         STREAM     CONNECTED     167423436 27514/java

Don't know. One possible way to check would be to add an additional NIO
connector and see if you get more of them.


Note : this is not very important, was just curiosity

But Nope.

I added a second HTTP Connector (port 8180), which by default should be NIO :

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
        <!-- just for a test -->
    <Connector port="8180" protocol="HTTP/1.1"
                address="127.0.0.1"
               connectionTimeout="20000"
               redirectPort="8443" />

and restarted tomcat, but the number of listed unix sockets remains the same :

root@xxx:~# netstat -pan | grep 32647  (tomcat 8.5 has a new PID)
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      
32647/java
tcp6       0      0 127.0.0.1:8009          :::*                    LISTEN      
32647/java
tcp6       0      0 :::8080                 :::*                    LISTEN      
32647/java
tcp6       0      0 127.0.0.1:8180          :::*                    LISTEN      
32647/java
tcp6       0      0 127.0.0.1:8009          127.0.0.1:45190         ESTABLISHED 
32647/java
unix  2      [ ]         STREAM     CONNECTED     190838270 32647/java
unix  2      [ ]         STREAM     CONNECTED     190846897 32647/java
root@darwin:~#


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to