getRequestURL with Apache/ajp13 and SSL certs
Ok I need some info here. I've been trying to use the HttpServletRequest.getRequestURL in tomcat 5 to return the user's original URL. I need to extract the scheme, port, servername that the client used on his side. From the specs, that method should do it. I first tried getServerName and getServerScheme but later found out that those values are taken from the HTTP attribute SERVER_NAME that is probably overriden by apache to set his own. My problem is. I call a server with his IP adress: let's say 192.168.2.1. That server has a valid certificate install with the common name mysite.cgi.com So I type the url: https://192.168.2.1/myServlet The servlet does some validation and then send a URL redirect to request.getRequestURL() + /myPage; The client ends up on https://mysite.cgi.com/myPage How come??? The client never entered mysite.cgi.com anywhere... I'm confused... Apache 1.3.26 Tomcat 5.0.16 mod_jk with ajp13 Jean-Philippe Bélanger CGI - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat clustering
For the basic on loadbalancing and architecture check out this article from Filip: http://www.theserverside.com/articles/article.jsp?l=Tomcat It's nicely done. A little out of date as for the tomcat configuration. Since tc 5.x has a whole new clustering engine. But it should be good enough for you to understand the balancing fundamentals. Jean-Philippe Bélanger CGI Salvador Santander Gutierrez wrote: How can I get some tomcat servers working like a cluster? I means, how to put some tomcat to get load balancing and increment the site performance. Thanks. - 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: Clustering question...
As of now I don' think the Tomcat clustering code of Filip supports any of what you ask. The only thing replicated is the session and the date within. The principal is not replicated as of yet. (I think Filip is working on that) You will have to find another centralized spot to store those data for each node to access. Jean-Philippe Bélanger CGI Rick Szeto wrote: Hi All, I have question about synchronizing data within the application context. If the data of a webapp's application context changes within one of the nodes in the cluster, how does the other nodes get the updated application context data? Is it handle the same way as user session data(via some session manager implementation)? Or does the change(s) get distributed? Thanks for any help you can give, Rick Szeto - 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]
Tomcat replication Unable to receive message through TCP channel
Just installed the tomcat 5.0.16 with cvs for clustering on my 2nd server cluster. The first one is running pretty well without any bug whatsoever. But that new cluster seams to have some problem with the replication with it`s going a specific way. From web1 to web2 it works fine. but if I hit the web2 and it need to replicate to web1 it gives this error. Geeh? invalidated? Unable to receive message through TCP channel java.lang.IllegalStateException: getAttributeNames: Session already invalidated at org.apache.catalina.session.StandardSession.getAttributeNames(StandardSession.java:1005) at org.apache.catalina.cluster.session.ReplicatedSession.toString(ReplicatedSession.java:295) at java.lang.String.valueOf(String.java:2173) at java.lang.StringBuffer.append(StringBuffer.java:369) at org.apache.catalina.cluster.session.SimpleTcpReplicationManager.messageReceived(SimpleTcpReplicationManager.java:610) at org.apache.catalina.cluster.session.SimpleTcpReplicationManager.messageDataReceived(SimpleTcpReplicationManager.java:642) at org.apache.catalina.cluster.tcp.SimpleTcpCluster.messageDataReceived(SimpleTcpCluster.java:716) at org.apache.catalina.cluster.io.ObjectReader.execute(ObjectReader.java:117) at org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel(TcpReplicationThread.java:175) at org.apache.catalina.cluster.tcp.TcpReplicationThread.run(TcpReplicationThread.java:113) 16-Jan-2004 10:49:04 AM org.apache.catalina.cluster.session.SimpleTcpReplicationManager log Jean-Philippe Bélanger CGI - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat replication Unable to receive message through TCP channel
Ok I really have no idea why this ain't working. Same clustering version on both cluster. The first one works A1.. the second invalidates all my sessions Only difference between the two clusters are that the 2nd one is a multi-ip server (3 adresses on the same eth). But the hostname is pointing to the main eth0 address. any idea? Jean-Philippe Bélanger CGI Filip Hanik wrote: yikes :) I fixed this one two days ago, download 5.0.18 and let me know if the problem persists. Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SPAM?: Re: Tomcat replication Unable to receive message through TCP channel
YOU'RE KIDDING ME! sorry for the caps but I just lost a day of work for a stupid server out of time! :P Thanks btw! Jean-Philippe Bélanger CGI Apu Shah wrote: check the dates on both machines. i think (filip please clarify if i'm wrong) if one machine is out of sync with the other by an interval equal or greater than the session timeout, the sessions will expire on the receiving end. Ok I really have no idea why this ain't working. Same clustering version on both cluster. The first one works A1.. the second invalidates all my sessions Only difference between the two clusters are that the 2nd one is a multi-ip server (3 adresses on the same eth). But the hostname is pointing to the main eth0 address. any idea? Jean-Philippe Bélanger CGI Filip Hanik wrote: yikes :) I fixed this one two days ago, download 5.0.18 and let me know if the problem persists. Filip - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WAS: tomcat 5.0.16 Replication
Ok here is what is going on. Seams like the problem is not with the tomcat replication but with the damned JK balancer. :( When the 2nd tomcat node is shutdown, the balancer resend all the request pending to the other node. (BUT, without the parameter.) I sent 50 request to each node (or so) when I did shutdown the 2nd node, the first node received 50 request without a couple of ms. All of them with NULL parameters (without the value of the original form post) God this ain't good. hopefully in production we are using a Cisco load balancer. Hope it doesn't do that too. Any idea of what is wrong with the balancer worker? Any other way to work random balancing with tc/apache? Thanks a lot Jean-Philippe Bélanger CGI Filip Hanik wrote: if you have a test case for me I can take a look and see what happens Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WAS: tomcat 5.0.16 Replication
Already ahead of you on this one! :) Pen is great indeed. I kinda love the load-balancing AND failover feature that balance.sourceforge doesn`t have. Jean-Philippe Bélanger CGI Filip Hanik wrote: I just either http://siag.nu/pen/ (my favorite, works on both windows and unix) or balance http://balance.sourceforge.net on unix only Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 14, 2004 6:09 AM To: Tomcat Users List Subject: Re: WAS: tomcat 5.0.16 Replication Ok here is what is going on. Seams like the problem is not with the tomcat replication but with the damned JK balancer. :( When the 2nd tomcat node is shutdown, the balancer resend all the request pending to the other node. (BUT, without the parameter.) I sent 50 request to each node (or so) when I did shutdown the 2nd node, the first node received 50 request without a couple of ms. All of them with NULL parameters (without the value of the original form post) God this ain't good. hopefully in production we are using a Cisco load balancer. Hope it doesn't do that too. Any idea of what is wrong with the balancer worker? Any other way to work random balancing with tc/apache? Thanks a lot Jean-Philippe Bélanger CGI Filip Hanik wrote: if you have a test case for me I can take a look and see what happens Filip - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WAS: tomcat 5.0.16 Replication
Still checking to make sure it ain't on my side (MVC or such) Jean-Philippe Bélanger CGI Filip Hanik wrote: interesting, never seen that, let me take a look. I have an automated test that I run to check replication integrity. since you get this everytime, it shouldn't be a problem for me to do reproduce this. do you by any chance have the test program you have and would email it to me? Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:56 AM To: Tomcat Users List Subject: Re: WAS: tomcat 5.0.16 Replication I understand that. Here more info... I make a servlet request that does this: while ( i 25 ) { if ( request.getParameters(xxx) == null ) { System.out.println(param is null); } Thread.currentThread().sleep(1000); i++ } I then send a couple of request with param xxx=123 at 1 secs interval. (those request are all made to the same server ie: web1) Once a couple of them are sent I shutdown web2. As soon as the INFO: Received member disappeared:org.apache.catalina.cluster.mcast.McastMember[tcp://10.1 28.29.66:4001,10.128.29.66,4001, alive=6576] message is received my log gets flooded with param is null Jean-Philippe Bélanger CGI Filip Hanik wrote: the way the login is done, is that a request is being saved in the session (in a session note, and that is not replicated). So for a login, you must hit the same server twice in a row. Otherwise you will see NULL in your request parameters. Also in this release, the principal is not being replicated, I am working on that right now Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:29 AM To: Tomcat Users List Subject: Re: WAS: tomcat 5.0.16 Replication Been working on testing the new modules and came across something weird. Wondering if you got any idea on the cause/problem while I continue investigating Scenario: - one web page login in a user. receive 3 parameters (user, password and community) - To be able to replicate the problem I had to put a sleep on 25 secs in code. - Post one request each second or so and after a couple of them, shudown one tomcat and restart it. (stop/start sequence) - A couple of request will start pourring the result, but after some.. when tomcat that got shutdown is restarting, the request parameters becomes NULL. As if the replication code was killing my request objects or resetting my parameters on those requests. Any thought on what it could be? I even had session mix-up once. when restarting a tomcat a user was logging in and was assigned a session from another user that never logged on from his station (that session was idle for more than 10 hours too). Just trying to pinpoint where the problem could be. Any pointer would help. Thanks Jean-Philippe Bélanger CGI Filip Hanik wrote: Steve and Jean-Philippe, I've been working on some more replication stuff and made a major change that I think you might want to use. I have added a third configuration to the parameter replicationMode, replicationMode=pooled With this setting it still is synchronized replication, but uses a pool of sockets to replicate the data. It improves performance a lot. Try it out, and let me know how it works for you You will notice the improvement under load. of course, get latest from cvs first Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:05 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Hrmmm, perhaps I should reboot using the non-SMP kernel and try it. I'll have to do that when I get back to the servers. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 2:04 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication uname -a machine #1) Linux draco 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux machine #2) Linux scorpio 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux java -version: java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) same on both -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:56 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication [EMAIL PROTECTED] bin]# uname -a Linux rh9 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux [EMAIL PROTECTED] bin]# java -version java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:05 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication sun JDK 1.4.2 for Linux Kernel 2.4.20-8smp Tomcat 5.0.16 with catalina-cluster.jar
Re: WAS: tomcat 5.0.16 Replication
And your reply is better? I'm trying to get that replication thing working with Filip. If there is something imcompatible with his code that make this behavior happens. I will try and find it before giving him the job. He's not the only one that has to work with this. I'm offering my help. I'm not gonna waste more time with you since you don't help us in any with our problem. Jean-Philippe Bélanger CGI Giuliano Gavazzi wrote: This is the kind of behaviour that I really cannot understand. Makes archiving a pain and is totally inconsiderate. At 8:23 am -0500 2004/01/13, [EMAIL PROTECTED] wrote: Still checking to make sure it ain't on my side (MVC or such) Jean-Philippe Bélanger CGI [25kB of inessential quote] - 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: WAS: tomcat 5.0.16 Replication
Well then... Sorry about misunderstanding. I'll try to remove my thousand of quotes now! :P and keep only the last one Jean-Philippe Bélanger CGI Ralph Einfeldt wrote: He didn't critique that you posted, just how. He doesn't like posts with quotes that are not needed. (That's the attitude of many in the list (me too)) Please try to strip of the quotes that are not relevant for your answer. - 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: WAS: tomcat 5.0.16 Replication
I've tried to replicate the problem with a simple servlet. outside of our MVC architecture (controller). and seams like I can't. I've put traces in our controller on the doPost method writing the request parameter to the console. When the 2nd node is shutdown, they request params become nulls! even if the same Post is done from a local static webpage. I've been trying to find out why for hours. but seams like I'm getting a dead-end soon. any ideas where I could look? fresh ideas would help! :) Jean-Philippe Bélanger CGI Filip Hanik wrote: interesting, never seen that, let me take a look. I have an automated test that I run to check replication integrity. since you get this everytime, it shouldn't be a problem for me to do reproduce this. do you by any chance have the test program you have and would email it to me? Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:56 AM To: Tomcat Users List Subject: Re: WAS: tomcat 5.0.16 Replication I understand that. Here more info... I make a servlet request that does this: while ( i 25 ) { if ( request.getParameters(xxx) == null ) { System.out.println(param is null); } Thread.currentThread().sleep(1000); i++ } I then send a couple of request with param xxx=123 at 1 secs interval. (those request are all made to the same server ie: web1) Once a couple of them are sent I shutdown web2. As soon as the INFO: Received member disappeared:org.apache.catalina.cluster.mcast.McastMember[tcp://10.1 28.29.66:4001,10.128.29.66,4001, alive=6576] message is received my log gets flooded with param is null Jean-Philippe Bélanger CGI Filip Hanik wrote: the way the login is done, is that a request is being saved in the session (in a session note, and that is not replicated). So for a login, you must hit the same server twice in a row. Otherwise you will see NULL in your request parameters. Also in this release, the principal is not being replicated, I am working on that right now Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:29 AM To: Tomcat Users List Subject: Re: WAS: tomcat 5.0.16 Replication Been working on testing the new modules and came across something weird. Wondering if you got any idea on the cause/problem while I continue investigating Scenario: - one web page login in a user. receive 3 parameters (user, password and community) - To be able to replicate the problem I had to put a sleep on 25 secs in code. - Post one request each second or so and after a couple of them, shudown one tomcat and restart it. (stop/start sequence) - A couple of request will start pourring the result, but after some.. when tomcat that got shutdown is restarting, the request parameters becomes NULL. As if the replication code was killing my request objects or resetting my parameters on those requests. Any thought on what it could be? I even had session mix-up once. when restarting a tomcat a user was logging in and was assigned a session from another user that never logged on from his station (that session was idle for more than 10 hours too). Just trying to pinpoint where the problem could be. Any pointer would help. Thanks Jean-Philippe Bélanger CGI Filip Hanik wrote: Steve and Jean-Philippe, I've been working on some more replication stuff and made a major change that I think you might want to use. I have added a third configuration to the parameter replicationMode, replicationMode=pooled With this setting it still is synchronized replication, but uses a pool of sockets to replicate the data. It improves performance a lot. Try it out, and let me know how it works for you You will notice the improvement under load. of course, get latest from cvs first Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:05 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Hrmmm, perhaps I should reboot using the non-SMP kernel and try it. I'll have to do that when I get back to the servers. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 2:04 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication uname -a machine #1) Linux draco 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux machine #2) Linux scorpio 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux java -version: java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) same on both -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:56 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication [EMAIL PROTECTED] bin]# uname -a Linux rh9 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux [EMAIL
Re: WAS: tomcat 5.0.16 Replication
That's the catch. Everything is A ok. no error what soever before I get a null params. Would an invalidated request still had the getRemoteAddr() and getRequestURI() set? And if so... how can I know if a REQUEST gets invalidated?? Jean-Philippe Bélanger CGI Filip Hanik wrote: hmm, could it be that your Request gets invalidated, the Request you are holding on to is just a fascade. On top of my head, I can't see a connection with the cluster. Does your logs indicate anything else, like a null pointer etc? Filip - Original Message - From: [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, January 13, 2004 9:24 AM Subject: Re: WAS: tomcat 5.0.16 Replication I've tried to replicate the problem with a simple servlet. outside of our MVC architecture (controller). and seams like I can't. I've put traces in our controller on the doPost method writing the request parameter to the console. When the 2nd node is shutdown, they request params become nulls! even if the same Post is done from a local static webpage. I've been trying to find out why for hours. but seams like I'm getting a dead-end soon. any ideas where I could look? fresh ideas would help! :) Jean-Philippe Bélanger CGI Filip Hanik wrote: interesting, never seen that, let me take a look. I have an automated test that I run to check replication integrity. since you get this everytime, it shouldn't be a problem for me to do reproduce this. do you by any chance have the test program you have and would email it to me? Filip - 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: SPAM?: problem in jsp response
I think the jsp cache can do the trick of you set it off check the jsp directive Jean-Philippe Bélanger CGI Rogerio Baldini das Neves wrote: Hi, I have a problem that's getting me crazy. A code in jsp file like this: ** *% for(int i=0; i10; i++) { out.println(i:+i+br); Thread.sleep(1000); } %* ** is just showed in browser when tomcat finishes processing all iterates (it takes 10 seconds). This is, tomcat sends the html soucecode just when process ends. I need tomcat sends soucecode to response on demand (on each iteration - 1 per second) Is it possible ? Somebody help me ... Thanks, *__* *Rogério Baldini das Neves* *Diretor de Tecnologia* 1 www.infoquest.com.br http://www.infoquest.com.br *+* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] *(* 55 (31) 3261-7030 / Ramal 27 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SPAM?: problem in jsp response
sorry... I kinda forgot the right directive and param. it's @page buffer=none% Jean-Philippe Bélanger CGI Rogerio Baldini das Neves wrote: Hi, I have a problem that's getting me crazy. A code in jsp file like this: ** *% for(int i=0; i10; i++) { out.println(i:+i+br); Thread.sleep(1000); } %* ** is just showed in browser when tomcat finishes processing all iterates (it takes 10 seconds). This is, tomcat sends the html soucecode just when process ends. I need tomcat sends soucecode to response on demand (on each iteration - 1 per second) Is it possible ? Somebody help me ... Thanks, *__* *Rogério Baldini das Neves* *Diretor de Tecnologia* 1 www.infoquest.com.br http://www.infoquest.com.br *+* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] *(* 55 (31) 3261-7030 / Ramal 27 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem in jsp response
Use the magic word include! :) something like [EMAIL PROTECTED] file=defaults.jsp% in each of your pages. Then you just have one place to put it. But I don't know if there is a way to set it at the Jasper level. Jean-Philippe Bélanger CGI Rogerio Baldini das Neves wrote: Thanks Jean-Philippe, it works fine rigth now. Is it possible to set up this parameter in server? I think it will be boring to set it up in each jsp file. thanks again, *__* *Rogério Baldini das Neves* *Diretor de Tecnologia* 1 www.infoquest.com.br http://www.infoquest.com.br *+* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] *(* 55 (31) 3261-7030 / Ramal 27 - Original Message - *From:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] *To:* Tomcat Users List mailto:[EMAIL PROTECTED] *Sent:* Tuesday, January 13, 2004 11:51 AM *Subject:* Re: SPAM?: problem in jsp response sorry... I kinda forgot the right directive and param. it's @page buffer=none% Jean-Philippe Bélanger CGI Rogerio Baldini das Neves wrote: Hi, I have a problem that's getting me crazy. A code in jsp file like this: ** *% for(int i=0; i10; i++) { out.println(i:+i+br); Thread.sleep(1000); } %* ** is just showed in browser when tomcat finishes processing all iterates (it takes 10 seconds). This is, tomcat sends the html soucecode just when process ends. I need tomcat sends soucecode to response on demand (on each iteration - 1 per second) Is it possible ? Somebody help me ... Thanks, *__* *Rogério Baldini das Neves* *Diretor de Tecnologia* 1 www.infoquest.com.br http://www.infoquest.com.br http://www.infoquest.com.br *+* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] *(* 55 (31) 3261-7030 / Ramal 27 - To unsubscribe, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WAS: tomcat 5.0.16 Replication
That sounds good. I'll get the CVS head and check this out. We won't really put much stress on those server for a while, but as long as the behavior is the same. I buy! :) btw: is there a pool config or is it hardcoded for now? Thanks again Filip. Jean-Philippe Belanger Filip Hanik wrote: Steve and Jean-Philippe, I've been working on some more replication stuff and made a major change that I think you might want to use. I have added a third configuration to the parameter replicationMode, replicationMode=pooled With this setting it still is synchronized replication, but uses a pool of sockets to replicate the data. It improves performance a lot. Try it out, and let me know how it works for you You will notice the improvement under load. of course, get latest from cvs first Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:05 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Hrmmm, perhaps I should reboot using the non-SMP kernel and try it. I'll have to do that when I get back to the servers. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 2:04 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication uname -a machine #1) Linux draco 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux machine #2) Linux scorpio 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux java -version: java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) same on both -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:56 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication [EMAIL PROTECTED] bin]# uname -a Linux rh9 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux [EMAIL PROTECTED] bin]# java -version java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:05 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication sun JDK 1.4.2 for Linux Kernel 2.4.20-8smp Tomcat 5.0.16 with catalina-cluster.jar from CVS head Hrmmmare yours SMP servers? Could be something odd with synch if that is the case. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:01 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication interesting, mine doesn't work at all unless I set the LD_ASSUME_KERNEL what VM (version and name) are you using? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:59 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Now that's really very strange. I am running RH9 and everything seems to go through just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:56 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED
Re: Replication question
You can either use the dirtyFlag=false to automaticly replicate the WHOLE session after each access. Or if the dirtyFlag is true, only if at least one setAttribute (or removeAttribute) was done on the session that it will get replicated. use whichever is the easiest and more flexible for you Jean-Philippe Bélanger CGI John Sidney-Woollett wrote: Hi For replication purposes (2 or more tcs in a cluster), how do you let the sessionlistener know to re-replicate your session after you make a change to a property of an object which is bound to the session, but where the session attribute + object iself remains unchanged? For example, if I bind a (lightweight and serializable) class to the session and change one of its properties, how do I notify Tomcat that I want the session replicated again. Probably as far as TC and the replication code is concerned it doesn't need to do anything because no attribute changes are recorded. Do I just call session.setAttribute(MyObject, myObject) again (where the myObject reference is the same as before), or do I have to remove and then re-add the attribute? Or is there something that I have missed? Also, if you add many attributes during a single servlet call, is the replication buffered and delayed until the servlet sends its response, or is the replication attempted each time the session's attributes are changed? When does anyone think that the recent replication fixes will make it into the next official release? Thanks for any info. John Sidney-Woollett - 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: WAS: tomcat 5.0.16 Replication
Been working on testing the new modules and came across something weird. Wondering if you got any idea on the cause/problem while I continue investigating Scenario: - one web page login in a user. receive 3 parameters (user, password and community) - To be able to replicate the problem I had to put a sleep on 25 secs in code. - Post one request each second or so and after a couple of them, shudown one tomcat and restart it. (stop/start sequence) - A couple of request will start pourring the result, but after some.. when tomcat that got shutdown is restarting, the request parameters becomes NULL. As if the replication code was killing my request objects or resetting my parameters on those requests. Any thought on what it could be? I even had session mix-up once. when restarting a tomcat a user was logging in and was assigned a session from another user that never logged on from his station (that session was idle for more than 10 hours too). Just trying to pinpoint where the problem could be. Any pointer would help. Thanks Jean-Philippe Bélanger CGI Filip Hanik wrote: Steve and Jean-Philippe, I've been working on some more replication stuff and made a major change that I think you might want to use. I have added a third configuration to the parameter replicationMode, replicationMode=pooled With this setting it still is synchronized replication, but uses a pool of sockets to replicate the data. It improves performance a lot. Try it out, and let me know how it works for you You will notice the improvement under load. of course, get latest from cvs first Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:05 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Hrmmm, perhaps I should reboot using the non-SMP kernel and try it. I'll have to do that when I get back to the servers. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 2:04 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication uname -a machine #1) Linux draco 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux machine #2) Linux scorpio 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux java -version: java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) same on both -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:56 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication [EMAIL PROTECTED] bin]# uname -a Linux rh9 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux [EMAIL PROTECTED] bin]# java -version java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:05 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication sun JDK 1.4.2 for Linux Kernel 2.4.20-8smp Tomcat 5.0.16 with catalina-cluster.jar from CVS head Hrmmmare yours SMP servers? Could be something odd with synch if that is the case. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:01 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication interesting, mine doesn't work at all unless I set the LD_ASSUME_KERNEL what VM (version and name) are you using? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:59 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Now that's really very strange. I am running RH9 and everything seems to go through just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:56 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes
Re: WAS: tomcat 5.0.16 Replication
I understand that. Here more info... I make a servlet request that does this: while ( i 25 ) { if ( request.getParameters(xxx) == null ) { System.out.println(param is null); } Thread.currentThread().sleep(1000); i++ } I then send a couple of request with param xxx=123 at 1 secs interval. (those request are all made to the same server ie: web1) Once a couple of them are sent I shutdown web2. As soon as the INFO: Received member disappeared:org.apache.catalina.cluster.mcast.McastMember[tcp://10.128.29.66:4001,10.128.29.66,4001, alive=6576] message is received my log gets flooded with param is null Jean-Philippe Bélanger CGI Filip Hanik wrote: the way the login is done, is that a request is being saved in the session (in a session note, and that is not replicated). So for a login, you must hit the same server twice in a row. Otherwise you will see NULL in your request parameters. Also in this release, the principal is not being replicated, I am working on that right now Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:29 AM To: Tomcat Users List Subject: Re: WAS: tomcat 5.0.16 Replication Been working on testing the new modules and came across something weird. Wondering if you got any idea on the cause/problem while I continue investigating Scenario: - one web page login in a user. receive 3 parameters (user, password and community) - To be able to replicate the problem I had to put a sleep on 25 secs in code. - Post one request each second or so and after a couple of them, shudown one tomcat and restart it. (stop/start sequence) - A couple of request will start pourring the result, but after some.. when tomcat that got shutdown is restarting, the request parameters becomes NULL. As if the replication code was killing my request objects or resetting my parameters on those requests. Any thought on what it could be? I even had session mix-up once. when restarting a tomcat a user was logging in and was assigned a session from another user that never logged on from his station (that session was idle for more than 10 hours too). Just trying to pinpoint where the problem could be. Any pointer would help. Thanks Jean-Philippe Bélanger CGI Filip Hanik wrote: Steve and Jean-Philippe, I've been working on some more replication stuff and made a major change that I think you might want to use. I have added a third configuration to the parameter replicationMode, replicationMode=pooled With this setting it still is synchronized replication, but uses a pool of sockets to replicate the data. It improves performance a lot. Try it out, and let me know how it works for you You will notice the improvement under load. of course, get latest from cvs first Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:05 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Hrmmm, perhaps I should reboot using the non-SMP kernel and try it. I'll have to do that when I get back to the servers. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 2:04 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication uname -a machine #1) Linux draco 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux machine #2) Linux scorpio 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux java -version: java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) same on both -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:56 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication [EMAIL PROTECTED] bin]# uname -a Linux rh9 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux [EMAIL PROTECTED] bin]# java -version java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:05 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication sun JDK 1.4.2 for Linux Kernel 2.4.20-8smp Tomcat 5.0.16 with catalina-cluster.jar from CVS head Hrmmmare yours SMP servers? Could be something odd with synch if that is the case. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:01 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication interesting, mine doesn't work at all unless I set the LD_ASSUME_KERNEL what VM (version and name) are you using? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:59 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Now that's really very strange. I
Re: tomcat 5.0.16 Replication
Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215 java.net.PlainDatagramSocketImpl.receive 4 10.93% 44.81%4114 224 java.lang.Thread.sleep 5 10.91% 55.73% 19005 214 sun.nio.ch.PollArrayWrapper.poll0 6 7.37% 63.09% 28 495 java.lang.Object.wait 7 7.24% 70.34% 10 576 java.lang.Object.wait 8 4.57% 74.90% 90 716 java.lang.Thread.sleep 9 4.48% 79.38% 1 909 java.lang.Object.wait 10 4.48% 83.86% 1 908 java.lang.Object.wait 11 4.48% 88.34% 15 810 java.lang.Object.wait 12 4.47% 92.81% 1 910 java.net.PlainSocketImpl.socketAccept 13 0.71% 93.52% 2 623 java.lang.Object.wait 14 0.56% 94.08% 2 706 java.lang.Object.wait 15 0.38% 94.46% 2 914 java.lang.Object.wait 16 0.24% 94.70% 775 913
Re: tomcat 5.0.16 Replication
Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215 java.net.PlainDatagramSocketImpl.receive 4 10.93% 44.81%4114 224 java.lang.Thread.sleep 5 10.91% 55.73% 19005 214 sun.nio.ch.PollArrayWrapper.poll0 6 7.37% 63.09% 28 495 java.lang.Object.wait 7 7.24% 70.34% 10 576 java.lang.Object.wait 8 4.57% 74.90% 90 716 java.lang.Thread.sleep 9 4.48% 79.38% 1 909 java.lang.Object.wait 10 4.48% 83.86% 1 908 java.lang.Object.wait 11 4.48%
Re: tomcat 5.0.16 Replication
A... I see. So no way to have only the value which setAttribute was called on to be replicated (yet...) ? Thanks Jean-Philippe Bélanger Filip Hanik wrote: useDirtyFlag=true means that session (yes the whole) only gets replicated when setAttribute and removeAttribute is called -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:33 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait
Re: tomcat 5.0.16 Replication
The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485
Re: tomcat 5.0.16 Replication
uname -a reports: 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux Filip Hanik wrote: interesting, mine doesn't work at all unless I set the LD_ASSUME_KERNEL what VM (version and name) are you using? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:59 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Now that's really very strange. I am running RH9 and everything seems to go through just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:56 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with
Re: tomcat 5.0.16 Replication
Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215 java.net.PlainDatagramSocketImpl.receive 4 10.93% 44.81%4114 224 java.lang.Thread.sleep 5 10.91% 55.73% 19005 214 sun.nio.ch.PollArrayWrapper.poll0 6 7.37% 63.09% 28 495 java.lang.Object.wait 7 7.24% 70.34% 10 576 java.lang.Object.wait 8 4.57% 74.90% 90 716 java.lang.Thread.sleep 9 4.48% 79.38% 1 909 java.lang.Object.wait 10 4.48% 83.86% 1 908 java.lang.Object.wait 11 4.48% 88.34% 15 810 java.lang.Object.wait 12 4.47% 92.81% 1 910 java.net.PlainSocketImpl.socketAccept 13 0.71% 93.52% 2 623 java.lang.Object.wait 14 0.56% 94.08% 2 706 java.lang.Object.wait 15 0.38% 94.46% 2 914 java.lang.Object.wait 16 0.24% 94.70% 775 913 java.lang.String.toCharArray 17 0.23% 94.93% 3 475 java.lang.Thread.sleep 18 0.16% 95.09% 2 472 java.lang.Object.wait 19 0.15% 95.24% 2 595 java.lang.Thread.sleep 20 0.15% 95.40% 2 586 java.lang.Thread.sleep 21 0.15% 95.55% 2 703 java.lang.Thread.sleep 22 0.15% 95.70% 2 476 java.lang.Thread.sleep 23 0.15% 95.85% 2 692 java.lang.Thread.sleep 24 0.12% 95.97% 218595 385 java.lang.CharacterDataLatin1.toLowerCase 25 0.12% 96.09% 218595 408 java.lang.Character.toLowerCase 26 0.11% 96.20% 218595 433 java.lang.CharacterDataLatin1.getProperties 27 0.10% 96.30% 210925 389 java.lang.String.equalsIgnoreCase 28 0.08% 96.38% 157259 387 java.lang.String.charAt 29 0.08% 96.46% 1 646 java.lang.Thread.sleep 30 0.08% 96.53% 1 634 java.lang.Thread.sleep 31 0.08% 96.61% 1 903 java.lang.Thread.sleep 32 0.08% 96.69% 1 714 java.lang.Thread.sleep 33 0.08% 96.76% 1 811 java.lang.Thread.sleep 34 0.08% 96.84% 1 715 java.lang.Thread.sleep 2 hosts: CPU TIME (ms) BEGIN (total = 37247) Thu Jan 8 11:01:28 2004 rank self accum count trace method 1 9.56% 9.56% 5285 java.lang.Object.wait 2 9.56% 19.12% 2986 java.lang.Object.wait 3 9.30% 28.43% 3 267 java.lang.Object.wait 4 9.25% 37.68%6644 224 java.lang.Thread.sleep 5 9.23% 46.91% 13116 215 java.net.PlainDatagramSocketImpl.receive 6 7.67% 54.58% 3 266 java.lang.Object.wait 7 5.90% 60.47% 39 847 java.lang.Object.wait 8 5.76% 66.24% 12 503 java.lang.Object.wait 9 3.90% 70.14% 145 975 java.lang.Thread.sleep 10 3.90% 74.04% 1 1174 java.lang.Object.wait 11 3.90% 77.94% 1 1173 java.lang.Object.wait 12 3.90% 81.84% 25 973 java.lang.Object.wait 13 3.90% 85.74% 1 1175 java.net.PlainSocketImpl.socketAccept 14 3.88% 89.62% 819692 214 sun.nio.ch.PollArrayWrapper.poll0 15 0.75% 90.37% 2 958 java.lang.Object.wait 16 0.28% 90.65% 2 457 java.lang.Object.wait 17 0.26% 90.91% 2 1181 java.lang.Object.wait Filip Hanik wrote: I'll try to get an instance going today. Will let you know how it goes also, try asynchronous replication, does it still go to 100%? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 12:08 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Okay, did that got this BEGIN TO RECEIVE SENT:Default 1 RECEIVED:Default 1 FROM /10.0.0.110: SENT:Default 2 BEGIN TO RECEIVE RECEIVED:Default 2 FROM /10.0.0.110: SENT:Default 3 BEGIN TO RECEIVE RECEIVED:Default 3 FROM /10.0.0.110: SENT:Default 4 BEGIN TO RECEIVE RECEIVED:Default 4 FROM /10.0.0.110: *shrug* BTW It didn't go to 100% CPU ute before I started using the code from CVS. Of course the Manager would almost always timeout before it would recieve the message. Now it gets the message right away, but maxes my machine out. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 1:58 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication 100% cpu can mean that you have a multicast problem, try to run java -cp
Re: tomcat 5.0.16 Replication
More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215 java.net.PlainDatagramSocketImpl.receive 4 10.93% 44.81%4114 224 java.lang.Thread.sleep 5 10.91% 55.73% 19005 214 sun.nio.ch.PollArrayWrapper.poll0 6 7.37% 63.09% 28 495 java.lang.Object.wait 7 7.24% 70.34% 10 576 java.lang.Object.wait 8 4.57% 74.90% 90 716 java.lang.Thread.sleep 9 4.48% 79.38% 1 909 java.lang.Object.wait 10 4.48% 83.86% 1 908 java.lang.Object.wait 11 4.48% 88.34% 15 810 java.lang.Object.wait 12 4.47% 92.81% 1 910 java.net.PlainSocketImpl.socketAccept 13 0.71% 93.52% 2 623 java.lang.Object.wait 14 0.56% 94.08% 2 706 java.lang.Object.wait 15 0.38% 94.46% 2 914 java.lang.Object.wait 16 0.24% 94.70% 775 913 java.lang.String.toCharArray 17 0.23% 94.93% 3 475 java.lang.Thread.sleep 18 0.16% 95.09% 2 472 java.lang.Object.wait 19 0.15% 95.24% 2 595 java.lang.Thread.sleep 20 0.15% 95.40% 2 586 java.lang.Thread.sleep 21 0.15% 95.55% 2 703 java.lang.Thread.sleep 22 0.15% 95.70% 2 476 java.lang.Thread.sleep 23 0.15% 95.85% 2 692 java.lang.Thread.sleep 24 0.12% 95.97% 218595 385 java.lang.CharacterDataLatin1.toLowerCase 25 0.12% 96.09% 218595 408 java.lang.Character.toLowerCase 26 0.11% 96.20% 218595 433 java.lang.CharacterDataLatin1.getProperties 27 0.10% 96.30% 210925 389 java.lang.String.equalsIgnoreCase 28 0.08% 96.38% 157259 387 java.lang.String.charAt 29 0.08% 96.46% 1 646 java.lang.Thread.sleep 30 0.08% 96.53% 1 634 java.lang.Thread.sleep 31 0.08% 96.61% 1 903 java.lang.Thread.sleep 32 0.08% 96.69% 1 714 java.lang.Thread.sleep 33 0.08% 96.76% 1 811 java.lang.Thread.sleep 34 0.08% 96.84% 1 715 java.lang.Thread.sleep 2 hosts: CPU TIME (ms) BEGIN (total = 37247) Thu Jan 8 11:01:28 2004 rank self accum count trace method 1 9.56% 9.56% 5285 java.lang.Object.wait 2 9.56% 19.12% 2986 java.lang.Object.wait 3 9.30% 28.43% 3 267 java.lang.Object.wait 4 9.25% 37.68%6644 224 java.lang.Thread.sleep 5 9.23% 46.91% 13116 215 java.net.PlainDatagramSocketImpl.receive 6 7.67% 54.58% 3 266 java.lang.Object.wait 7 5.90% 60.47% 39 847 java.lang.Object.wait 8 5.76% 66.24% 12 503 java.lang.Object.wait 9 3.90% 70.14% 145 975 java.lang.Thread.sleep 10 3.90% 74.04% 1 1174 java.lang.Object.wait 11 3.90% 77.94% 1 1173 java.lang.Object.wait 12 3.90% 81.84% 25 973 java.lang.Object.wait 13 3.90% 85.74% 1 1175 java.net.PlainSocketImpl.socketAccept 14 3.88% 89.62% 819692 214 sun.nio.ch.PollArrayWrapper.poll0 15 0.75% 90.37% 2 958 java.lang.Object.wait 16 0.28% 90.65% 2 457 java.lang.Object.wait 17 0.26% 90.91% 2 1181 java.lang.Object.wait Filip Hanik wrote: I'll try to get an instance going today. Will let you know how it goes also, try asynchronous replication, does it still go to 100%? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 12:08 PM To: 'Tomcat Users
Re: tomcat 5.0.16 Replication
The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215 java.net.PlainDatagramSocketImpl.receive 4 10.93% 44.81%4114 224 java.lang.Thread.sleep 5 10.91% 55.73% 19005 214 sun.nio.ch.PollArrayWrapper.poll0 6 7.37% 63.09% 28 495 java.lang.Object.wait 7 7.24% 70.34% 10 576 java.lang.Object.wait 8 4.57% 74.90% 90 716 java.lang.Thread.sleep 9 4.48% 79.38% 1 909 java.lang.Object.wait 10 4.48% 83.86% 1 908 java.lang.Object.wait 11 4.48% 88.34% 15 810 java.lang.Object.wait 12 4.47% 92.81% 1 910 java.net.PlainSocketImpl.socketAccept 13 0.71% 93.52% 2 623 java.lang.Object.wait 14 0.56% 94.08% 2 706 java.lang.Object.wait 15 0.38% 94.46% 2 914 java.lang.Object.wait 16 0.24% 94.70% 775 913 java.lang.String.toCharArray 17 0.23% 94.93% 3 475 java.lang.Thread.sleep 18 0.16% 95.09% 2 472 java.lang.Object.wait 19 0.15% 95.24% 2 595 java.lang.Thread.sleep 20 0.15% 95.40% 2 586 java.lang.Thread.sleep 21 0.15% 95.55% 2 703 java.lang.Thread.sleep 22 0.15% 95.70% 2 476 java.lang.Thread.sleep 23 0.15% 95.85% 2 692 java.lang.Thread.sleep 24 0.12% 95.97% 218595 385 java.lang.CharacterDataLatin1.toLowerCase 25 0.12% 96.09% 218595 408 java.lang.Character.toLowerCase 26 0.11% 96.20% 218595 433 java.lang.CharacterDataLatin1.getProperties 27 0.10% 96.30% 210925 389 java.lang.String.equalsIgnoreCase 28 0.08% 96.38% 157259 387 java.lang.String.charAt 29 0.08% 96.46% 1 646 java.lang.Thread.sleep 30 0.08% 96.53% 1 634 java.lang.Thread.sleep 31 0.08% 96.61% 1 903 java.lang.Thread.sleep 32 0.08% 96.69% 1 714 java.lang.Thread.sleep 33 0.08% 96.76% 1 811 java.lang.Thread.sleep 34 0.08% 96.84% 1 715 java.lang.Thread.sleep 2 hosts: CPU TIME (ms) BEGIN (total = 37247) Thu Jan 8 11:01:28 2004 rank self accum count trace method 1 9.56% 9.56% 5285 java.lang.Object.wait 2 9.56% 19.12% 2986 java.lang.Object.wait 3 9.30% 28.43% 3 267 java.lang.Object.wait 4 9.25% 37.68%6644 224 java.lang.Thread.sleep 5 9.23% 46.91% 13116 215 java.net.PlainDatagramSocketImpl.receive 6 7.67% 54.58% 3 266 java.lang.Object.wait 7
Re: tomcat 5.0.16 Replication
Currently running tomcat 5.0.16 with the CVS HEAD of the replication module. This is under redhat 9. So far so good. What kind of problem did you encounter under rh9? Jean-Philippe Bélanger Filip Hanik wrote: my only experience with Redhat 9 is that it doesn't play well with NIO. I have not successfully ran tomcat clustering on RH9, I use RH8. I also don't have a RH9 machine at home yet, so I can't develop for it Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 6:51 AM To: '[EMAIL PROTECTED]' Subject: tomcat 5.0.16 Replication I was having random problems with clustering when starting up. Mostly it had to do with Timing out when the manager was starting up. I built the CVS version and it solved that problem. But it has caused some serious performance problems. First a little background. I have 2 servers, dual 300mhz cpq proliants, both running Redhat - 9, Tomcat 5.0.16 (with catalina-cluster.jar build from cvs) The multicast packets are restricted to a crossover link between the servers. There are 3 hosts in the server.xml, all with clustering set up. They all function just fine. But.the cpu's spikes up to 100% if I start up both servers. I know this didn't happen without the new catalina-cluster.jar. If I shut down 1 server (doesn't matter which) everything returns to normal. But when both are running both servers are at 100% CPU. I am trying to profile it now, but I figured if someone has already experienced this they could save me some time. Oh, and there isn't anything relevant in my logs. It's not throwing millions of errors or something. -Steve Nelson - 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: tomcat 5.0.16 Replication
Well just to make sure that I wasn't saying something untrue. I went to check my redhats. Everything DOES work fine but it's true that there is some loop somewhere because both my tomcat are having abnormal loadavg. ie: 1.15 even with the server are idle. Jean-Philippe Bélanger Filip Hanik wrote: I had socket dead locks in the java.io.OutputStream.write that never returned, caused the system to eventually hang. in the next few weeks, I'll try to get a RH9 instance going. So everything works for you? Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 11:43 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Currently running tomcat 5.0.16 with the CVS HEAD of the replication module. This is under redhat 9. So far so good. What kind of problem did you encounter under rh9? Jean-Philippe Bélanger Filip Hanik wrote: my only experience with Redhat 9 is that it doesn't play well with NIO. I have not successfully ran tomcat clustering on RH9, I use RH8. I also don't have a RH9 machine at home yet, so I can't develop for it Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 6:51 AM To: '[EMAIL PROTECTED]' Subject: tomcat 5.0.16 Replication I was having random problems with clustering when starting up. Mostly it had to do with Timing out when the manager was starting up. I built the CVS version and it solved that problem. But it has caused some serious performance problems. First a little background. I have 2 servers, dual 300mhz cpq proliants, both running Redhat - 9, Tomcat 5.0.16 (with catalina-cluster.jar build from cvs) The multicast packets are restricted to a crossover link between the servers. There are 3 hosts in the server.xml, all with clustering set up. They all function just fine. But.the cpu's spikes up to 100% if I start up both servers. I know this didn't happen without the new catalina-cluster.jar. If I shut down 1 server (doesn't matter which) everything returns to normal. But when both are running both servers are at 100% CPU. I am trying to profile it now, but I figured if someone has already experienced this they could save me some time. Oh, and there isn't anything relevant in my logs. It's not throwing millions of errors or something. -Steve Nelson - 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] - 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: load test suite - apache-tomcat
Loadrunner is one nice tool for creating script for web load testing. You can do absolutly anything with that tool. I tried lots of other load testing suite opensource or not and I`m still having a hard time finding a tool as complet as LR. You can try openSTA. Havn't worked much with it but it's opensource. Other than that, check you LR script and work thru it. It will be worth it. Jean-Philippe Bélanger Steve wrote: We are trying to run some load test on an app hitting apache-tomcat which also uses weblogic for its backend auth ejb to an oracle db. Currently we using loadrunner 7.51 to simulate a login to the app with about 200 virtual users.. LR is having lots of problems giving us many different results on the same test.. Looking for a opensource app or something light to simulate a same type of test to compare to the LR results.. Also a way to monitor the ejb transaction might be helpful.. We hit apache fine with 2k hits, we also hit apache-tomcat fine with 2k users just hitting a static jsp, once we try to simulate a login to our app the max vusers goes down to 100 or less.. which makes me think we could have a problem with our lr script.. Any other usefull opensource testing/monitor tools? -s - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jean-Philippe Bélanger (514)228-8800 ext 3060 111 Duke CGI - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat 5.0.16 Replication
I built the latest CVS branch for the clustering module and replaced my catalina-cluster.jar. Seams like everything is synchronous as stated. I had another unrelated problem with a IFRAME that IE seams to load before the server (tomcat) ends the request. So even if everything was synchronous the iframe request could be done by IE before the actual parent page was done replicating. I'll let you know if any other problem gets by since that release will be going thru intensive testing in the coming weeks. Thanks -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Saturday, January 03, 2004 8:07 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: tomcat 5.0.16 Replication it will come out in the next release. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 31, 2003 9:41 AM To: Tomcat-user Subject: tomcat 5.0.16 Replication The new tomcat 5.0.16 replication seams to work odly. From what I've read from the documentation and the mailing list, the clustering is supposed to be done synchronously. Right? Well that's not what's happening on my end, the client receives the response before the whole replication thing is done. ex: I got a webpage that fetches data and if data is found put it in the session and return a webpage containing a IFRAME. In the IFRAME, the src hits a webpage on the same cluster and loads up the data found in the session and display it. Well sometimes, when the IFRAME is shown and that hit is forwarded to different server than the first access, the data in the session is empty. Then once the page is loaded (empty) and returned to the client, I get the replication message in my logs. (The message containing the data that was supposed to be already replicated). [Cluster config] Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster name=PortalClusterJP debug=10 serviceclass=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.5 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000 tcpThreadCount=2 tcpListenAddress=auto tcpListenPort=4001 tcpSelectorTimeout=100 printToScreen=true expireSessionsOnShutdown=false useDirtyFlag=true replicationMode=synchronous / Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;/ [end Cluster Config] Any idea on what could be going wrong here? Jean-Philippe Bélanger CGI - 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]
tomcat 5.0.16 Replication
The new tomcat 5.0.16 replication seams to work odly. From what I've read from the documentation and the mailing list, the clustering is supposed to be done synchronously. Right? Well that's not what's happening on my end, the client receives the response before the whole replication thing is done. ex: I got a webpage that fetches data and if data is found put it in the session and return a webpage containing a IFRAME. In the IFRAME, the src hits a webpage on the same cluster and loads up the data found in the session and display it. Well sometimes, when the IFRAME is shown and that hit is forwarded to different server than the first access, the data in the session is empty. Then once the page is loaded (empty) and returned to the client, I get the replication message in my logs. (The message containing the data that was supposed to be already replicated). [Cluster config] Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster name=PortalClusterJP debug=10 serviceclass=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.5 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000 tcpThreadCount=2 tcpListenAddress=auto tcpListenPort=4001 tcpSelectorTimeout=100 printToScreen=true expireSessionsOnShutdown=false useDirtyFlag=true replicationMode=synchronous / Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;/ [end Cluster Config] Any idea on what could be going wrong here? Jean-Philippe Bélanger CGI
RE: tomcat-jg vs tomcat-replication
I just tried changing to tomcat-replication and well, that didn't go as well as I wished! :) Seams like the setAttribute, getAttribute and sessionCreation does work. Both my server gets the replication messages. My problem is that the browse never gets the request back! Everything looks done on the tomcat side but the client never get the response content. I tried removing the ReplicationValve and I can get the page back, but replication doesn't occur (duh!) :) So, here is my log file of the server that received the request: Begin of a request log 09:24:38 StandardManager[/BusinessPortalWB]: [InMemoryReplicationManager] Replicated Session created at lin-rap-ldev:32890 with ID=29913859C07BCA38595DA243D1D5AB33 09:24:38 StandardManager[/BusinessPortalWB]: [InMemoryReplicationManager] writeObject() storing session 29913859C07BCA38595DA243D1D5AB33 09:24:39 StandardManager[/BusinessPortalWB]: [InMemoryReplicationManager] InMemoryReplicationManager.handle(): received message [dst: 228.1.2.3:45566, src: lin-rap-ldev:32890 (1 headers), size = 607 bytes] 09:24:40 StandardManager[/BusinessPortalWB]: [InMemoryReplicationManager] InMemoryReplicationManager.handle(): received message [dst: 228.1.2.3:45566, src: lin-rap-ldev:32890 (1 headers), size = 553 bytes] 09:24:40 StandardManager[/BusinessPortalWB]: [InMemoryReplicationManager] setAttribute called: Name=businessportal.lock; [EMAIL PROTECTED] Debug info=SessionManager.java:55 09:24:43 StandardManager[/BusinessPortalWB]: [InMemoryReplicationManager] getAttribute called: Name=businessportal.lock; [EMAIL PROTECTED] Debug info=SessionManager.java:114 09:24:43 StandardManager[/BusinessPortalWB]: [InMemoryReplicationManager] InMemoryReplicationManager.handle(): received message [dst: 228.1.2.3:45566, src: lin-rap-ldev:32890 (1 headers), size = 810 bytes] 09:24:43 StandardManager[/BusinessPortalWB]: [InMemoryReplicationManager] setAttribute called: Name=com.cognicase.businessportal.common.usercontext; value={com.cognicase.businessportal.common.sessionmanager=1069683880243, businessportal.mapping_stack=[]} Debug info=SessionManager.java:158 09:24:43 StandardManager[/BusinessPortalWB]: [InMemoryReplicationManager] InMemoryReplicationManager.handle(): received message [dst: 228.1.2.3:45566, src: lin-rap-ldev:32890 (1 headers), size = 359 bytes] 09:24:43 StandardManager[/BusinessPortalWB]: [InMemoryReplicationManager] setAttribute called: Name=businessportal.language; value=en Debug info=SessionManager.java:159 09:24:43 ReplicationValve[/BusinessPortalWB]: [NEIL] [Thread-22] [1] Regular request completed in 4985ms. --- Done -- What is a Regular request ?? The page I use to test it is a servlet GET with a Requestforward to a jsp file. Any insight would be welcomed. Thanks, Jean-Philippe -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2003 4:45 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: tomcat-jg vs tomcat-replication I would say, use tomcat-replication, I'm the developer of both, and if you have questions and need help, I only support tomcat-replication, unless you pay me to support tomcat-jg :) Filip - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 21, 2003 11:57 AM Subject: tomcat-jg vs tomcat-replication Hi, I'm running Tomcat 4.1.18 in production and needing session replication. I've been able to get tomcat-jg up and running. But after reading some mail on the tomcat user mailling list, fillip seam to say that this version won't work with tomcat 4.1.x and that we should use the tomcat-replication (beta from TC5). Any advantages to uses the 2nd one? (NIO vs javagroup?) Bugs ? Just don't want to use the javagroup one now and find out in some weeks that it's wrecking havoc with our transactionnal servers! Thanks for your time Jean-Philippe Bélanger CGI - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat-jg vs tomcat-replication
Hi, I'm running Tomcat 4.1.18 in production and needing session replication. I've been able to get tomcat-jg up and running. But after reading some mail on the tomcat user mailling list, fillip seam to say that this version won't work with tomcat 4.1.x and that we should use the tomcat-replication (beta from TC5). Any advantages to uses the 2nd one? (NIO vs javagroup?) Bugs ? Just don't want to use the javagroup one now and find out in some weeks that it's wrecking havoc with our transactionnal servers! Thanks for your time Jean-Philippe Bélanger CGI