RE: JK2: lb_factor
Hi Nicole Micheal, Thanks for your comments on this issue. lb_factor works fine although a bit strange :D The reason why my loadbalancing did not seem to work is I have tested with small number of users. When I increased number of users and each user with just one http call, I could see properly the way it load balances, which is fine. Thanks for mentioning your quotient calculations. that's helpful. I have notice one more thing. When you specify lb_factor level same for all of your clusters and test with small number of concurrent users, most of the requests go to your local clusters. But if you increase number of concurrent users to a large extent, then it load balances perfectly. Cheers Bhaskar -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 4:52 PM To: Tomcat Users List Subject: RE: JK2: lb_factor Hello Bhaskar (and everyone else who might be interested), I've got good news: finally, loadbalancing with JK2 works great. :-) (And, best of it all: no recompiling of Apache was necessary! *g*) The reason why loadbalancing did not work as it should: I used a test-tool (in fact, Microsofts Web Application Stress Tool) to generate a certain amount of load (by simulating a certain number of clients requests). The tool has a pool of users, each with an own session - however, I had more sequences of requests than users, which means that some users (with existing sessions) were re-used for the next requests. By default, stickySessions in jk2 are enabled, so if the requests belonged to a formerly used session, they were - of course - not balanced as I expected... 2 possibilities, each working perfectly well (depending on what you want to do): - increase number of users in the test tool (that's what worked for me - maybe your problem is similar?) - disable sticky sessions in your workers2.properties: [lb:lb] stickySession=JK_FALSE Than every request - no matter if it belongs to an existing or a new session - is balanced to another server, depending on the lb_factor. And yes, the lb_factor works fine, too, although a little bit strange ;-) : lb_factor is the proportion of all requests divided by number of request for that instance. e.g.: You expect 10,000 requests totally, want them to be distributed to the tomcat instances as follows: Tomcat: TC01TC02TC03 Requests: 250025005000 quotient: 4 4 2 (e.g. 1/2500) lb_factor: 2 2 1 (could also be 4, 4 and 2, but should be as small as possible) I tried something similar with mod_jk 1.2, which works as it is supposed to do, too. So - what have you set your stickySessions to, how do you generate your requests, and where do you see which server handles them? Maybe we can finally find out where your problem is, now we know that it *does* work... ;-) Greets, Nicole -Ursprüngliche Nachricht- Von: Michael Echerer [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 18. Juni 2004 22:25 An: Tomcat Users List Betreff: Re: JK2: lb_factor Kommuru, Bhaskar wrote: Thanks for you comments Michael, So mod_jk2.0.4 does not still seem to be a production quality software. It doesnot work the way it is supposed to work as the documentation. I have spent already a lot of time on this. Actually the 10 Tomcat scenario I mentioned was with mod_jk1.x.y and Apache 2.0.46 (also prefork). I did it merely to verify a new mod_jk2 setup vs. an existing one. Finally I found out that the old setup with mod_jk1 didn't work either. ;-) Why did I start digging... I just want to confirm one thing here that it works and no matter what your settings are :--( By the way... The issue with remote and local workers, can be solved. You have to set the level attribute for each channel in your workers2.properties: take for local workers: level=0 for remote workers: level=1 Usually you will set this for all your channels vice versa on e.g. two Apache machines (each with e.g. 2 local Tomcats and 2 remote Tomcats). In front of the 2 Apaches you could have a hardware lb. The effect is that (each) Apache will only serve its local workers according to its workers2.properties until (here: both!) all local Tomcats are offline. So in this respect to mod_jk2 docu is quite okay. At least this part of the config works for me. I did't that any lb_factor for the channels, only level to achieve this local/remote distribution. If you don't like this you have to set the level equally for all your Tomcat channels. Guess the local/remote levels are mainly to save some bandwith. Michael P.S. Until now I still think, that the best approach would be to try the MPM worker, instead prefork and check whether this has really a positve effect. Any volunteers for compiling Apache 2.x --with-mpm=worker and trying this? If you know any links which tells more details
RE: JK2: lb_factor
Hello Bhaskar (and everyone else who might be interested), I've got good news: finally, loadbalancing with JK2 works great. :-) (And, best of it all: no recompiling of Apache was necessary! *g*) The reason why loadbalancing did not work as it should: I used a test-tool (in fact, Microsofts Web Application Stress Tool) to generate a certain amount of load (by simulating a certain number of clients requests). The tool has a pool of users, each with an own session - however, I had more sequences of requests than users, which means that some users (with existing sessions) were re-used for the next requests. By default, stickySessions in jk2 are enabled, so if the requests belonged to a formerly used session, they were - of course - not balanced as I expected... 2 possibilities, each working perfectly well (depending on what you want to do): - increase number of users in the test tool (that's what worked for me - maybe your problem is similar?) - disable sticky sessions in your workers2.properties: [lb:lb] stickySession=JK_FALSE Than every request - no matter if it belongs to an existing or a new session - is balanced to another server, depending on the lb_factor. And yes, the lb_factor works fine, too, although a little bit strange ;-) : lb_factor is the proportion of all requests divided by number of request for that instance. e.g.: You expect 10,000 requests totally, want them to be distributed to the tomcat instances as follows: Tomcat: TC01TC02TC03 Requests: 250025005000 quotient: 4 4 2 (e.g. 1/2500) lb_factor: 2 2 1 (could also be 4, 4 and 2, but should be as small as possible) I tried something similar with mod_jk 1.2, which works as it is supposed to do, too. So - what have you set your stickySessions to, how do you generate your requests, and where do you see which server handles them? Maybe we can finally find out where your problem is, now we know that it *does* work... ;-) Greets, Nicole -Ursprüngliche Nachricht- Von: Michael Echerer [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 18. Juni 2004 22:25 An: Tomcat Users List Betreff: Re: JK2: lb_factor Kommuru, Bhaskar wrote: Thanks for you comments Michael, So mod_jk2.0.4 does not still seem to be a production quality software. It doesnot work the way it is supposed to work as the documentation. I have spent already a lot of time on this. Actually the 10 Tomcat scenario I mentioned was with mod_jk1.x.y and Apache 2.0.46 (also prefork). I did it merely to verify a new mod_jk2 setup vs. an existing one. Finally I found out that the old setup with mod_jk1 didn't work either. ;-) Why did I start digging... I just want to confirm one thing here that it works and no matter what your settings are :--( By the way... The issue with remote and local workers, can be solved. You have to set the level attribute for each channel in your workers2.properties: take for local workers: level=0 for remote workers: level=1 Usually you will set this for all your channels vice versa on e.g. two Apache machines (each with e.g. 2 local Tomcats and 2 remote Tomcats). In front of the 2 Apaches you could have a hardware lb. The effect is that (each) Apache will only serve its local workers according to its workers2.properties until (here: both!) all local Tomcats are offline. So in this respect to mod_jk2 docu is quite okay. At least this part of the config works for me. I did't that any lb_factor for the channels, only level to achieve this local/remote distribution. If you don't like this you have to set the level equally for all your Tomcat channels. Guess the local/remote levels are mainly to save some bandwith. Michael P.S. Until now I still think, that the best approach would be to try the MPM worker, instead prefork and check whether this has really a positve effect. Any volunteers for compiling Apache 2.x --with-mpm=worker and trying this? If you know any links which tells more details on this, Please let me know. Regards, Bhaskar -Original Message- From: Michael Echerer [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 9:08 PM To: Tomcat Users List Subject: Re: JK2: lb_factor I measured similar effects using The Grinder. Under maximum load with long running requests it can be even that worse that one Apache 2.x (default compile: prefork) with 2 Tomcats 5.x/mod_jk2 only distributes to the first Tomcat at all. This is true as long as Apache runs out of MaxClients because of the concurrent requests. Then, for some reason, Apache starts to distribute also some load to the second Apache. So it might help if you lower MaxClients (this seems the only thing that has an direct effect, not lb_factor, not ajp13 threads or anything else) to force this earlier, but be aware that this might produce
RE: JK2: lb_factor
Any luck Nicole? It is really frustrating. It works as fail-over without any settings. But as per documentation it should not work without those specific settings. And in case of Loadbalancing, It works on its own, doesnot listen what ever you set... funny. Any ideas! please let me know Regards, Bhasar -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 4:20 PM To: Tomcat Users List Subject: RE: JK2: lb_factor Yes, right, that was the mail I meant. Your assumption about failover instead of load balancing seems to be correct, at least, at my cluster (one local server, on a remote machine another server + VMWare with a third server) it is the same - thanks for that comment, I was to blind to see it myself. ;-) I'll try to find out more tomorrow, maybe we'll get it to work - I'd be very interested in your progresses, however. Do you've got any idea how to realise load balancing with a defined distribution? Or, in other words: as long as it does not work properly with Tomcat mod_jk2, are there any reasons to use those, after all, instead of Tomcat's balancer-webapp, if one is mainly interested in performance issues? -Ursprüngliche Nachricht- Von: Kommuru, Bhaskar [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Juni 2004 16:09 An: 'Tomcat Users List' Betreff: RE: JK2: lb_factor Do you remember that mail about lb_factor? What you said it right about lb_factor. Changing this value does not affect easily. -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 2:39 PM To: Tomcat Users List Subject: AW: JK2: lb_factor Yes, I'm still struggling, too, and have quite similar problems now - I added a third server to the load balanced cluster, but only two of them get requests. I shut down each server in turn, and the load got balanced fine between the remaining two - on starting up the third server again, one always becomes idle (not always the same, above all...). Not talking about the fact that setting lb_factor to whatever value doesn't seem to have much effect on the load distribution... At least, I found out that lb_factor has nothing to do with a factor, indeed - assume that each worker has an initial lb_value, set to it's lb_factor. With every request, a worker is chosen, its lb_value gets increased by its lb_factor, and if it's smaller than lb_value of the other nodes, that worker gets the request. If lb_value is 255, it gets resetted to 0. ^^ Just search archives of Apache User Mailing List, found it there (and hope I understood correctly) - however, the mail was from some months ago, so I really don't know if it still works like this. I'd really like to know if someone has managed to build a cluster of more than 2 Tomcat servers, using Apache + JK2, with working loadbalancing? Just curious... If someone could give a hint why it does such strange things (like ignoring cluster nodes), we'd of course be thankful, too... :) Greets, Nicole -Ursprüngliche Nachricht- Von: Kommuru, Bhaskar [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Juni 2004 14:12 An: 'Tomcat Users List' Betreff: RE: JK2: lb_factor I too have similar problem and have been struggling since morning. My problem is my mod_jk2 doesnt even load balance to remote server. When i shut down local servers, it puts the request to remote server.. no cluesss!! -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: JK2: lb_factor Hello, I've got a cluster with 2 tomcat 2.0.25 on different machines, on one of them also running Apache 2.0.49 with JK2 as a loadbalancer. Requests get redirected to both tomcat instances, but it always ends up with around 1/3 of all requests at the local server and about 2/3 at the remote one, no matter what value the lb_factors are. So, could anyone tell me which values I should use to make the lb_factor work correctly? All information I found was that a lower value means more requests (official JK2-documentation at jakarta.apache.org). = My workers2.properties: [lb:lb] stickySession=1 # First Tomcat Instance (Localhost / 10.32.97.44) [channel.socket:localhost:8009] port=8009 host=127.0.0.1 group=lb lb_factor=1 tomcatId=tomcat01 # Second Tomcat Instance (10.32.97.23) [channel.socket:10.32.97.23:8009] port=8009 host=10.32.97.23 group=lb lb_factor=1 tomcatId=tomcat02 # define the worker for tomcat instance 1 (localhost) [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # define the worker for tomcat instance 2 [ajp13:10.32.97.23:8009] channel=channel.socket:10.32.97.23:8009 #This is the application to test the cluster / load balancing... [uri:/benchmark/*] info=Benchmark application Anything wrong with that? Anything missing? If more information needed, just tell me.. I just guessed
RE: JK2: lb_factor
Thanks for you comments Michael, So mod_jk2.0.4 does not still seem to be a production quality software. It doesnot work the way it is supposed to work as the documentation. I have spent already a lot of time on this. I just want to confirm one thing here that it works and no matter what your settings are :--( If you know any links which tells more details on this, Please let me know. Regards, Bhaskar -Original Message- From: Michael Echerer [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 9:08 PM To: Tomcat Users List Subject: Re: JK2: lb_factor I measured similar effects using The Grinder. Under maximum load with long running requests it can be even that worse that one Apache 2.x (default compile: prefork) with 2 Tomcats 5.x/mod_jk2 only distributes to the first Tomcat at all. This is true as long as Apache runs out of MaxClients because of the concurrent requests. Then, for some reason, Apache starts to distribute also some load to the second Apache. So it might help if you lower MaxClients (this seems the only thing that has an direct effect, not lb_factor, not ajp13 threads or anything else) to force this earlier, but be aware that this might produce errors if you get much more requests that then can't be queued anymore. I suppose Apache prefork and worker communication via shared memory by mod_jk2 don't work well together, or the don't work at all for true round robin. Putting more than 2 Tomcats won't help with high load. I once had 10 Tomcats, but in the end only the first few got most of the load, Tomcat No 7-10 almost nothing. I also heard that Apache MPM may help, but didn't try yet. So either I forget something in my config, I have to use MPM (although nothing is really mentioned about those issues in the docu), or mod_jk2 is really not too good in this area. Last advice: If you have that option to use a hardware router than I'd suggest to use more Apaches with only one Tomcat behind each of them. This will definitely work best as those routers do a true round robin. Ralph Einfeldt wrote: The quality of the distribution depends on the worker type of apache. (AFAIK only the 'worker' MPM will work) Nevertheless AFAIK the load balancing in mod_jk is not complete in this area, so I'm not shure if you will get the desired distribution (but it should be closer). -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: JK2: lb_factor I've got a cluster with 2 tomcat 2.0.25 on different machines, on one of them also running Apache 2.0.49 with JK2 as a loadbalancer. Requests get redirected to both tomcat instances, but it always ends up with around 1/3 of all requests at the local server and about 2/3 at the remote one, no matter what value the lb_factors are. So, could anyone tell me which values I should use to make the lb_factor work correctly? All information I found was that a lower value means more requests (official JK2-documentation at jakarta.apache.org). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dipl.-Inf. (FH) Michael Echerer TNG Technology Consulting GmbH, http://www.tngtech.com Betastr. 13a, 85774 Unterföhring bei München, Tel. +49 89 2158996-0, Fax. +49 89 2158996-9, Mobile +49 176 20088854 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ For information about the Standard Bank group visit our web site www.standardbank.co.za __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Group Limited is proprietary to the group. It is confidential, legally privileged and protected by law. Standard Bank does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of the group. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Standard Bank can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. ___
Re: JK2: lb_factor
Kommuru, Bhaskar wrote: Thanks for you comments Michael, So mod_jk2.0.4 does not still seem to be a production quality software. It doesnot work the way it is supposed to work as the documentation. I have spent already a lot of time on this. Actually the 10 Tomcat scenario I mentioned was with mod_jk1.x.y and Apache 2.0.46 (also prefork). I did it merely to verify a new mod_jk2 setup vs. an existing one. Finally I found out that the old setup with mod_jk1 didn't work either. ;-) Why did I start digging... I just want to confirm one thing here that it works and no matter what your settings are :--( By the way... The issue with remote and local workers, can be solved. You have to set the level attribute for each channel in your workers2.properties: take for local workers: level=0 for remote workers: level=1 Usually you will set this for all your channels vice versa on e.g. two Apache machines (each with e.g. 2 local Tomcats and 2 remote Tomcats). In front of the 2 Apaches you could have a hardware lb. The effect is that (each) Apache will only serve its local workers according to its workers2.properties until (here: both!) all local Tomcats are offline. So in this respect to mod_jk2 docu is quite okay. At least this part of the config works for me. I did't that any lb_factor for the channels, only level to achieve this local/remote distribution. If you don't like this you have to set the level equally for all your Tomcat channels. Guess the local/remote levels are mainly to save some bandwith. Michael P.S. Until now I still think, that the best approach would be to try the MPM worker, instead prefork and check whether this has really a positve effect. Any volunteers for compiling Apache 2.x --with-mpm=worker and trying this? If you know any links which tells more details on this, Please let me know. Regards, Bhaskar -Original Message- From: Michael Echerer [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 9:08 PM To: Tomcat Users List Subject: Re: JK2: lb_factor I measured similar effects using The Grinder. Under maximum load with long running requests it can be even that worse that one Apache 2.x (default compile: prefork) with 2 Tomcats 5.x/mod_jk2 only distributes to the first Tomcat at all. This is true as long as Apache runs out of MaxClients because of the concurrent requests. Then, for some reason, Apache starts to distribute also some load to the second Apache. So it might help if you lower MaxClients (this seems the only thing that has an direct effect, not lb_factor, not ajp13 threads or anything else) to force this earlier, but be aware that this might produce errors if you get much more requests that then can't be queued anymore. I suppose Apache prefork and worker communication via shared memory by mod_jk2 don't work well together, or the don't work at all for true round robin. Putting more than 2 Tomcats won't help with high load. I once had 10 Tomcats, but in the end only the first few got most of the load, Tomcat No 7-10 almost nothing. I also heard that Apache MPM may help, but didn't try yet. So either I forget something in my config, I have to use MPM (although nothing is really mentioned about those issues in the docu), or mod_jk2 is really not too good in this area. Last advice: If you have that option to use a hardware router than I'd suggest to use more Apaches with only one Tomcat behind each of them. This will definitely work best as those routers do a true round robin. Ralph Einfeldt wrote: The quality of the distribution depends on the worker type of apache. (AFAIK only the 'worker' MPM will work) Nevertheless AFAIK the load balancing in mod_jk is not complete in this area, so I'm not shure if you will get the desired distribution (but it should be closer). -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: JK2: lb_factor I've got a cluster with 2 tomcat 2.0.25 on different machines, on one of them also running Apache 2.0.49 with JK2 as a loadbalancer. Requests get redirected to both tomcat instances, but it always ends up with around 1/3 of all requests at the local server and about 2/3 at the remote one, no matter what value the lb_factors are. So, could anyone tell me which values I should use to make the lb_factor work correctly? All information I found was that a lower value means more requests (official JK2-documentation at jakarta.apache.org). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JK2: lb_factor
I too have similar problem and have been struggling since morning. My problem is my mod_jk2 doesnt even load balance to remote server. When i shut down local servers, it puts the request to remote server.. no cluesss!! -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: JK2: lb_factor Hello, I've got a cluster with 2 tomcat 2.0.25 on different machines, on one of them also running Apache 2.0.49 with JK2 as a loadbalancer. Requests get redirected to both tomcat instances, but it always ends up with around 1/3 of all requests at the local server and about 2/3 at the remote one, no matter what value the lb_factors are. So, could anyone tell me which values I should use to make the lb_factor work correctly? All information I found was that a lower value means more requests (official JK2-documentation at jakarta.apache.org). = My workers2.properties: [lb:lb] stickySession=1 # First Tomcat Instance (Localhost / 10.32.97.44) [channel.socket:localhost:8009] port=8009 host=127.0.0.1 group=lb lb_factor=1 tomcatId=tomcat01 # Second Tomcat Instance (10.32.97.23) [channel.socket:10.32.97.23:8009] port=8009 host=10.32.97.23 group=lb lb_factor=1 tomcatId=tomcat02 # define the worker for tomcat instance 1 (localhost) [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # define the worker for tomcat instance 2 [ajp13:10.32.97.23:8009] channel=channel.socket:10.32.97.23:8009 #This is the application to test the cluster / load balancing... [uri:/benchmark/*] info=Benchmark application Anything wrong with that? Anything missing? If more information needed, just tell me.. I just guessed that the workers2.properties is the problem. Greets, Nicole Diese E-Mail enthalt vertrauliche und/oder rechtlich geschutzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtumlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ For information about the Standard Bank group visit our web site www.standardbank.co.za __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Group Limited is proprietary to the group. It is confidential, legally privileged and protected by law. Standard Bank does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of the group. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Standard Bank can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. ___
RE: JK2: lb_factor
In my case, I have 4 tomcats, 2 running locally and other 2 remotely. I have noticed onething here.. Loadbalancer is giving preference only to local servers. If no local server available, then it loadbalances all the remote servers perfectly. So basically, it is forcing us that we can only do FAIL-OVER (not LOAD-BALANCE) between local and remote workers. -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 2:39 PM To: Tomcat Users List Subject: AW: JK2: lb_factor Yes, I'm still struggling, too, and have quite similar problems now - I added a third server to the load balanced cluster, but only two of them get requests. I shut down each server in turn, and the load got balanced fine between the remaining two - on starting up the third server again, one always becomes idle (not always the same, above all...). Not talking about the fact that setting lb_factor to whatever value doesn't seem to have much effect on the load distribution... At least, I found out that lb_factor has nothing to do with a factor, indeed - assume that each worker has an initial lb_value, set to it's lb_factor. With every request, a worker is chosen, its lb_value gets increased by its lb_factor, and if it's smaller than lb_value of the other nodes, that worker gets the request. If lb_value is 255, it gets resetted to 0. ^^ Just search archives of Apache User Mailing List, found it there (and hope I understood correctly) - however, the mail was from some months ago, so I really don't know if it still works like this. I'd really like to know if someone has managed to build a cluster of more than 2 Tomcat servers, using Apache + JK2, with working loadbalancing? Just curious... If someone could give a hint why it does such strange things (like ignoring cluster nodes), we'd of course be thankful, too... :) Greets, Nicole -Ursprüngliche Nachricht- Von: Kommuru, Bhaskar [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Juni 2004 14:12 An: 'Tomcat Users List' Betreff: RE: JK2: lb_factor I too have similar problem and have been struggling since morning. My problem is my mod_jk2 doesnt even load balance to remote server. When i shut down local servers, it puts the request to remote server.. no cluesss!! -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: JK2: lb_factor Hello, I've got a cluster with 2 tomcat 2.0.25 on different machines, on one of them also running Apache 2.0.49 with JK2 as a loadbalancer. Requests get redirected to both tomcat instances, but it always ends up with around 1/3 of all requests at the local server and about 2/3 at the remote one, no matter what value the lb_factors are. So, could anyone tell me which values I should use to make the lb_factor work correctly? All information I found was that a lower value means more requests (official JK2-documentation at jakarta.apache.org). = My workers2.properties: [lb:lb] stickySession=1 # First Tomcat Instance (Localhost / 10.32.97.44) [channel.socket:localhost:8009] port=8009 host=127.0.0.1 group=lb lb_factor=1 tomcatId=tomcat01 # Second Tomcat Instance (10.32.97.23) [channel.socket:10.32.97.23:8009] port=8009 host=10.32.97.23 group=lb lb_factor=1 tomcatId=tomcat02 # define the worker for tomcat instance 1 (localhost) [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # define the worker for tomcat instance 2 [ajp13:10.32.97.23:8009] channel=channel.socket:10.32.97.23:8009 #This is the application to test the cluster / load balancing... [uri:/benchmark/*] info=Benchmark application Anything wrong with that? Anything missing? If more information needed, just tell me.. I just guessed that the workers2.properties is the problem. Greets, Nicole __ For information about the Standard Bank group visit our web site www.standardbank.co.za __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Group Limited is proprietary to the group. It is confidential, legally privileged and protected by law. Standard Bank does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of the group. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Standard Bank can not assure that the integrity of this communication has been maintained nor that it is free of errors
RE: JK2: lb_factor
Do you remember that mail about lb_factor? What you said it right about lb_factor. Changing this value does not affect easily. -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 2:39 PM To: Tomcat Users List Subject: AW: JK2: lb_factor Yes, I'm still struggling, too, and have quite similar problems now - I added a third server to the load balanced cluster, but only two of them get requests. I shut down each server in turn, and the load got balanced fine between the remaining two - on starting up the third server again, one always becomes idle (not always the same, above all...). Not talking about the fact that setting lb_factor to whatever value doesn't seem to have much effect on the load distribution... At least, I found out that lb_factor has nothing to do with a factor, indeed - assume that each worker has an initial lb_value, set to it's lb_factor. With every request, a worker is chosen, its lb_value gets increased by its lb_factor, and if it's smaller than lb_value of the other nodes, that worker gets the request. If lb_value is 255, it gets resetted to 0. ^^ Just search archives of Apache User Mailing List, found it there (and hope I understood correctly) - however, the mail was from some months ago, so I really don't know if it still works like this. I'd really like to know if someone has managed to build a cluster of more than 2 Tomcat servers, using Apache + JK2, with working loadbalancing? Just curious... If someone could give a hint why it does such strange things (like ignoring cluster nodes), we'd of course be thankful, too... :) Greets, Nicole -Ursprüngliche Nachricht- Von: Kommuru, Bhaskar [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Juni 2004 14:12 An: 'Tomcat Users List' Betreff: RE: JK2: lb_factor I too have similar problem and have been struggling since morning. My problem is my mod_jk2 doesnt even load balance to remote server. When i shut down local servers, it puts the request to remote server.. no cluesss!! -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: JK2: lb_factor Hello, I've got a cluster with 2 tomcat 2.0.25 on different machines, on one of them also running Apache 2.0.49 with JK2 as a loadbalancer. Requests get redirected to both tomcat instances, but it always ends up with around 1/3 of all requests at the local server and about 2/3 at the remote one, no matter what value the lb_factors are. So, could anyone tell me which values I should use to make the lb_factor work correctly? All information I found was that a lower value means more requests (official JK2-documentation at jakarta.apache.org). = My workers2.properties: [lb:lb] stickySession=1 # First Tomcat Instance (Localhost / 10.32.97.44) [channel.socket:localhost:8009] port=8009 host=127.0.0.1 group=lb lb_factor=1 tomcatId=tomcat01 # Second Tomcat Instance (10.32.97.23) [channel.socket:10.32.97.23:8009] port=8009 host=10.32.97.23 group=lb lb_factor=1 tomcatId=tomcat02 # define the worker for tomcat instance 1 (localhost) [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # define the worker for tomcat instance 2 [ajp13:10.32.97.23:8009] channel=channel.socket:10.32.97.23:8009 #This is the application to test the cluster / load balancing... [uri:/benchmark/*] info=Benchmark application Anything wrong with that? Anything missing? If more information needed, just tell me.. I just guessed that the workers2.properties is the problem. Greets, Nicole Diese E-Mail enthalt vertrauliche und/oder rechtlich geschutzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtumlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ For information about the Standard Bank group visit our web site www.standardbank.co.za __ Disclaimer and confidentiality note Everything in this e-mail and any
RE: JK2: lb_factor
Yes, right, that was the mail I meant. Your assumption about failover instead of load balancing seems to be correct, at least, at my cluster (one local server, on a remote machine another server + VMWare with a third server) it is the same - thanks for that comment, I was to blind to see it myself. ;-) I'll try to find out more tomorrow, maybe we'll get it to work - I'd be very interested in your progresses, however. Do you've got any idea how to realise load balancing with a defined distribution? Or, in other words: as long as it does not work properly with Tomcat mod_jk2, are there any reasons to use those, after all, instead of Tomcat's balancer-webapp, if one is mainly interested in performance issues? -Ursprüngliche Nachricht- Von: Kommuru, Bhaskar [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Juni 2004 16:09 An: 'Tomcat Users List' Betreff: RE: JK2: lb_factor Do you remember that mail about lb_factor? What you said it right about lb_factor. Changing this value does not affect easily. -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 2:39 PM To: Tomcat Users List Subject: AW: JK2: lb_factor Yes, I'm still struggling, too, and have quite similar problems now - I added a third server to the load balanced cluster, but only two of them get requests. I shut down each server in turn, and the load got balanced fine between the remaining two - on starting up the third server again, one always becomes idle (not always the same, above all...). Not talking about the fact that setting lb_factor to whatever value doesn't seem to have much effect on the load distribution... At least, I found out that lb_factor has nothing to do with a factor, indeed - assume that each worker has an initial lb_value, set to it's lb_factor. With every request, a worker is chosen, its lb_value gets increased by its lb_factor, and if it's smaller than lb_value of the other nodes, that worker gets the request. If lb_value is 255, it gets resetted to 0. ^^ Just search archives of Apache User Mailing List, found it there (and hope I understood correctly) - however, the mail was from some months ago, so I really don't know if it still works like this. I'd really like to know if someone has managed to build a cluster of more than 2 Tomcat servers, using Apache + JK2, with working loadbalancing? Just curious... If someone could give a hint why it does such strange things (like ignoring cluster nodes), we'd of course be thankful, too... :) Greets, Nicole -Ursprüngliche Nachricht- Von: Kommuru, Bhaskar [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Juni 2004 14:12 An: 'Tomcat Users List' Betreff: RE: JK2: lb_factor I too have similar problem and have been struggling since morning. My problem is my mod_jk2 doesnt even load balance to remote server. When i shut down local servers, it puts the request to remote server.. no cluesss!! -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: JK2: lb_factor Hello, I've got a cluster with 2 tomcat 2.0.25 on different machines, on one of them also running Apache 2.0.49 with JK2 as a loadbalancer. Requests get redirected to both tomcat instances, but it always ends up with around 1/3 of all requests at the local server and about 2/3 at the remote one, no matter what value the lb_factors are. So, could anyone tell me which values I should use to make the lb_factor work correctly? All information I found was that a lower value means more requests (official JK2-documentation at jakarta.apache.org). = My workers2.properties: [lb:lb] stickySession=1 # First Tomcat Instance (Localhost / 10.32.97.44) [channel.socket:localhost:8009] port=8009 host=127.0.0.1 group=lb lb_factor=1 tomcatId=tomcat01 # Second Tomcat Instance (10.32.97.23) [channel.socket:10.32.97.23:8009] port=8009 host=10.32.97.23 group=lb lb_factor=1 tomcatId=tomcat02 # define the worker for tomcat instance 1 (localhost) [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # define the worker for tomcat instance 2 [ajp13:10.32.97.23:8009] channel=channel.socket:10.32.97.23:8009 #This is the application to test the cluster / load balancing... [uri:/benchmark/*] info=Benchmark application Anything wrong with that? Anything missing? If more information needed, just tell me.. I just guessed that the workers2.properties is the problem. Greets, Nicole Diese E-Mail enthalt vertrauliche und/oder rechtlich geschutzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtumlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht
RE: JK2: lb_factor
Hey my friend, Please check the last section of this link, I hope you can understand better? I have been trying to understand this section..but could not help it. :--) http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/configwebcom.html -Ursprüngliche Nachricht- Von: Kommuru, Bhaskar [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Juni 2004 16:09 An: 'Tomcat Users List' Betreff: RE: JK2: lb_factor Do you remember that mail about lb_factor? What you said it right about lb_factor. Changing this value does not affect easily. -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 2:39 PM To: Tomcat Users List Subject: AW: JK2: lb_factor Yes, I'm still struggling, too, and have quite similar problems now - I added a third server to the load balanced cluster, but only two of them get requests. I shut down each server in turn, and the load got balanced fine between the remaining two - on starting up the third server again, one always becomes idle (not always the same, above all...). Not talking about the fact that setting lb_factor to whatever value doesn't seem to have much effect on the load distribution... At least, I found out that lb_factor has nothing to do with a factor, indeed - assume that each worker has an initial lb_value, set to it's lb_factor. With every request, a worker is chosen, its lb_value gets increased by its lb_factor, and if it's smaller than lb_value of the other nodes, that worker gets the request. If lb_value is 255, it gets resetted to 0. ^^ Just search archives of Apache User Mailing List, found it there (and hope I understood correctly) - however, the mail was from some months ago, so I really don't know if it still works like this. I'd really like to know if someone has managed to build a cluster of more than 2 Tomcat servers, using Apache + JK2, with working loadbalancing? Just curious... If someone could give a hint why it does such strange things (like ignoring cluster nodes), we'd of course be thankful, too... :) Greets, Nicole -Ursprüngliche Nachricht- Von: Kommuru, Bhaskar [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Juni 2004 14:12 An: 'Tomcat Users List' Betreff: RE: JK2: lb_factor I too have similar problem and have been struggling since morning. My problem is my mod_jk2 doesnt even load balance to remote server. When i shut down local servers, it puts the request to remote server.. no cluesss!! -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: JK2: lb_factor Hello, I've got a cluster with 2 tomcat 2.0.25 on different machines, on one of them also running Apache 2.0.49 with JK2 as a loadbalancer. Requests get redirected to both tomcat instances, but it always ends up with around 1/3 of all requests at the local server and about 2/3 at the remote one, no matter what value the lb_factors are. So, could anyone tell me which values I should use to make the lb_factor work correctly? All information I found was that a lower value means more requests (official JK2-documentation at jakarta.apache.org). = My workers2.properties: [lb:lb] stickySession=1 # First Tomcat Instance (Localhost / 10.32.97.44) [channel.socket:localhost:8009] port=8009 host=127.0.0.1 group=lb lb_factor=1 tomcatId=tomcat01 # Second Tomcat Instance (10.32.97.23) [channel.socket:10.32.97.23:8009] port=8009 host=10.32.97.23 group=lb lb_factor=1 tomcatId=tomcat02 # define the worker for tomcat instance 1 (localhost) [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # define the worker for tomcat instance 2 [ajp13:10.32.97.23:8009] channel=channel.socket:10.32.97.23:8009 #This is the application to test the cluster / load balancing... [uri:/benchmark/*] info=Benchmark application Anything wrong with that? Anything missing? If more information needed, just tell me.. I just guessed that the workers2.properties is the problem. Greets, Nicole Diese E-Mail enthalt vertrauliche und/oder rechtlich geschutzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtumlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: JK2: lb_factor
I measured similar effects using The Grinder. Under maximum load with long running requests it can be even that worse that one Apache 2.x (default compile: prefork) with 2 Tomcats 5.x/mod_jk2 only distributes to the first Tomcat at all. This is true as long as Apache runs out of MaxClients because of the concurrent requests. Then, for some reason, Apache starts to distribute also some load to the second Apache. So it might help if you lower MaxClients (this seems the only thing that has an direct effect, not lb_factor, not ajp13 threads or anything else) to force this earlier, but be aware that this might produce errors if you get much more requests that then can't be queued anymore. I suppose Apache prefork and worker communication via shared memory by mod_jk2 don't work well together, or the don't work at all for true round robin. Putting more than 2 Tomcats won't help with high load. I once had 10 Tomcats, but in the end only the first few got most of the load, Tomcat No 7-10 almost nothing. I also heard that Apache MPM may help, but didn't try yet. So either I forget something in my config, I have to use MPM (although nothing is really mentioned about those issues in the docu), or mod_jk2 is really not too good in this area. Last advice: If you have that option to use a hardware router than I'd suggest to use more Apaches with only one Tomcat behind each of them. This will definitely work best as those routers do a true round robin. Ralph Einfeldt wrote: The quality of the distribution depends on the worker type of apache. (AFAIK only the 'worker' MPM will work) Nevertheless AFAIK the load balancing in mod_jk is not complete in this area, so I'm not shure if you will get the desired distribution (but it should be closer). -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: JK2: lb_factor I've got a cluster with 2 tomcat 2.0.25 on different machines, on one of them also running Apache 2.0.49 with JK2 as a loadbalancer. Requests get redirected to both tomcat instances, but it always ends up with around 1/3 of all requests at the local server and about 2/3 at the remote one, no matter what value the lb_factors are. So, could anyone tell me which values I should use to make the lb_factor work correctly? All information I found was that a lower value means more requests (official JK2-documentation at jakarta.apache.org). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dipl.-Inf. (FH) Michael Echerer TNG Technology Consulting GmbH, http://www.tngtech.com Betastr. 13a, 85774 Unterföhring bei München, Tel. +49 89 2158996-0, Fax. +49 89 2158996-9, Mobile +49 176 20088854 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JK2: lb_factor
The quality of the distribution depends on the worker type of apache. (AFAIK only the 'worker' MPM will work) Nevertheless AFAIK the load balancing in mod_jk is not complete in this area, so I'm not shure if you will get the desired distribution (but it should be closer). -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: JK2: lb_factor I've got a cluster with 2 tomcat 2.0.25 on different machines, on one of them also running Apache 2.0.49 with JK2 as a loadbalancer. Requests get redirected to both tomcat instances, but it always ends up with around 1/3 of all requests at the local server and about 2/3 at the remote one, no matter what value the lb_factors are. So, could anyone tell me which values I should use to make the lb_factor work correctly? All information I found was that a lower value means more requests (official JK2-documentation at jakarta.apache.org). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JK2: lb_factor
Hi Nicole, I guess it's the mpm_worker_module, that you need. Yes, I was talking about mod_jk2. I guess that it is possible to enable a worker by configuration. (After all they are just modules) Sorry, as I'm neither using apache 2 nor mod_jk*, I can't add much. That was just third hand knowledge from posts to this list that managed to stay on my brain heap. Some starting points: http://httpd.apache.org/docs-2.0/mod/worker.html http://httpd.apache.org/docs-2.0/mpm.html -Original Message- From: Weseloh, Nicole [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 1:48 PM To: Tomcat Users List Subject: AW: JK2: lb_factor could you please explain what you mean by that? My Apache has got the following (default?) modules: snip Compiled in modules: core.c mod_win32.c mpm_winnt.c http_core.c mod_so.c /snip So - do I need to use the mpm_worker_module instead of mpm_winnt? (OS of the server is Win XP Pro) If so - can you tell me how to do that? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JK2 LB_FACTOR problem
Ok the attachment didn't work. Please view this link: http://phoenix.inetsolve.com:8080/angusBlog/GUIDESTARjkstatus.html -Original Message- From: Angus Mezick Sent: Thursday, February 26, 2004 9:58 AM To: [EMAIL PROTECTED] Subject: JK2 LB_FACTOR problem I have a cluster of 5 apache-tomcat pairs. I set a lb_factor for the local tomcat to 100 and the lb_factor for the other 4 tomcat's to 1. When I look at the jkstatus I see this result: idnamelb_factor lb_valueroute errorState graceful epCount errorTime 2 web02WWW:8019 1 192 web02WWW:8019 N N 6 0 3 web03WWW:8019 100 200 web03WWW:8019 N N 1 0 4 web04WWW:8019 1 191 web04WWW:8019 N N 3 0 5 web05WWW:8019 1 191 web05WWW:8019 N N 2 0 6 web06WWW:8019 1 191 web06WWW:8019 N N 3 0 7 web03Members:8019 100 100 web03 N N 0 0 8 web04Members:8019 1 7 web04 N N 1 0 Why the heck to the workers with a lb_factor of 1 get a lb_value of 19[1-2]? What is lb_value? I am expecting for ever 104 requests worker 3 will get 100 of them and workers 2,4,5,6 will get 1 each. Am I wrong. From the behaviour I have been seeing it seems that I am. I have attached a copy of my jkstatus output so you can see my complete config. Angus Mezick GuideStar - Philanthropic Research Inc. 427 Scotland St. Williamsburg, Virginia 23185 PHONE: (757)299-4631 x35 FAX:(757)229-8912 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] www.guidestar.org http://www.guidestar.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]