Skip to content

Tomcat acceptCount #6433

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
peterdnight opened this issue Jul 20, 2016 · 4 comments
Closed

Tomcat acceptCount #6433

peterdnight opened this issue Jul 20, 2016 · 4 comments
Labels
status: duplicate A duplicate of another issue

Comments

@peterdnight
Copy link

Enhancement:
Add additional tomcat parameter: accept-count. This is incredibly useful parameter when implementing throttles to protect resources from heavy activity spikes. It is the best friend of max-threads which is already supported. Otherwise you end up with hundreds of sockets sitting in blocked state, rather then sending a 503 - try again later.

server:
  port: 8080
  tomcat:
    max-threads: 10
    accept-count: notImplemented
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 20, 2016
@cabbonizio
Copy link

+1

@peterdnight
Copy link
Author

I had some time to do more digging through the boot classes - and testing - that the following is required to effectively manage queued connections.

This does work - and is a brute force way of managing resources. eg. Browsers will get a not available message, rest clients will hopefully wait 60s*random and retry.

org.springframework.boot.autoconfigure.web.ServerProperties line 807:
...
                        protocol.setMaxThreads(Tomcat.this.maxThreads);
need to add:

                        protocol.setMaxConnections(Tomcat.this.maxConnections);
                        protocol.setBacklog(Tomcat.this.acceptCount);

@philwebb philwebb added type: enhancement A general enhancement status: ideal-for-contribution An issue that a contributor can help us with and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 25, 2016
@isopov
Copy link
Contributor

isopov commented Jul 29, 2016

To be more general - is there any difference with Jetty's "acceptQueueSize" option? If it is the same - maybe it should be supported with same spring-boot config?

http://wiki.eclipse.org/Jetty/Howto/Configure_Connectors

herau added a commit to herau/spring-boot that referenced this issue Aug 5, 2016
Adding two tomcat server properties:
- server.tomcat.accept-count
- server.tomcat.max-connections

Fixes spring-projectsgh-6433
herau added a commit to herau/spring-boot that referenced this issue Aug 5, 2016
Adding two tomcat server properties:
- server.tomcat.accept-count
- server.tomcat.max-connections

Fixes spring-projectsgh-6433
herau added a commit to herau/spring-boot that referenced this issue Aug 5, 2016
Adding two tomcat server properties:
- server.tomcat.accept-count
- server.tomcat.max-connections

Fixes spring-projectsgh-6433
herau added a commit to herau/spring-boot that referenced this issue Aug 5, 2016
Adding two tomcat server properties:
- server.tomcat.accept-count
- server.tomcat.max-connections

Fixes spring-projectsgh-6433
herau added a commit to herau/spring-boot that referenced this issue Aug 5, 2016
Adding two tomcat server properties:
- server.tomcat.accept-count
- server.tomcat.max-connections

Fixes spring-projectsgh-6433
@philwebb philwebb added this to the 1.5.0 milestone Aug 9, 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 RC1 Aug 31, 2016
@snicoll snicoll removed the status: ideal-for-contribution An issue that a contributor can help us with label Oct 10, 2016
@snicoll snicoll removed this from the 1.5.0 RC1 milestone Oct 10, 2016
@snicoll
Copy link
Member

snicoll commented Oct 10, 2016

duplicates #6571

@snicoll snicoll closed this as completed Oct 10, 2016
@snicoll snicoll added status: duplicate A duplicate of another issue and removed type: enhancement A general enhancement labels Oct 10, 2016
snicoll pushed a commit that referenced this issue Oct 10, 2016
Adding two tomcat server properties:
- server.tomcat.accept-count
- server.tomcat.max-connections

Closes gh-6433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

6 participants