You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mohit Anchlia <mo...@gmail.com> on 2010/06/04 01:30:11 UTC

fail_on_status question

In our present environment we have a WS and APP server. When request
comes in, WS sends it to APP server using mod_jk and then APP server
inserts it into JMS queue. So essentially APP server is also dependent
on JMS server which runs on the same box.

My question is can I use fail_on_status in worker.properties to take
one of the APP servers out of service from mod_jk(WS) by returning
some Http error code as a response to a request when JMS server is
down and a request comes in? Since cping and cpong will still return
success would this mechanism of fail_on_status work?

Are there any other suggestions?

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


Re: fail_on_status question

Posted by Mohit Anchlia <mo...@gmail.com>.
On Sun, Jun 6, 2010 at 6:40 AM, Rainer Jung <ra...@kippdata.de> wrote:
> On 06.06.2010 03:52, Mohit Anchlia wrote:
>>
>> On Sat, Jun 5, 2010 at 2:02 AM, Rainer Jung<ra...@kippdata.de>
>>  wrote:
>>>
>>> On 04.06.2010 01:30, Mohit Anchlia wrote:
>>>>
>>>> In our present environment we have a WS and APP server. When request
>>>> comes in, WS sends it to APP server using mod_jk and then APP server
>>>> inserts it into JMS queue. So essentially APP server is also dependent
>>>> on JMS server which runs on the same box.
>>>>
>>>> My question is can I use fail_on_status in worker.properties to take
>>>> one of the APP servers out of service from mod_jk(WS) by returning
>>>> some Http error code as a response to a request when JMS server is
>>>> down and a request comes in? Since cping and cpong will still return
>>>> success would this mechanism of fail_on_status work?
>>>
>>> fail_on_status will trigger nevertheless. Otherwise it would be useless.
>>
>> I didn't get this piece that fail_on_status will trigger nevertheless?
>> My understanding is that cping and cpong decide if to keep a worker in
>> error state or not. But http response code will be returned only when
>> http request comes in. To cping and cpong server is still up. So even
>> if app server return status same as configured for fail_on_status
>> cping and cpong will still not bring the worker in error state.
>
> cping and cpong themselves don't bring the worker in error state. There are
> several mechanism involved to detect feilure and each of those mechanisms
> can bring worker into error state by itself. Once the worker is in error
> state, it will not be used for 60 seconds and then retried with the next
> request eligible for it. If that requests triggers some error condition
> again, the worker will stay in error state, otherwise it will be back to
> normal.
>
> So if cping/cpong succeed, and later during processing of the same request
> an error occurs, like e.g. triggered by fail_on_status or reply_timeout or
> whatever else is configured, the worker will be put into error state.
>
> If you still doubt it: try it! Writing a simple servlet or JSP returning
> some error status is easy and you can see what's happening.

Thanks. I'll try it
>
> Regards,
>
> Rainer
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: fail_on_status question

Posted by Rainer Jung <ra...@kippdata.de>.
On 06.06.2010 03:52, Mohit Anchlia wrote:
> On Sat, Jun 5, 2010 at 2:02 AM, Rainer Jung<ra...@kippdata.de>  wrote:
>> On 04.06.2010 01:30, Mohit Anchlia wrote:
>>>
>>> In our present environment we have a WS and APP server. When request
>>> comes in, WS sends it to APP server using mod_jk and then APP server
>>> inserts it into JMS queue. So essentially APP server is also dependent
>>> on JMS server which runs on the same box.
>>>
>>> My question is can I use fail_on_status in worker.properties to take
>>> one of the APP servers out of service from mod_jk(WS) by returning
>>> some Http error code as a response to a request when JMS server is
>>> down and a request comes in? Since cping and cpong will still return
>>> success would this mechanism of fail_on_status work?
>>
>> fail_on_status will trigger nevertheless. Otherwise it would be useless.
>
> I didn't get this piece that fail_on_status will trigger nevertheless?
> My understanding is that cping and cpong decide if to keep a worker in
> error state or not. But http response code will be returned only when
> http request comes in. To cping and cpong server is still up. So even
> if app server return status same as configured for fail_on_status
> cping and cpong will still not bring the worker in error state.

cping and cpong themselves don't bring the worker in error state. There 
are several mechanism involved to detect feilure and each of those 
mechanisms can bring worker into error state by itself. Once the worker 
is in error state, it will not be used for 60 seconds and then retried 
with the next request eligible for it. If that requests triggers some 
error condition again, the worker will stay in error state, otherwise it 
will be back to normal.

So if cping/cpong succeed, and later during processing of the same 
request an error occurs, like e.g. triggered by fail_on_status or 
reply_timeout or whatever else is configured, the worker will be put 
into error state.

If you still doubt it: try it! Writing a simple servlet or JSP returning 
some error status is easy and you can see what's happening.

Regards,

Rainer


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


Re: fail_on_status question

