Showing results for 
Search instead for 
Did you mean: 


New Contributor


My current architecture uses 2  apache servers that are running mod_jk to load balance to (2) JBoss application servers. Can I replace my mod_jk servers with a Stingray to handle the traffic to the application servers? Is the stingray smart enough to detect if jboss crashes?

Frequent Contributor

Re: mod_jk

Hi oborrero,

You can use Stingray to load-balance the AJP protocol that mod_jk uses to communicate with JBoss, and Stingray will detect a range of JBoss failures (e.g. connection reset, connection timeout).  When Stingray detects a failure, it will terminate the server-side and client-side connections cleanly.

You can't use Stingray to 'translate' from HTTP on the client-side to AJP on the JBoss side.  If your clients are using HTTP, then you can use the HTTP connector on JBoss (JBoss Web - Connectors How To), and use Stingray to split the traffic: requests for static content can be forwarded to a local Apache/nginx/webserver cluster, and requests for the JBoss-hosted applications can be routed to the HTTP connector on your JBoss cluster.  In this case, you can apply all of Stingray's HTTP optimizations - protocol optimizations (e.g. HTTP Keepalive reuse), compression, caching, session persistence, traffic inspection and modification - to both the Apache (static) and JBoss (application) traffic



New Contributor

Re: mod_jk

Hi Owen,

Thanks for the reply and I now have a much clearer understanding of how this works. Instead of pointing mod_jk to the backend application servers, I can point them to a virtual server on the stingray that has the 2 JBoss application servers in a pool? The only time I wouldn't do this is if I'm using JBOSS clustering correct?

Please let me know if I'm accurate with the traffic flow below:

1. Client requests some dynamic content from my site

2. Stingray receives the request and then uses round-robin to distribute to the Apache servers for static content

3. Some type of dynamic request is made so mod_jk is pointing to a virtual server on the stingray that contains the 2 application server; stingray will then load balance to these 2 application servers

Does any of this change if I decide to swap to mod_cluster?

Frequent Contributor

Re: mod_jk

That sounds like it should work fine.  A couple of things to consider:

  • mod_jk has a load-balancing capability (docs) that might mean that it's not necessary to send your AJP connections through the Stingray to be load-balanced
  • You are planning a lot of hops for the requests for dynamic data - client-(HTTP)-stingray-(HTTP)-apache/mod_jk-(AJP)-stingray-(AJP)-JBoss.  You could simplify things considerably if you used the HTTP connector in JBoss as follows: client-(HTTP)-stingray-(HTTP)-JBoss

If you use mod_cluster, you should use its load-balancing methods and allow it to communicate directly with JBoss.  mod_cluster expects callbacks from the JBoss servers to adapt its load balancing rules, and if you put Stingray in between, these callbacks probably will not operate as expected.