Re: Meaning of threads
What is the impact of having apache httpd allow keep alive requests when using the AJP connector to tomcat? Does this have any impact on tomcat's thread usage? How well does httpd itself deal with keep alive pipelines under a heavy user load? -Sean On Mon, 2005-01-24 at 16:23 -0600, Filip Hanik - Dev wrote: > no, think about it a little bit longer, what does a keepalive connection do, > > it hogs one thread per client, not per concurrent user. so now other clients > will be stuck waiting cause you have keepalive turned > on, and a user is sitting idle doing nothing, but yet, taking up server > resources > > Filip > > - Original Message - > From: "Dola Woolfe" <[EMAIL PROTECTED]> > To: "Tomcat Users List" > Sent: Monday, January 24, 2005 3:50 PM > Subject: Re: Meaning of threads > > > That's counterintuitive, isn't it? > > How come? > > --- Filip Hanik - Dev <[EMAIL PROTECTED]> wrote: > > > the number of threads will depend on the size of > > your machine, > > but to support many concurrent users, you will want > > to turn off keep alive connections, as these will > > have the opposite effect. > > > > Filip > > > > - Original Message - > > From: "Dola Woolfe" <[EMAIL PROTECTED]> > > To: "Tomcat Users List" > > > > Sent: Monday, January 24, 2005 3:29 PM > > Subject: Re: Meaning of threads > > > > > > Yes, I get the direction this is going in! > > > > I assume that the reason for having threads waiting > > is > > that they take time to be created? And you don't > > want > > to have too many because they take up memory? > > > > I can't resist asking a question about optimal > > values. > > Since the answer is obviously "it depends" let me > > put > > my question this way. If you were running > > "craigslist" > > (I assume you've heard of it) what would these > > values > > be? How about ebay? > > > > > > --- Filip Hanik - Dev <[EMAIL PROTECTED]> wrote: > > > > > >maxThreads="150" > > > > > > your server can handle a maximum of 150 concurrent > > > clients > > > > > > >minSpareThreads="25" > > > if your server is idle, it will at least have 25 > > > threads waiting to handle requests > > > > > > >maxSpareThreads="75" > > > if your server is idle, it will have no more than > > 75 > > > threads waiting to handle requests > > > > > > you get the direction this is going in, right? > > > Filip > > > > > > - Original Message - > > > From: "Dola Woolfe" <[EMAIL PROTECTED]> > > > To: "Tom Cat" > > > Sent: Monday, January 24, 2005 2:51 PM > > > Subject: Meaning of threads > > > > > > > > > Hi, > > > > > > Where can I read about the meaning of the > > following > > > options: maxThreads="150" minSpareThreads="25" > > > maxSpareThreads="75" > > > > > > My server tends to lock out a user who bombards it > > > with requests so I'm wondering whether those > > options > > > have anything to do with it before I post the > > > problem > > > here. > > > > > > > > > Aaron Fude > > > > > > > > > > > > __ > > > Do you Yahoo!? > > > All your favorites on one personal page - Try My > > > Yahoo! > > > http://my.yahoo.com > > > > > > > > > - > > > 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] > > > > > > > > > > > > > > > > > > __ > > Do you Yahoo!? > > Yahoo! Mail - You care about security. So do we. > > http://promotions.yahoo.com/new_mail > > > > > - > > 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] > > > > > > > > > __ > Do you Yahoo!? > Yahoo! Mail - Helps protect you from nasty viruses. > http://promotions.yahoo.com/new_mail > > - > 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: What is it mean that "Java code does not belong in well designed JSP pages"?
I work in a shop similar to the one you describe where individuals are forced to fill multiple roles. I'm called upon to implement everything from domain models to navigation menus. However, I find that keeping the Java code that appears in JSP to a minimum helps in this situation as well. Although I am completely capable of wearing multiple hats, I do feel that we all benefit from practices that limit the amount of time we have to wear all those hats at once. I would also argue the quality of our work benefits from the increased level of focus such discipline provides. Some logic does belong in JSP. However, the logic that appears within pages should be limited to display logic. I've found that Struts and JSTL are a great combination to accomplish such separation. -Sean On Sun, 2005-01-23 at 10:45 -0500, Frank W. Zammetti wrote: > I certainly wouldn't presume to speak for Craig, so this is just my own > answer... > > Scriplets, that is, code in JSPs inside <% %>, is generally considered a > Bad Thing(tm) because it's too easy for business logic to sneak into the > presentation. > > Now, there is I think room for debate about how far to push that idea. > Some people think that a JSP should be absolutely nothing more than a > template for display, so you should wind up with nothing but things like > <$=someVar%>, or more "correctly", something like name="myBean" property="myVar" />. > > However, where there is room for debate is whether using any sort of > logic whatsoever in a JSP is bad or not. Taking the "JSP as a template > only" idea to it's fullest extent seems to me to imply that logic in ANY > form is to be avoided, and should not be done in a JSP, whether it's > using taglibs or not to do it (i.e., shouldn't even be > used because it's logic). I think this is too extreme and limits the > types of applications you can do... try doing the kinds of apps I do for > a living for example, which are webapps that look, feel and work like > fat clients, and you'll be hard-pressed to pull off the kinds of things > I do without some level of logic in JSPs. > > That being said, good design dictates that you need to be careful what > gets put in your JSPs, whether you use custom tags or not (I'm not a fan > of custom tags myself in most cases). Business logic does NOT belong in > JSPs, and indeed anything other than trivial bits of code probably > shouldn't be there either. > > I'm not entirely sure what the code you posted is doing, but my gut > feeling is that it's too much for a JSP. I do things like this all the > time; > > <% >boolean altRow = false; >String rowStyle = ""; >for (Iterator it = form.getTOAList().iterator(); it.hasNext(); ) { > if (altRow) { >rowStyle = "cssListboxAltRow"; >altRow = false; > } else { >rowStyle = ""; >altRow = true; > } > HashMap nextItem = (HashMap)it.next(); > BigDecimal toaID = (BigDecimal)nextItem.get("toaID"); > String status = (String)nextItem.get("status"); > %> > ><%=status%> ><%=toaID%> > > <% >} > %> > > ...and some will say that's way too much... let's skip the "this should > be a custom tag!" argument for the time being... This kind of code I see > no problem with being in a JSP. It's strictly presentation-oriented, > and isn't extensive. > > That being said, NOW we can get to the "this shouldn't be there at all" > argument... it is a perfectly reasonable argument. In an environment > where you have page authors and Java coders, you don't want your page > authors to have to see code like that. In fact, in the "perfect" > environment where it's split exactly right, they wouldn't even know what > this code meant. But, if you had a custom tag that encapsulated that > functionality, they could just put and be done with it. > That's the argument for taglibs (the main one anyway). > > However, you have to ask yourself what kind of environment your in... I > dare say most environments are NOT set up that way... maybe they should > be, but I don't think the majority are... most places, your page authors > are your Java coders are your database developers are your business > analysts, etc. In that case, I think the argument doesn't carry as much > weight. > > Eh, I guess I'm off on a bit of a tangent. Most people will tell you > that code in JSPs is to be avoided, and I'm not going out of my way to > debate that. But, I think it's fair to say that if you do have code in > JSPs, it should be (a) trivial and (b) strictly presentation-related. > Breaking THOSE rules, which by extension breaks the higher rules, is to > be avoided at all costs. Just my opinions. > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > > Dola Woolfe wrote: > > I just read this thread and didn't quite understand > > it. If it means what it seems to mean on t
Re: index.jsp: why don't modifications to it show up?
I ran into the same issue a while back and found that there is a compiled version of the index.jsp in catalina-root.jar file in the /WEB- INF/lib folder of the root web application. Hope that helps. -Sean On Mon, 2005-01-17 at 20:58 -0800, Kai Utility wrote: > Thanks for your excellent introduction to setting up Tomcat. > I've thought of an addition you might want to include, namely, how to > replace tomcat's index.jsp with one's own. I'm doing a very limited web > site and wish to expose it to the internet but I don't want the default > tomcat startup page. Unfortunately, I've found this to be a non-trivial > task that I've spent all day on and still haven't solved. Below follows > an email I'm sending to tomcat-user@jakarta.apache.org: > > > I have recently installed tomcat 5.5.4. > I wish to use my own index.jsp in place of the out-of-the-box one. > However, when I make changes to it they don't register. > I.e. I'm making changes to >$CATALINA_HOME/webapps/ROOT/index.jsp > > I have searched this list for "index.jsp" and come up with some > information but I haven't had success yet. More on that presently. > This is some of what I've seen so far: > > --- > http://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1735120 > > When using Tomcat 5.0.25 it seems that any change I make to > ROOT/index.jsp does not show up in the > browser (in Tomcat 4.xx this was easy to do). I am sure this is some > sort of caching problem so > I've been looking for the compiled JSP in the work directory to delete > it. Very strange, but it > doesn't seem like this JSP is compiled anywhere. > > Does Tomcat 5.0 have some sort of memory resident or log caching that > persists even after the > server is restarted? > > --- > http://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]&msgNo=150033 > > Check the webapp's WEB-INF/web.xml -- is said JSP precompiled? > > If so, changing the file will (understandably) have no effect: the > container checks its servlet mappings first, files (say, JSPs) second. > > --- > http://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1735455 > > Good suggestion. If the JSP is precompiled shouldn't I be able to go to > the work directory and > see index_jsp.class somewhere under a ROOT directory (like there is for > other webapps)? I guess > one of my basic questions is that why don't I see a ROOT directory in > the work directory? > > --- > http://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1735458 > > You tell me -- how did you precompile? > > If you're placing classes directly in the "/work" dir, then, yes; > if you're building class files and updating web.xml, then, no. > > The former method of precompilation is Tomcat-specific and accounts for > a JSP being updated. The latter is for production deployments, in which > case the JSPs should not change throughout the release lifetime. > > The root context may be under "/work/_" in TC5, but don't quote me on > that. > > --- > There were some other conversations on this topic but the above seemed > the best. > It seems that the last message above may be pertinent but I don't > understand it. > > I found two instances of index_jsp.class in my tomcat tree. > I deleted both and nothing happened. > > --- > My setup: > I'm running Tomcat 5.5.4 standalone (no apache). > > $CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml > contains the following: > > org.apache.jsp.index_jsp > org.apache.jsp.index_jsp > > > > org.apache.jsp.index_jsp > /index.jsp > > > $CATALINA_HOME/conf/web.xml > contains the following (all standard, except I'm allowing the invoker > servlet): > > default > > org.apache.catalina.servlets.DefaultServlet > > debug > 0 > > > listings > false > > 1 > > > > invoker > > org.apache.catalina.servlets.InvokerServlet > > > debug > 0 > > 2 > > > > default > / > > > > index.html > index.htm > index.jsp > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help: Context.xml Resource difference between 5.0.x and 5.5.x ?
On Mon, 2005-01-17 at 16:57 -0800, TomK wrote: > I'm having trouble moving my webapp from Tomcat 5.0 to 5.5. The dataSource > in Context.xml seems to be the issue. > > According to the 'JNDI how-to' documentation for 5.0 and 5.5, it looks like > the '' tag has been removed from the Context.xml and instead > you can now supply arbitrary attributes to the tag itself. > > In 5.0, my Context.xml looked like this and it worked fine: > > > type="oracle.jdbc.pool.OracleDataSource" /> > > > factory > oracle.jdbc.pool.OracleDataSourceFactory > > > driverClassName > oracle.jdbc.driver.OracleDriver > > > url > jdbc:oracle:thin:@xx:xx:xx > > > user > xx > > > password > xx > > > > > ...note that oracle's factory requires "user", not "username". > > > Moving to 5.5, I changed it to: > > > > driverClassName="oracle.jdbc.driver.OracleDriver" > factory="oracle.jdbc.pool.OracleDataSourceFactory" > name="jdbc/db1" > password="xxx" > type="oracle.jdbc.pool.OracleDataSource" > url="jdbc:oracle:thin:@xx:xx:xx" > user="xx"/> > > > ...this new Context.xml doesn't work. I get the following: > javax.naming.NamingException: Cannot create resource instance > at > org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:132) > at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source) > at org.apache.naming.NamingContext.lookup(NamingContext.java:792) > > any ideas? Almost seems as if the "factory" attribute of is > not being used. > > thanks > tk_ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Java VM Monitor-Debug
You need a profiler. I would suggest JProfiler for development monitoring. It's far too intrusive to use on a production system though. On Mon, 2005-01-17 at 19:37 -0500, K. Mike Bradley wrote: > I have a need to look inside a running Java VM for a Tomcat app. > We are having problems with an app on every server and can't figure it out. > > I have a kernel mode debugger I can use for a Windows app but this is > useless here of course. > What kinds of third party products let you see inside a Java VM? > > I need to see processes and threads and execution times and stack and heap > space and whatever else is unique to Java that I need to see. > I mean that I need a real solid diagnostic tool. > > I see that J2SE 5 has this monitor API and SNMP as well but I don't think I > can get it in our app. > > Is there any third party tools out there that are real solid?? > > 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: Tomcat 4 doesn't start http service on Linux?
My first suggestion would be to set up Apache httpd as the load balancer using mod_jk. This will give you much more accurate node availability detection. This solution also provides much more flexibility when it comes to using the session tracking API (session affinity, session replication or both). If you are running a "stateless" application or are forced to use BigIP there is a less than ideal node detection scheme available. I believe BigIP has the capability of pluggable node detection schemes. You could set up a low overhead resource within your application context or the root context. BigIP could then run an HTTP Get against that resource periodically to ensure that the application is still available on that node. I'm sure someone could come up with a better pluggable node detection scheme, but I haven't really given it to much thought since BigIP is overkill for most situations and there is a scalable, robust and infinitely cheaper solution available via mod_jk. On Mon, 2005-01-17 at 11:52 -0600, Stephen Charles Huey wrote: > We just installed Tomcat 4 on 2 Red Hat servers, and we have a BigIP > load balancer in front of them. In troubleshooting an issue, the guy > working with our BigIP said that when he was running Apache on either of > the Linux servers, the load balancer could tell that the http service > was running, but when Tomcat was running, it didn't know what to check > for on a service level, so in the end, they had to set it up to just do > a TCP check to see if the port was open. > > He says this isn't ideal since the port being open doesn't mean the > service is up (meaning Tomcat). He thinks that Tomcat should start up > the http service (I guess he means httpd) when it starts--that maybe I > just need to look around in Tomcat's configuration for the place to set > this, but I'm not so sure that this is the case. > > In a nutshell: is Tomcat supposed to start up the http service or > something similar to what BigIP is looking for from Apache? > > 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: apache2 + mod_jk + tomcat5.5.4 help
Try leaving the className parameter off. I new versions of Tomcat use the CoyoteConnector for AJP communication. The minProcessor and maxProcessor attributes have been deprecated. Use maxThreads, minSpareThreads and maxSpareThreads instead. On Mon, 2005-01-17 at 14:16 -0500, Trung Nguyen wrote: > Hello, > > I'm trying to configure mod_jk with tomcat 5.5.4, but I'm kinda stuck. I > did it with tomcat 4.1.30 with no problem. How do you configure in > server.xml to make it talk to apache2 through AJP13? In tomcat4 I did > something like this: > > port="8009" minProcessors="5" maxProcessors="75" > enableLookups="false" acceptCount="10" debug="0"/> > > It doesn't work with tomcat 5.5.4. Please help!!! > > 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]