Posted by Mohit Anchlia <mo...@gmail.com>.
On Sat, Jun 5, 2010 at 2:02 AM, Rainer Jung <ra...@kippdata.de> wrote:
> On 04.06.2010 01:30, Mohit Anchlia wrote:
>>
>> In our present environment we have a WS and APP server. When request
>> comes in, WS sends it to APP server using mod_jk and then APP server
>> inserts it into JMS queue. So essentially APP server is also dependent
>> on JMS server which runs on the same box.
>>
>> My question is can I use fail_on_status in worker.properties to take
>> one of the APP servers out of service from mod_jk(WS) by returning
>> some Http error code as a response to a request when JMS server is
>> down and a request comes in? Since cping and cpong will still return
>> success would this mechanism of fail_on_status work?
>
> fail_on_status will trigger nevertheless. Otherwise it would be useless.

I didn't get this piece that fail_on_status will trigger nevertheless?
My understanding is that cping and cpong decide if to keep a worker in
error state or not. But http response code will be returned only when
http request comes in. To cping and cpong server is still up. So even
if app server return status same as configured for fail_on_status
cping and cpong will still not bring the worker in error state.

>
>> Are there any other suggestions?
>
> Do a little scripting, monitor your Appserver and JMS and use the jk-status
> interface to properly disable or stop the appropriate load balancer member.
>
> Rainer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: fail_on_status question

Posted by Rainer Jung <ra...@kippdata.de>.
On 04.06.2010 01:30, Mohit Anchlia wrote:
> In our present environment we have a WS and APP server. When request
> comes in, WS sends it to APP server using mod_jk and then APP server
> inserts it into JMS queue. So essentially APP server is also dependent
> on JMS server which runs on the same box.
>
> My question is can I use fail_on_status in worker.properties to take
> one of the APP servers out of service from mod_jk(WS) by returning
> some Http error code as a response to a request when JMS server is
> down and a request comes in? Since cping and cpong will still return
> success would this mechanism of fail_on_status work?

fail_on_status will trigger nevertheless. Otherwise it would be useless.

> Are there any other suggestions?

Do a little scripting, monitor your Appserver and JMS and use the 
jk-status interface to properly disable or stop the appropriate load 
balancer member.

Rainer

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


Re: fail_on_status question

Posted by Rainer Jung <ra...@kippdata.de>.
On 05.06.2010 00:53, Mohit Anchlia wrote:
> On Thu, Jun 3, 2010 at 4:30 PM, Mohit Anchlia<mo...@gmail.com>  wrote:
>> In our present environment we have a WS and APP server. When request
>> comes in, WS sends it to APP server using mod_jk and then APP server
>> inserts it into JMS queue. So essentially APP server is also dependent
>> on JMS server which runs on the same box.
>>
>> My question is can I use fail_on_status in worker.properties to take
>> one of the APP servers out of service from mod_jk(WS) by returning
>> some Http error code as a response to a request when JMS server is
>> down and a request comes in? Since cping and cpong will still return
>> success would this mechanism of fail_on_status work?
>>
>> Are there any other suggestions?
>>
>
> I would appreciate if somone gave their suggestion on my post above. I
> am going to try fail_on_status with -503 kind of setting and see if
> request is load balanced to a different server.
>
> I am assuming mod_jk will not be able to put worker in error state if
> that worker returned error code specified in fail_on_status because
> cping and cpong will continue to see tomcat up and running. Is this
> assumption correct?

Read about the feature on

http://tomcat.apache.org/connectors-doc/reference/workers.html

Using "-503" will not take the app server out of service because of the 
minus sign. It will only replace the error page, headers and status code 
for the responses with status 503 send by the app server. Not what you want.

Furthermore using 503 as a value for fail_on_status will likely not 
help. It is very unreasonable for your app server to return a 503 status 
itself, if JMS is not available.

Regards,

Rainer

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


Re: fail_on_status question

Posted by Mohit Anchlia <mo...@gmail.com>.
On Thu, Jun 3, 2010 at 4:30 PM, Mohit Anchlia <mo...@gmail.com> wrote:
> In our present environment we have a WS and APP server. When request
> comes in, WS sends it to APP server using mod_jk and then APP server
> inserts it into JMS queue. So essentially APP server is also dependent
> on JMS server which runs on the same box.
>
> My question is can I use fail_on_status in worker.properties to take
> one of the APP servers out of service from mod_jk(WS) by returning
> some Http error code as a response to a request when JMS server is
> down and a request comes in? Since cping and cpong will still return
> success would this mechanism of fail_on_status work?
>
> Are there any other suggestions?
>

I would appreciate if somone gave their suggestion on my post above. I
am going to try fail_on_status with -503 kind of setting and see if
request is load balanced to a different server.

I am assuming mod_jk will not be able to put worker in error state if
that worker returned error code specified in fail_on_status because
cping and cpong will continue to see tomcat up and running. Is this
assumption correct?

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