-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

André,

On 3/20/13 2:25 PM, André Warnier wrote:
> Saurabh Agrawal wrote:
>> All our assets are served from L3 CDN. So the asset requests
>> never come to the application server.
> 
> That, I do not understand. I do not understand what you mean by
> "assets" here, and I do not understand "L3 CDN". So I cannot tell
> of this is relevant or not to the problem.

CDN = Content Delivery Network. I'm not sure what "L3" (probably
"Level 3", a data center operations company) is, but a CDN is
basically a whole bunch of copies of your files geographically
distributed such that requesting a file always gets the bits that are
closest to you. Kind of a cool thing. ;)

The bottom line is that Saurabh expects only dynamic requests to come
to Tomcat, so keepalives should be much less useful than if Tomcat
were to be serving everything. Imagine httpd out front serving all
static content and forwarding dynamic stuff to Tomcat via AJP --
that's almost exactly what's going on here, except that the static
stuff is being served very efficiently from a network-topology
perspective.

Since AJP is in use, keepalive is almost entirely a red herring as
typical AJP connections are permanently-connected to the web server.

> So, by default, the keepAliveTimeout [for AJP] is set to
> "infinite".
> 
> [snip]
> 
> And if the client keeps the connection open, but does not send any 
> additional request on that connection, the Thread will wait 
> theoretically forever (because that is what the documentation says
> about the default value of these parameters).

No, the defaults are different for non-AJP connections. Tomcat's
default default is 60 seconds but the stock server.xml configures it
to 20 seconds.

> Now your case is a bit different, because - you are not using the
> HTTP BIO connector (you use AJP)

I think you've gotten yourself confused, here, unfortunately. You can
use AJP with BIO, NIO, or APR (maybe you mixed-up AJP and APR between
your eyes and your brain... the two are honestly too close to each
other and it is very easy to do that).

He is in fact using the BIO connector because he has specified
protocol="org.apache.coyote.ajp.AjpProtocol".

> - in front of your Tomcat, is an Apache httpd server.  This server
> has its own keep-alive settings which apply to the connection of
> the client with Apache httpd.  And these keep-alive settings are a
> bit different from the Tomcat ones (for example, there is a
> keep-alive timeout, but also a MaxKeepAliveRequests)

+1

> - between Apache httpd and Tomcat, there is the mod_jk module in
> Apache, and that module uses its own timeouts (as set in
> workers.properties), and in addition it uses itself a pool of
> connections to Tomcat, and this pool of connections has its own
> rules for keeping alive a connection between Apache and Tomcat.
> 
> But the basic principles above apply, and may explain why you are
> seeing what appears to be one Thread dedicated to one client,
> forever.

I think there might be a problem with the instrumentation, or just
coincidences at a fairly implausible level. The trust of the matter is
that Tomcat does not allocate a thread permanently to a remote client
until ... whenever the client "disconnects" (whatever that means, as
HTTP is a connection-less protocol).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRSlo8AAoJEBzwKT+lPKRYodAP/Rz73chvzhyYPNWpePlvPaBm
x7bFxFCNg7hbHV7X1skgfG4CYbR9AsjFqcgkXovVSBcIZjKoNT/yCqwL20SMdNIo
glkx1Gz6gBfM8Ad68VL4xr7nGtwC1WraN2tCszc8dNrBJOjmQwp5tX09OWtpsxqe
DNQVfhGk8wtHmPWjXgK8Kr0lZDjfz540bp4OSAwohjixsCTr3C1PqVEiiZyYWazC
B/5tEkeJ7YtPQJqmJhgx1uR+CmU3ty5iQpLmr4K9uKTLSTjs3HGFV0nkCKQIXmQs
vzjt0eWr8VzbbZnY4QBfBIntgjQiDIoK9Mi+Q3uilYbjCJuFw4jJGICAjaZjlYxW
eW29Ag/WGthB6shOwStiLS+/KUenzXY9aNzHQ1sCeB9Pdsy2eI+Yg15TomwcfxcV
2LjtHZO13QQeGcHpr5vBId8x/B9x5W1bzs8gzUALPQhdsYqGixohu4Ad4nqmeBI0
VZ02jiEDQqr4zT6oJwDVPpm8FSS2wBZKURIp80iI4B2+bS1VPcKzY/J/aKCQRQCw
KP4VDtNiAOXD4a+8sHuZrOh8Q/splNnbhf2G687PryjfxQuk+HQPY/XfFvY1CXzD
ZZD1yVjkSaRfXDmDCfFxfD+a3lOmGhAa8NNR4dtJJo1w1lhrYXvx1ujdS5V3FgO5
xdKlzkg4u30lRrAQq6IO
=yLs6
-----END PGP SIGNATURE-----

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

Reply via email to