Home>

I'm running my appspring+tomcatwith these options:

-Xms256m
-Xmx3048m
-Dserver.port=3333
-Dserver.tomcat.max-threads=30
-Dserver.tomcat.max-connections=35
-Dserver.tomcat.max-post-size=-1
-Dserver.tomcat.connection-timeout=-1
-Dserver.tomcat.keep-alive-timeout=-1
-XX:+UseG1GC

Create 35 connections via parametermax connections, and set the time as-oneso that connections are not closed after idle.

After starting, I want to executegetrequest for data (well, or any other request). If you run the application, then through requests you can access the data and get a response from the server, but if you leave the server for 1-2 days and re-access it, then nothing will happen. The request does not reach the server. This I see throughFiddlerand through the application itself.

If you look at the data throughProgress Teleric Fiddler, you will see a message like this:

The first picture shows thatconnection: closealthough it is not clear what this is about.

Based on the parameters that are set before starting the application, connections should not be closed, even if idle for a long time occurs.

Tell me, what is the reason for this situation? How can you make it sotomcatclosed connections?

¿How did you determine that it was the server that was closing the connection?

user78606702022-02-14 08:57:44

This is my guess. The thing is that at the start everything works, but a certain downtime passes, maybe 1-2 days and it is not possible to connect to the server. At the same time, I see an error 502 in Fiddler. How do you think this can be solved?

Evendie2022-02-14 09:02:35

First, look at the ports, you have port 3333 in the parameters, and below in the logs 4444.

Russtam2022-02-14 12:26:58

Also keep in mind that the fact that you set an endless keepalive to the server does not mean that there will be an eternal connection, it also depends on the client. The client can make a single request and immediately send Connection: close with the request. Then it is not at all clear what you want to achieve, why do you need the connection to hang for 1-2 days? Specifically, for the problem that you cannot make a call to the server, check that the server is running, check on which port, check that the connection pool is not clogged, set the default settings instead of -1.

Russtam2022-02-14 12:32:50