Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Resin

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2012, 11:13 AM
jalberto jalberto is offline
Junior Member
 
Join Date: Mar 2012
Location: London, UK
Posts: 24
Default mod_caucho vs. resin load-balancer

Reposting:

Hi, on our platform, we are use Apache as a front-end and we are using mod_caucho to connect to the resin cluster. We are seen an estrange behaviour where one of the resin nodes tends to receive the majority of the load while the others are virtually unused.

We also notice that when one of the resin nodes goes down, is not responding or gets restarted by the watchdog, mod_caucho continues sending traffic to it, instead of using the other nodes.

Is mod_caucho as good at load-balance as the resin load-balancer? Would be better of by proxying to a resin load-balancer node instead of using mod_caucho?

Bare in mind, that for other business reasons we cannot remove the use of Apache as a front-end.

Any thoughts?

Jose Alberto
Reply With Quote
  #2  
Old 04-23-2012, 08:54 PM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

Hi Jose,

In your apache configuration, are you using CauchoHost or ResinConfigServer?

You should use ResinConfigServer for automatic clustered configuration.

Also, what does your /caucho-status page display? It should display a status of every server in your cluster.

Using Resin for load-balancing is a better choice. It runs faster than apache and reduces the number of components in your system.

Thanks,
Alex
Reply With Quote
  #3  
Old 04-24-2012, 12:44 PM
jalberto jalberto is offline
Junior Member
 
Join Date: Mar 2012
Location: London, UK
Posts: 24
Default

We are configuring apache using:
ResinConfigServer <IP-serverA> 6800
ResinConfigServer <IP-serverB> 6800

CauchoConfigCacheDirectory /tmp
CauchoStatus yes
We are able to see our three cluster members (A,B,C), however what we are experiencing is that when one of the resin nodes goes on high load, the whole cluster Apaches included come to a halt (Apaches run out of client threads). At the same time other resin nodes in the cluster are in essence idle loads below 0.1%.

For business reasons we need to use Apache as not all our content comes from the servlet engine and we need to be able to update such content without requiring releasing of a new WAR.

Before, on resin3 we were using the resin LoadBalancer and connecting from Apache by mod_proxy. For Resin4 we are trying using mod_caucho instead.

The question is which one of these approaches: mod_proxy->LoadBalancer or mod_caucho is best to keep a good load_balance on the resin side. Are mod_caucho and the resin LoadBalancer equivalent or is it one better integrated than the other?

Jose Alberto
Reply With Quote
  #4  
Old 04-24-2012, 06:20 PM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

Thanks, we will need to check this one .

Can you post your resin.xml file or send the zipped conf directory to
alex ýt caucho dýt com

Please also take a snapshot of /caucho-status and send that in as well.

thanks,
Alex
Reply With Quote
  #5  
Old 04-26-2012, 11:28 AM
jalberto jalberto is offline
Junior Member
 
Join Date: Mar 2012
Location: London, UK
Posts: 24
Default

Alex, I have sent the info you requested.
Reply With Quote
  #6  
Old 04-26-2012, 04:15 PM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

Can you double check the file you sent. I am seeing links for resin.xml resin.properties naan.properties and so on.

Please also include your httpd.conf.

Thanks,
Alex
Reply With Quote
  #7  
Old 04-27-2012, 10:27 PM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

I'd try increasing the MaxClient to 256 * 3 + n. It looks like one of the servers eventually ties up all apache clients so other servers get no load because there are no available apache clients.
Reply With Quote
  #8  
Old 04-30-2012, 10:31 AM
jalberto jalberto is offline
Junior Member
 
Join Date: Mar 2012
Location: London, UK
Posts: 24
Default

Hi Alex,

What is "N" in the formula above? We have 2 Apache servers under load balance at the moment.

Can you explain what mod_caucho's load_balancing strategy is? From your comment it seems that it tries to load the server until some threshold before assigning load to the next. Is that what it does? Or does it try to distribute the load more evenly? Is there any way to influence how it works?

I understand the server uses sticky sessions. But what happens when a server comes with an expired session? Does the load-balancer will be allowed to direct the load to a different node or will the new session be created on the same node as the expired one.

Thanks in advance,

Jose Alberto
Reply With Quote
  #9  
Old 04-30-2012, 05:30 PM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

N – is extra connections that apache might need to service requests to resources not backed by Resin after all Resin's clients become used up / bound to Resin. Since each of your apache servers can send requests to 3 Resin servers (each capable of handling 256 simultaneous requests) the number of clients for apache should be 256 * 3.

The algorithm chooses server with the least number of connections. In my tests with 1 apache and 3 Resin servers each Resin gets to serve ~33.3% of requests. (simple jsp page, each requests starts a new session).

Since apache doesn't know if session is expired it will always choose server matching session id.
Reply With Quote
  #10  
Old 05-23-2012, 12:17 PM
jalberto jalberto is offline
Junior Member
 
Join Date: Mar 2012
Location: London, UK
Posts: 24
Default

Alex mentioned:

"Since apache doesn't know if session is expired it will always choose server matching session id."

Does the java LoadBalancer has better information about what as happened with the sessions? I.e. would it be able to reassign machine when someone comes with an expired session?
Reply With Quote
Reply

Tags
load balance, resin 4.0

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:50 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.