On Aug 13, 2013, at 9:33 AM, "Smith, Mitchell" <mitchell.sm...@cwc.com> wrote:

> On 13 August 2013 13:24, Daniel Mikusa <dmik...@gopivotal.com> wrote:
> 
>> On Aug 13, 2013, at 6:43 AM, "Smith, Mitchell" <mitchell.sm...@cwc.com>
>> wrote:
>> 
>>> Hi,
>>> 
>> 
>> What version of Tomcat are you using?  6.0.x or 7.0.x?
>> 
> Tomcat7

Please include the complete version number.  There are 42 different Tomcat 7 
releases.  The more specific you can be the better response you'll get from the 
list.

> 
>> 
>>> I was looking at using the maxActiveConnections in the application
>> context,
>> 
>> Please include the relevant configuration from your server.xml or
>> context.xml file.
>> 
> Context.xml
> 
>> <Context>
>> 
>>    <!-- Default set of monitored resources -->
>> 
>>    <WatchedResource>WEB-INF/web.xml</WatchedResource>
>> 
>>    <!-- Uncomment this to disable session persistence across Tomcat
>> restarts -->
>> 
>>    <Manager pathname=""
>>     *maxActiveConnections="150"

Are you referring to "maxActiveSessions"?

   https://tomcat.apache.org/tomcat-7.0-doc/config/manager.html

>> */>
>>    <!-- Uncomment this to enable Comet connection tacking (provides events
>>         on session expiration as well as webapp lifecycle) -->
>>    <!--
>>    <Valve
>> className="org.apache.catalina.valves.CometConnectionManagerValve" />
>>    -->
>> </Context>
>> 
>> 
>>> what I find is. When I reach the limit, as expected the server will not
>>> create a new session, however does return a http 200 status code.
>>> 
>>> I am wondering would it be possible for me to change this behavior to
>>> return say a 300 range code to redirect to (in a production environment)
>>> load balancer.
>>> 
>>> I can see some potential issues with this, like the possibility of an
>>> infinite loop, but for now I am just exploring possible ways to prevent
>> my
>>> tomcat servers becoming overloaded.
>> 
>> How do you have your load balancer setup now?  What software / hardware
>> are you using?  What algorithm is it using to distribute the load?
>> 
> Its an apache httpd server, distributing load using byRequest, with a
> redundant fail-over node configured howevr this only works if the tomcat
> server fails to accept the initial connection
> 
>> 
>>> 
>>> Does anyone have any thoughts or ideas for this type of solution?
>> 
>> Perhaps you need to adjust the load balancer so it's spreading out the
>> connections more evenly?  Perhaps you need to add another node to handle
>> the load?
>> 
>> Its a recent issue, typical user response to a slow application (for
> whatever reason) is to open another session, however the jvmRoute is stored
> in the browser which forces the 2nd,3rd,4th.... session to the same host.
> 
> We are looking at a application solution to provide a new session without
> the jvmRoute in separate tabs, but the ability to reject and redirect a
> user (even to a error page) when the server limit we set is reached would
> prevent a larger scale outage.

You might try "maxConnections" on the HTTP connector.

   https://tomcat.apache.org/tomcat-7.0-doc/config/http.html

or the AJP connector, depending on how your proxy is connecting to Tomcat.

   https://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html

"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 not accept 
any more connections until the number of connections falls below this value."

Note this is different than the configuration you specified above, which 
appears like it's trying to restrict the number of sessions that the manager 
will create.

Dan



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to