I'm using Spring Boot and embedded Tomcat(8) and in app.prop file we have two options:
server.tomcat.max-connections = 1000
server.tomcat.max-threads= 20
From tomcat docs I have read that first option is the max number of connections that server can handle and second option is the max number of threads in Tomcat's thread pool. After that I understand , connections and requests are not the same words as I tought . After that I read this topic
What is the difference between thread per connection vs thread per request?
The main points from topic are:
Thread per request will create a thread for each HTTP Request the server receives
Thread per connection will reuse the same HTTP Connection from multiple requests
After the words reuse the same HTTP Connection
I checked Http keep-alive.
Th concept: after response, server and client are able to keep open connection.
But how is it possible? I mean When I send request to the server one thread from thread pool will receive my request then send me a request , after that according to Http keep-alive
my connection is not closed. Where is it stored, what will happen when i send another request, does the same thread will procide my request?