Skip to content

Manage Tomcat queued connections #6571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

herau
Copy link
Contributor

@herau herau commented Aug 5, 2016

Adding two tomcat server properties:

  • server.tomcat.accept-count
  • server.tomcat.max-connections

Fixes #6433

@pivotal-issuemaster
Copy link

@herau Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@herau Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 5, 2016
@herau herau force-pushed the master branch 3 times, most recently from 6b35e3a to 5f38ed3 Compare August 5, 2016 15:41
Adding two tomcat server properties:
- server.tomcat.accept-count
- server.tomcat.max-connections

Fixes spring-projectsgh-6433
@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 9, 2016
@philwebb philwebb added this to the 1.5.0 milestone Aug 9, 2016
@philwebb
Copy link
Member

philwebb commented Aug 9, 2016

Thanks. I'll target this to 1.5. We should also look to see if Jetty/Undertow have similar options that mean this could be a top level property.

@herau
Copy link
Contributor Author

herau commented Aug 9, 2016

Ok i will check it.

@herau
Copy link
Contributor Author

herau commented Aug 10, 2016

@philwebb
Tomcat has an acceptCountoption

The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 100.

and a maxConnections option

The maximum number of connections that the server will accept and process at any given time. When this number has been reached, the server will accept, but not process, one further connection. This additional connection be blocked until the number of connections being processed falls below maxConnections at which point the server will start accepting and processing new connections again. Note that once the limit has been reached, the operating system may still accept connections based on the acceptCount setting.

Jetty has an acceptQueueSizeoption:

The size of the pending connection backlog. The exact interpretation is JVM and operating system specific and you can ignore it. Higher values allow more connections to wait pending an acceptor thread. Because the exact interpretation is deployment dependent, it is best to keep this value as the default unless there is a specific connection issue for a specific OS that you need to address.

But i don't find any option for the limitation of connections number :-( maybe it's already available with server.jetty.acceptors?

Undertow provide a RequestLimitingHandler which allow to define the maximum concurrent requests and the the maximum number of requests to queue

So you could use a generic option to set the max number of requests to queue with a key like server.max-requests-queue-size; are you ok with that ?

@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Aug 10, 2016
@philwebb
Copy link
Member

@herau Thanks for the detailed analysis. It looks like the different implementations are probably different enough that a uniform property isn't the best approach after all. We're just merge your PR as it is and keep it Tomcat specific.

Thanks!

@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Aug 10, 2016
@philwebb philwebb modified the milestones: 1.5.0, 1.5.0 M1 Aug 30, 2016
@snicoll snicoll modified the milestones: 1.5.0, 1.5.0 M1 Aug 31, 2016
@snicoll snicoll self-assigned this Oct 10, 2016
@snicoll snicoll mentioned this pull request Oct 10, 2016
snicoll added a commit that referenced this pull request Oct 10, 2016
* pr/6571:
  Polish contribution
  Manage Tomcat queued connections
@snicoll snicoll closed this in ab2a257 Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants