Wednesday, October 22, 2008

tomcat wisdom

ChanServ [#tomcat] Welcome. DO NOT ASK YOUR QUESTION until you have told us your Tomcat, Java, and OS versions (all three)! Tomcat version numbers are THREE numbers long, like "6.0.7". We will probably ignore your question if you do not provide this -- we won't keep asking for it.
16:54 azathoth99 does tomcat 5.5 run with java 1.6?
16:56 MHSL azathoth99, yes
17:02 azathoth99 is java_home set to /some/path/java-xyz not /some/path/java-xyz/bin/java right?
17:04 azathoth99 going to assume yes
17:08 MHSL yes
17:18 azathoth99 so where does one go to learn to build a webapps with the jsp servet stuff?
17:18 azathoth99 servlet even
17:19 jasonb There are web pages, but probably tutorial books are best.
17:19 jasonb One of the best servlet programming books is "Java Servlet Programming" (O'Reilly).
17:19 azathoth99 are servelts ok on memory
17:19 jasonb Yes, great.
17:19 azathoth99 or do they burn up a cpu
17:20 azathoth99 and this async stuff?
17:20 jasonb No, they're very lightweight, if they're not poorly written.
17:20 azathoth99 wher is that liek described?
17:20 azathoth99 ok cool
17:20 jasonb what async stuff?
17:21 MHSL jasonb, are you aware of this error, if you are, what may be the cause? http://pastebin.com/d3afa1b7e
17:21 azathoth99 nio
17:23 jasonb azathoth99: What makes you think you should use the NIO connector, or any async stuff?
17:23 MHSL azathoth99, you should also learn how to use google
17:23 jasonb MHSL: Which version of Tomcat? And, which connector implementation are you using?
17:24 MHSL jasonb, tomcat 6.0.14 and mod_jk 1.2.26
17:24 azathoth99 I dunno
17:24 jasonb MHSL: And on the Tomcat side, you're using the JIO JK connector?
17:24 azathoth99 I heard async was faster
17:24 jasonb azathoth99: It's not.
17:24 azathoth99 !!
17:25 azathoth99 really?
17:25 MHSL jasonb, AJP/1.3 if that's what you're asking
17:25 jasonb MHSL: Do you have clustering configured/enabled?
17:25 MHSL yes
17:25 MHSL default configuration
17:25 jasonb MHSL: By default, clustering is turned off.
17:25 MHSL yes, it's turned on, but i'm using the default clustering configuration
17:26 jasonb MHSL: Ahh.
17:26 jasonb MHSL: This exception is in part of the clustering code.
17:26 MHSL yep
17:26 jasonb MHSL: I haven't seen it before, but I can tell it's the clustering code. :) That code is better than it was, but it's still not very used, and not very mature.
17:26 MHSL ic
17:27 jasonb MHSL: It looks to me like it's a regular bug that you should report in Tomcat's/ASF's bugzilla.
17:27 MHSL maybe i'll give 6.0.18 a try and see whether i'll still get the same error, because i cant really see the cause of it
17:27 MHSL the problem is, i dont know how to reproduce it
17:27 MHSL but i got it quite often, it may be something related to webapp reloading
17:27 jasonb MHSL: The clustering code hasn't changed all that much recently, but 6.0.14 was out quite a while ago, so there may have been some changes/fixes in the clustering code.
17:28 MHSL ic, i know that there are some changes to the configuration part, but not sure whether this issue has been fixed, maybe i'll also take a look at the changes
17:28 jasonb MHSL: I'd suggest not using mod_jk, first, and then I'd suggest not using JK at all.. use mod_proxy and send your requests via HTTP.
17:28 MHSL i dont really want to send all requests to tomcat, since that defeats the purpose of apache
17:29 MHSL just want to forward any jsp/servlets/actions stuff to tomcat, and the rest handled by apache
17:29 jasonb No, I'm not suggesting making Tomcat the first contact web server (you actually should.. Tomcat is faster and more secure). But, what I said was to use mod_proxy to send requests from httpd to Tomcat.
17:30 jasonb Tomcat is faster at handling static file requests than apache httpd is, in case you didn't know.
17:30 MHSL ok, let's talk about tomcat standalone, how are you going about doing clustering without a middle man like apache?
17:31 MHSL and session replication for that matter
17:32 jasonb All you need is a layer 7 switch such as any layer 7 load balancer box, or if you want all open source software then here's one: http://l7-filter.sourceforge.net/HOWTO-kernel
17:32 MHSL since i have 2 machines, on machine A i dont really need apache, but on machine B i need apache, since i need to support php as well
17:32 MHSL kernel level, ic, anything beside kernel level stuff
17:32 jasonb If you have to use PHP, then you can proxy from Tomcat to Apache for those requests, proxying requests from Tomcat --> httpd is faster than proxying from httpd --> Tomcat.
17:33 jasonb You don't need to run any kernel-level stuff if you don't want to.. there are both user space and kernel space layer 7 switches.
17:33 MHSL ic, so you're saying, set up proxy on tomcat and forward php to httpd instead
17:33 MHSL and i also prefer the cross platform app
17:33 jasonb Yes. The performance is far better.
17:34 MHSL i meant, i prefer the cross platform way of doing tomcat clustering without httpd (if it's better)
17:35 MHSL jasonb, is terracota supported with tomcat?
17:35 jasonb MHSL: You probably want this link to the user space layer 7 switch: http://l7-filter.sourceforge.net/HOWTO-userspace
17:36 MHSL jasonb, so in essense that still relies on iptables, correct?
17:36 *** roadt joined #tomcat
17:36 jasonb MHSL: Terracotta is one thing I don't know much about yet. :)
17:37 MHSL ic
17:37 MHSL wonder whether tomcat will work with that
17:37 jasonb MHSL: I believe this user space L7 switch implementation does rely on iptables, but this is a Linux solution.. I don't know of any kind of a cross-platform layer 7 software switch. There probably isn't one.
17:38 MHSL ic
17:38 jasonb Tomcat probably does work with terracotta.
17:38 MHSL so in this case apache can still be used as a cross platform method?
17:39 MHSL unless there is a different way of doing it instead of using apache

No comments: