Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty sockets


On Fri, Jul 10, 2020 at 10:44 AM <mk-klenk@xxxxxx> wrote:
> Hi community,
> first if all, I'm new to this list. Hello to all.


> I am using jetty (9.4.20) as a container server hosting multiple web applications in one process. It works pretty good. The process itself runs forked on windows and linux.
> Checking the opened ports/sockets of the process I got surprised, because the process itself on windows binds like 5-6 ports in the upper, dynamic port range above 49000. It keeps opening about 20 new sockets for a deployed web application. While the sockets on linux are bound to open pipes, it opens and establishes ports on windows. I was wondering what it does with these ports... maybe you can help me ith this question, so i might find modules i do not need... a brief look into the code revealed only few sections opening sockets: shutdown, rmi, jmx and unixsocket-server. But i do not see how this multiplies with each application deployed...

I don't think it's Jetty opening these additional ports, typically
applications (or libraries used by applications) do.

I would double check what your application/libraries are doing first.
Enabling DEBUG logging for your application/libraries may tell you
what's going on.

Jetty does open a few extra sockets (besides those necessary to handle
the incoming traffic), but whether they are opened or not depends on
how you configured Jetty (for example, you are using ProxyServlet so
there will be a HttpClient opening sockets).

Alternatively, you can attach with a debugger to the JVM and set a
breakpoint to the Socket constructor, and then see what code calls it.

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.

Back to the top