users@grizzly.java.net

Re: http timeout/keep-alive behind balancer

From: Arens, Marc <marc.arens_at_open-xchange.com>
Date: Fri, 29 Jun 2012 18:43:37 +0200 (CEST)

Hello,



Oleksiy Stashok <oleksiy.stashok_at_oracle.com> hat am 29. Juni 2012 um 12:38
geschrieben:

> Hi Bongjae,
>
> as I understand Mark is more concerned about timeout which occurs during
> request processing (when single request takes too long time to be
> processed), so IMO it's not directly related to HTTP keep-alive timeout.
that's correct.
>
> > I doubt if "option 2)" is possible because I think the ping message from
> > backend would affect original response. Are there any tricks? :)
> Well, synchronization is the only trick I can think about :) So all the
> threads, that want to send data to the same connection have to be
> synchronized (their "send" logic).

I thought about a filter that would wait for a condition in handleWrite() when
the servlet would write to the outputstream just while the keepalive thread was
running (writing a keep alive messages to the connection towards apache and
clients) but that might just mess up the clients. I just configured another
proxy container in apache with a drastically different timeout for the single
url we are interested in.
>
> > Separately, I would like to share a tip about using Apache + AJP13.
> >
> > When Grizzly or any backend container closed the AJP connection with idle
> > timeout, you would always see CLOSE_WAIT in Apache.
> >
> > Grizzly's default idle timeout is 30 secs so if you set the idle timeout
> > to be -1 with KeepAlive#setIdletimeoutInSeconds(-1), it would be helpful.
> >
> > Specially, if you shutdown the backend server immediately, you will also
> > see CLOSE_WAITs in Apache.
> > Connections will remain CLOSE_WAIT state until Apache get a chance to
> > reuse invalid connections and close them.
> >
> > To resolve the problem, I didn't used mod_proxys but mod_jk with interval
> > ping mode. (mod_proxys don't have interval ping mode yet)

Thanks for the explanation but we are currently using our own ajp implementation
and want to migrate away from it.

> IMO Grizzly is not an issue here, by setting request-timeout to -1 we
> disable close logic for active connections, so the only side, that may
> want to close "idle" connection is Apache. And the question is how to
> make Apache think this connection is still active.

Best regards
--
Marc Arens
Backend Development
Open-Xchange AG
Phone: +49 2761 8385-0, Fax: +49 2761 838530
-------------------------------------------------------------------------------
Open-Xchange AG, Rollnerstr. 14, 90408 Nürnberg, Amtsgericht Nürnberg HRB 24738
Vorstand: Rafael Laguna de la Vera, Carsten Dirks, Aufsichtsratsvorsitzender:
Richard Seibt
European Office: Open-Xchange GmbH, Martinstr. 41, D-57462 Olpe, Germany
Amtsgericht Siegen, HRB 8718, Geschäftsführer: Frank Hoberg, Martin Kauss
US Office: Open-Xchange, Inc., 303 South Broadway, Tarrytown, New York 10591
-------------------------------------------------------------------------------