Clustering Problem
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
RE: Tomcat reconnect to database server?
Does this force it to reconnect in the case of an error? I know the documentation lists adding ?autoreconnect=true to the connection string to cause this to happen. Course I have only seen this with MySQL Databases. -Steve P.S. has anyone gotten the MySQL driver failover to work? -Original Message- From: Altankov Peter [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 10:38 AM To: Tomcat Users List Subject: RE: Tomcat reconnect to database server? The DBCP pool that you lookup from JNDI is already such a connection manager. Just try adding the validation query that Arthur suggested. Im not sure for MSSQL but I use this for Oracle: parameter namevalidationQuery/name valueSELECT 1 FROM dual/value /parameter This goes underResourceParams name=jdbc/your_resource BR -Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: 07 2004 . 18:21 To: Tomcat Users List Subject: RE: Tomcat reconnect to database server? Thanks for your reply. Unfortunately, the Microsoft SQL Server JDBC driver does not support an autoreconnect option. Do I need a separate connection pool manager? The MS SQL Server JDBC driver documentation suggests that I might need such a manager since the driver does not itself manage the connection pool. Derek -Original Message- From: Philipp Taprogge [mailto:[EMAIL PROTECTED] Sent: January 7, 2004 9:47 AM To: Tomcat Users List Subject: Re: Tomcat reconnect to database server? Hi! I don't know MSSQL in particular, but in princible it should be as simple as adding ?autoreconnect=true to the driver URL. Phil Derek Mahar wrote: How can I configure Tomcat 5.0.16 to reconnect to a Microsot SQL Server after a server restart? I have configured Tomcat to use JNDI datasources (through Resource and ResourceParam elements within GlobalNamingResources). I presume that at startup, Tomcat connects to the server and creates a pool of connections for later use. However, when we restart our server, Tomcat loses its connection(s) and does not re-establish these connections. -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - 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
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
RE: tomcat 5.0.16 Replication (This is a Thread is a Duplicate Pl ease Ignore)
RE: tomcat 5.0.16 Replication
My CPU Util jumps to 100% on both processes. It functions properly other than maxing the machine. BTW this is with NO load. I am going to try to profile it but the EJP profile files total over 800 meg for just starting up Tomcat. And I am off-site so I had to transfer them. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 1:43 PM 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]
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 tomcat-replication.jar MCaster download the jar from http://cvs.apache.org/~fhanik/ 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]
RE: tomcat 5.0.16 Replication
Yep, also happens when I use asynch. I couldn't get the profiling files to load on the machine I am using right now, when I get back to the servers I'll try to figure out what is eating up all the CPUalthough TOP tells me arround 30% of the ute is system level as opposed the the java executable. Sounds like alot of the load may be in system calls. -Steve -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:47 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication 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 tomcat-replication.jar MCaster download the jar from http://cvs.apache.org/~fhanik/ 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
Okay, I reverted back to the 5.0.16 version and now I don't have the high CPU ute. But it takes almost 60 seconds for the Manager to request the session state. Which causes it to fail to synch about half the time. Must be something in the Synch code. Which comes back to your original comments about the NIO stuff and RH9 not liking Java in general. Is there a known fix for making things right with RH9? I could try that. -Steve -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:53 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Yep, also happens when I use asynch. I couldn't get the profiling files to load on the machine I am using right now, when I get back to the servers I'll try to figure out what is eating up all the CPUalthough TOP tells me arround 30% of the ute is system level as opposed the the java executable. Sounds like alot of the load may be in system calls. -Steve -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:47 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication 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 tomcat-replication.jar MCaster download the jar from http://cvs.apache.org/~fhanik/ 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
Heh, now I am replying to myself :P I tried export set LD_ASSUME_KERNEL=2.4.1 No change in Behaviour then I tried export set LD_ASSUME_KERNEL=2.2.5 again, no change. I restarted both servers between runs. I still get the CPU going crazy Scenario. -Steve -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 3:03 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Okay, I reverted back to the 5.0.16 version and now I don't have the high CPU ute. But it takes almost 60 seconds for the Manager to request the session state. Which causes it to fail to synch about half the time. Must be something in the Synch code. Which comes back to your original comments about the NIO stuff and RH9 not liking Java in general. Is there a known fix for making things right with RH9? I could try that. -Steve -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:53 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Yep, also happens when I use asynch. I couldn't get the profiling files to load on the machine I am using right now, when I get back to the servers I'll try to figure out what is eating up all the CPUalthough TOP tells me arround 30% of the ute is system level as opposed the the java executable. Sounds like alot of the load may be in system calls. -Steve -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:47 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication 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 tomcat-replication.jar MCaster download the jar from http://cvs.apache.org/~fhanik/ 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
Ends up doing the same thing. The variable was set. I checked it with an echo. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 4:05 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication you should do export LD_ASSUME_KERNEL=2.4.1 not export set LD_ASSUME_KERNEL=2.4.1 in regular bash shell -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 1:38 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Heh, now I am replying to myself :P I tried export set LD_ASSUME_KERNEL=2.4.1 No change in Behaviour then I tried export set LD_ASSUME_KERNEL=2.2.5 again, no change. I restarted both servers between runs. I still get the CPU going crazy Scenario. -Steve -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 3:03 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Okay, I reverted back to the 5.0.16 version and now I don't have the high CPU ute. But it takes almost 60 seconds for the Manager to request the session state. Which causes it to fail to synch about half the time. Must be something in the Synch code. Which comes back to your original comments about the NIO stuff and RH9 not liking Java in general. Is there a known fix for making things right with RH9? I could try that. -Steve -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:53 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Yep, also happens when I use asynch. I couldn't get the profiling files to load on the machine I am using right now, when I get back to the servers I'll try to figure out what is eating up all the CPUalthough TOP tells me arround 30% of the ute is system level as opposed the the java executable. Sounds like alot of the load may be in system calls. -Steve -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:47 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication 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 tomcat-replication.jar MCaster download the jar from http://cvs.apache.org/~fhanik/ 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
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 tomcat-replication.jar MCaster download the jar from http://cvs.apache.org/~fhanik/ 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] -- 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 Deadlock
First off, if you have the option you might try using a database pool instead of using 1 connection for multiple threads (As in Tomcat). At one company I worked for we had some problems with using 1 connection. Data would be read/written incorrectly. Results from one query would be returned to another etc. Bad driver...probably, but it's still a safer and better use of resources to let Tomcat give you a connection from a pool and then release it back when you are done. -Steve -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:46 AM To: Tomcat Users List Subject: RE: Tomcat Deadlock The code itself is pretty long. Maybe it would be better if I explain how I handle database connectivity (which I'm guessing has some flaws), and I know I should be encapsulating my queries in EJB's, but for now I just have a lot of inline SQL in my Actions. I use a DatabaseManager class (at the end of the e-mail) to connect to my database. If an action needs to connect, it makes a new DatabaseManager object. It uses the methods in the class, then at the end it calls a function to clean up the connection, etc. Here is the code for the database manager class: package WIPT; import java.sql.*; import javax.sql.*; import java.util.*; import java.lang.*; import java.io.*; import javax.naming.*; public class DatabaseManager { // Data Members // Keep track of the current database in use for transactions private String dbName; // The data source private DataSource ds; // The connection private Connection conn; // The statement private Statement stmt; // The prepared statement private PreparedStatement pstmt; // The callable statement (for stored procedures) private CallableStatement cstmt; // If transactions are being used or not private boolean transaction; // Empty constructor public DatabaseManager() throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { // Default the database to WIPT and not to use transactions this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified public DatabaseManager(boolean transact) throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the database to be used (wipt or user) public DatabaseManager(String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified and the database to be used (wipt or user) public DatabaseManager(boolean transact, String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Return the dbName being used public String getDBName() { return this.dbName; } // Initialize the data source private void initDataSource(String dbName) throws Exception { try { Context ctx = new InitialContext(); if (ctx == null) throw new Exception(Unable to initialize the WIPT database.); else { if (dbName != null dbName.toLowerCase().equals(user)) { this.dbName = user; this.ds =
RE: Tomcat Deadlock
Take a look at this. http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-how to.html Every time you load a page open the connection, then close it to release it to the pool. That way each thread should get 1 connection. -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:20 PM To: Tomcat Users List Subject: RE: Tomcat Deadlock I thought I was by defining the data source (using org.apache.commons.dbcp.BasicDataSourceFactory) in my server.xml file and using JNDI to access it? -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:50 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock First off, if you have the option you might try using a database pool instead of using 1 connection for multiple threads (As in Tomcat). At one company I worked for we had some problems with using 1 connection. Data would be read/written incorrectly. Results from one query would be returned to another etc. Bad driver...probably, but it's still a safer and better use of resources to let Tomcat give you a connection from a pool and then release it back when you are done. -Steve -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:46 AM To: Tomcat Users List Subject: RE: Tomcat Deadlock The code itself is pretty long. Maybe it would be better if I explain how I handle database connectivity (which I'm guessing has some flaws), and I know I should be encapsulating my queries in EJB's, but for now I just have a lot of inline SQL in my Actions. I use a DatabaseManager class (at the end of the e-mail) to connect to my database. If an action needs to connect, it makes a new DatabaseManager object. It uses the methods in the class, then at the end it calls a function to clean up the connection, etc. Here is the code for the database manager class: package WIPT; import java.sql.*; import javax.sql.*; import java.util.*; import java.lang.*; import java.io.*; import javax.naming.*; public class DatabaseManager { // Data Members // Keep track of the current database in use for transactions private String dbName; // The data source private DataSource ds; // The connection private Connection conn; // The statement private Statement stmt; // The prepared statement private PreparedStatement pstmt; // The callable statement (for stored procedures) private CallableStatement cstmt; // If transactions are being used or not private boolean transaction; // Empty constructor public DatabaseManager() throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { // Default the database to WIPT and not to use transactions this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified public DatabaseManager(boolean transact) throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the database to be used (wipt or user) public DatabaseManager(String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified and the database to be used (wipt or user) public DatabaseManager(boolean transact, String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction
RE: tomcat 5.0.16 Replication
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 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215
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 -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
RE: Tomcat Deadlock
Hrmm... Do you create a new instance of the DatabaseManager class during each load of the page? For some strange, wacky reason I thought you were using it almost as a singleton. If that's not the case then you probably are doing the right thing with that, and I am just talkin fluff. -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:50 PM To: Tomcat Users List Subject: RE: Tomcat Deadlock I followed the example for Tomcat 4.x when I set it up. The only reason I have a separate object is to hide some of the complexity. I'm pretty sure it's using a connection pool right now. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:25 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock Take a look at this. http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples -how to.html Every time you load a page open the connection, then close it to release it to the pool. That way each thread should get 1 connection. -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:20 PM To: Tomcat Users List Subject: RE: Tomcat Deadlock I thought I was by defining the data source (using org.apache.commons.dbcp.BasicDataSourceFactory) in my server.xml file and using JNDI to access it? -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:50 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock First off, if you have the option you might try using a database pool instead of using 1 connection for multiple threads (As in Tomcat). At one company I worked for we had some problems with using 1 connection. Data would be read/written incorrectly. Results from one query would be returned to another etc. Bad driver...probably, but it's still a safer and better use of resources to let Tomcat give you a connection from a pool and then release it back when you are done. -Steve -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:46 AM To: Tomcat Users List Subject: RE: Tomcat Deadlock The code itself is pretty long. Maybe it would be better if I explain how I handle database connectivity (which I'm guessing has some flaws), and I know I should be encapsulating my queries in EJB's, but for now I just have a lot of inline SQL in my Actions. I use a DatabaseManager class (at the end of the e-mail) to connect to my database. If an action needs to connect, it makes a new DatabaseManager object. It uses the methods in the class, then at the end it calls a function to clean up the connection, etc. Here is the code for the database manager class: package WIPT; import java.sql.*; import javax.sql.*; import java.util.*; import java.lang.*; import java.io.*; import javax.naming.*; public class DatabaseManager { // Data Members // Keep track of the current database in use for transactions private String dbName; // The data source private DataSource ds; // The connection private Connection conn; // The statement private Statement stmt; // The prepared statement private PreparedStatement pstmt; // The callable statement (for stored procedures) private CallableStatement cstmt; // If transactions are being used or not private boolean transaction; // Empty constructor public DatabaseManager() throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { // Default the database to WIPT and not to use transactions this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified public DatabaseManager(boolean transact) throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the database to be used (wipt or user) public DatabaseManager(String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else
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] 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
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] 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
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] 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
RE: WAS: tomcat 5.0.16 Replication
I had an instance where an ACK message timed out after 15ms and it had to retry. The two machines have a 100mb crossover connection so this (in theory) shouldn't happen. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 1:29 PM 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 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