<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Mod Proxy AJP Versus Mod JK &#8211; Round 1</title>
	<atom:link href="http://thoughts.contegix.com/2009/02/02/mod-proxy-ajp-versus-mod-jk-round-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://thoughts.contegix.com/2009/02/02/mod-proxy-ajp-versus-mod-jk-round-1/</link>
	<description>Contegixians Thoughts and News</description>
	<lastBuildDate>Sat, 21 Nov 2009 15:04:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter Daugavietis</title>
		<link>http://thoughts.contegix.com/2009/02/02/mod-proxy-ajp-versus-mod-jk-round-1/comment-page-1/#comment-4137</link>
		<dc:creator>Peter Daugavietis</dc:creator>
		<pubDate>Tue, 02 Jun 2009 13:50:19 +0000</pubDate>
		<guid isPermaLink="false">http://thoughts.contegix.com/?p=27#comment-4137</guid>
		<description>To the first point -- I think most of these are handled by various config options on either the ProxyPass line, or as part of the balancer config (keepalive, timeouts, hotstandbys, etc.) in Apache.  But again -- YMMV.</description>
		<content:encoded><![CDATA[<p>To the first point &#8212; I think most of these are handled by various config options on either the ProxyPass line, or as part of the balancer config (keepalive, timeouts, hotstandbys, etc.) in Apache.  But again &#8212; YMMV.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Booth</title>
		<link>http://thoughts.contegix.com/2009/02/02/mod-proxy-ajp-versus-mod-jk-round-1/comment-page-1/#comment-2236</link>
		<dc:creator>Peter Booth</dc:creator>
		<pubDate>Sat, 07 Mar 2009 03:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://thoughts.contegix.com/?p=27#comment-2236</guid>
		<description>Sorry for the length of this! Perhaps if you posted your Apache and Tomcat config files it would be easier to compare them?

I suspect that a  non-obvious architecture that will offer better throughput than the usual is to use nginx for static content and straight Tomcat for the dynamic. Obviously this has drawbacks too.</description>
		<content:encoded><![CDATA[<p>Sorry for the length of this! Perhaps if you posted your Apache and Tomcat config files it would be easier to compare them?</p>
<p>I suspect that a  non-obvious architecture that will offer better throughput than the usual is to use nginx for static content and straight Tomcat for the dynamic. Obviously this has drawbacks too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Booth</title>
		<link>http://thoughts.contegix.com/2009/02/02/mod-proxy-ajp-versus-mod-jk-round-1/comment-page-1/#comment-2235</link>
		<dc:creator>Peter Booth</dc:creator>
		<pubDate>Sat, 07 Mar 2009 03:07:32 +0000</pubDate>
		<guid isPermaLink="false">http://thoughts.contegix.com/?p=27#comment-2235</guid>
		<description>Mark,

Its possible that today mod_proxy performs better than mod_jk. It could also be mis-configuration issue - mod_jk documentation is fragmented and unclear. 


mod_jk and mod_proxy really are quite different animals

mod_proxy is straightforward easy to understand and well documented.
mod_jk is substantially harder to grok because the documentation is quite fragmented.
mod_jk has substantial advantages over mod_proxy for complex installations or for applications that with high reliability requirements PROVIDED you are willing to learn the sparsely documented configuration syntax. If you don&#039;t tune the dozen or more settings to match your application then its unlikely that a vanilla configuration will work in all situations. I suspect that less than 10% of installs are actually making effective use of mod_jk.

The big advantage of mod_jk is with reliability. 

FOR MANY/MOST PEOPLE mod_proxy is the better choice

13 Scenarios where mod_jk is stronger than mod_proxy:

1. imagine that you have a pool of 4 TomCat instances that you are load balancing over. Now if one of these JVMs hangs with, say, an application deadlock thenm you really don&#039;t want it to receive requests. With mod_jk the worker corresponding to the hung tomcat will be disabled as soon as a timeout triggers and no requests will be forwarded until it is healthy again. 

2. if a TomCat dies and is restarted automatically by, say, monit then mod_jk will detect that the persistent connection is dead and will recycle connections.

3. If one of your 4 Tomcat is being beaten on by a batch process and as a result has 80% CPU consumed. WIth mod_proxy this instance will be assigned 1/4 of requests and these requests may back up and give user sa bad experience while three other Tomcats have free resources. mod_jk load balance can consider busyness when balancing

4. If you have HA requirements that trump response time then mod_jk can ping the TomCat and be sure it is healthy before forwarding each request

5. If you have a firewall between your Apache and your Tomcat that is configured to terminate &quot;dead&quot; connections mod_jk can make use of TCP keepalive 

6. If your Tomcat receives a request and hangs, what do you want the user to see? mod_jk allows you to define a timeout and return an error to the user quickly rather than make the user wait 90 seconds or more.

7. If mod_jk doesn&#039;t get a response on a socket it might be the Tomcat thread bound to the connector socket. You can configure mod_jk to grab another connection and retry the request 

8. If a JSP is being recompiled or a class being deployed live then its possible for tomcat to return a 404 when issued a valid response at the &quot;wrong&quot; time. mod_jk can avoid marking the tomcat as bad.

9. If the application is one that has occasional administrative queries that are very slow then mod_jk can be told to ignore a small number of slow requests without marking the tomcat bad

10. An admin console can used to mark a worker as disabled or stopped so that no requests or no new sessions are directed to that instance. Useful for rolling restarts to mitigate memory leaks, similarly if you know that your app has a memory leak that will cause it to fail after 3 days, and if the app takes ten minutes to startup then mod_jk can be configured to give a new Tomcat N minutes before trying to forward real request.

11. If you have an uber-cluster of 40 Tomcats then you can partition them so that session replacement isn&#039;t a 40 way replication 

12. hot standby tomcats can be preinstalled and will be preferentially chosen by mod_jk when a tomcat fails

13. If you have a commercial product than can only run on one tomcat host then you might want all requests of teh form /expensivegraph/plot to be directed to Tomcat 1 an dall other requests to be balanced across the pool. mod_jk supports this.</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>Its possible that today mod_proxy performs better than mod_jk. It could also be mis-configuration issue &#8211; mod_jk documentation is fragmented and unclear. </p>
<p>mod_jk and mod_proxy really are quite different animals</p>
<p>mod_proxy is straightforward easy to understand and well documented.<br />
mod_jk is substantially harder to grok because the documentation is quite fragmented.<br />
mod_jk has substantial advantages over mod_proxy for complex installations or for applications that with high reliability requirements PROVIDED you are willing to learn the sparsely documented configuration syntax. If you don&#8217;t tune the dozen or more settings to match your application then its unlikely that a vanilla configuration will work in all situations. I suspect that less than 10% of installs are actually making effective use of mod_jk.</p>
<p>The big advantage of mod_jk is with reliability. </p>
<p>FOR MANY/MOST PEOPLE mod_proxy is the better choice</p>
<p>13 Scenarios where mod_jk is stronger than mod_proxy:</p>
<p>1. imagine that you have a pool of 4 TomCat instances that you are load balancing over. Now if one of these JVMs hangs with, say, an application deadlock thenm you really don&#8217;t want it to receive requests. With mod_jk the worker corresponding to the hung tomcat will be disabled as soon as a timeout triggers and no requests will be forwarded until it is healthy again. </p>
<p>2. if a TomCat dies and is restarted automatically by, say, monit then mod_jk will detect that the persistent connection is dead and will recycle connections.</p>
<p>3. If one of your 4 Tomcat is being beaten on by a batch process and as a result has 80% CPU consumed. WIth mod_proxy this instance will be assigned 1/4 of requests and these requests may back up and give user sa bad experience while three other Tomcats have free resources. mod_jk load balance can consider busyness when balancing</p>
<p>4. If you have HA requirements that trump response time then mod_jk can ping the TomCat and be sure it is healthy before forwarding each request</p>
<p>5. If you have a firewall between your Apache and your Tomcat that is configured to terminate &#8220;dead&#8221; connections mod_jk can make use of TCP keepalive </p>
<p>6. If your Tomcat receives a request and hangs, what do you want the user to see? mod_jk allows you to define a timeout and return an error to the user quickly rather than make the user wait 90 seconds or more.</p>
<p>7. If mod_jk doesn&#8217;t get a response on a socket it might be the Tomcat thread bound to the connector socket. You can configure mod_jk to grab another connection and retry the request </p>
<p>8. If a JSP is being recompiled or a class being deployed live then its possible for tomcat to return a 404 when issued a valid response at the &#8220;wrong&#8221; time. mod_jk can avoid marking the tomcat as bad.</p>
<p>9. If the application is one that has occasional administrative queries that are very slow then mod_jk can be told to ignore a small number of slow requests without marking the tomcat bad</p>
<p>10. An admin console can used to mark a worker as disabled or stopped so that no requests or no new sessions are directed to that instance. Useful for rolling restarts to mitigate memory leaks, similarly if you know that your app has a memory leak that will cause it to fail after 3 days, and if the app takes ten minutes to startup then mod_jk can be configured to give a new Tomcat N minutes before trying to forward real request.</p>
<p>11. If you have an uber-cluster of 40 Tomcats then you can partition them so that session replacement isn&#8217;t a 40 way replication </p>
<p>12. hot standby tomcats can be preinstalled and will be preferentially chosen by mod_jk when a tomcat fails</p>
<p>13. If you have a commercial product than can only run on one tomcat host then you might want all requests of teh form /expensivegraph/plot to be directed to Tomcat 1 an dall other requests to be balanced across the pool. mod_jk supports this.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
