How to limit number of concurrent requests for httpd and JBoss and to show error page if it exceeds.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Issue
-
Does EWS or
mod_cluster(ormod_jk) provide any request throttling function, for example, only 100 concurrent user should be able to connect to jboss EAP, Is there any settings which can be done at EWS or by configuringmod_cluster(ormod_jk), if requests reached to the threshold, it should redirect the user to another url page? -
How to change the maximum number of http request that can be served by JBoss server?
- Is there a way how to limit HTTP sessions in JBoss EAP 6.2 so the number of HTTP sessions will match the max-pool-size of Datasource?
- How to implement it within JBoss EAP 6.2?
Resolution
- To configure the max number of concurrent requests that JBoss can process, configure the
max-connectionsattribute on the connector using CLI as follows:
[standalone@localhost:9999 /] /subsystem=web/connector=http:write-attribute(name=max-connections,value=100)
{
"outcome" => "success",
"response-headers" => {
"operation-requires-reload" => true,
"process-state" => "reload-required"
}
}
Here user can change this value "100" as per your requirement.
-
If too many connections come in, a 503 error will be returned.
-
Users can configure
httpdto show a custom error page for this using theErrorDocumentdirective as at custom-error.html. For example:
ErrorDocument 503 /too-many-users.html
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
