RE: question
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 03, 2006 11:10 AM > To: Tomcat Users List > Subject: Re: question > > hello> a.) Top Post? http://catb.org/~esr/jargon/html/T/top-post.html Personally, I never had a problem with it (and will occasionally do it myself), though you will find that some will get quite perturbed by it. *shrug* It's a big intarweb. There will always be some who think you're not using it they way they think you should. B. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat IIS-redirector help
Thomas, I don't know if I can help you, but I can offer moral support; I'm using the ISAPI redirector on IIS6/W2K3 and it works fine. Some (admittedly basic) checkpoints: 1. I'm using version 1.2.13 of the redirector. 2. I have a .reg file of registry entries if you'd like to see them so you can check against your entries. 3. You must run IIS 6 in IIS 5.0 isolation mode, AFAIK 4. You must add a new "Web Service Extension" to IIS pointing to the redirector DLL, and give it a status of "allowed". 5. Each site that uses the redirector must have a virtual folder pointing to the folder the redirector DLL is in, and that virtual folder must have "Script and Executables" execute permissions. HTH, Brantley > -Original Message- > From: Thomas Dickey [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 11, 2006 1:32 PM > To: 'Tomcat Users List' > Subject: RE: Tomcat IIS-redirector help > > I have had a few people offer assistance, but nothing has worked. Is there > anyone who can point me in the right direction? I am at a complete loss... > > Thanks in advance!!! > > Tom > > -Original Message- > From: Thomas Dickey [mailto:[EMAIL PROTECTED] > Sent: Monday, January 09, 2006 9:32 AM > To: users@tomcat.apache.org > Subject: Tomcat IIS-redirector help > > I apologize for the length of this email.. > > > > I recently installed Tomcat V5.5 on my windows 2003 Server machine with > IIS > 6.0. I'm trying to use the redirector to direct content from a host IIS > webserver, to the Tomcat processor (again, these are on the same machine). > I > have been unable to get it to post the page. > > > > Please help in any way possible.. > > > > Here is an excerpt from the redirector log.. > > > > > > ** > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_shm.c (134): Initialized > shared memory size=67584 free=65536 addr=0x1de > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_isapi_plugin.c (1160): > Using registry. > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_isapi_plugin.c (1163): > Using log file C:\Program Files\Apache Software Foundation\Jakarta Isapi > Redirector\log\isapi_redirect.log. > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_isapi_plugin.c (1164): > Using log level 1. > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_isapi_plugin.c (1165): > Using extension uri jakarta/isapi_redirect.dll. > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_isapi_plugin.c (1166): > Using worker file C:\Program Files\Apache Software Foundation\Jakarta > Isapi > Redirector\conf\workers.properties. > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_isapi_plugin.c (1167): > Using worker mount file C:\Program Files\Apache Software > Foundation\Jakarta > Isapi Redirector\conf\uriworkermap.properties. > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_isapi_plugin.c (1169): > Using uri select 0. > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_uri_worker_map.c (260): > wildchar rule /admin/*=wlb was added > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_uri_worker_map.c (260): > wildchar rule /manager/*=wlb was added > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_uri_worker_map.c (260): > wildchar rule /jsp-examples/*=wlb was added > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_uri_worker_map.c (260): > wildchar rule /servlets-examples/*=wlb was added > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_uri_worker_map.c (260): > wildchar rule /bacworth/*=bacworth was added > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_worker.c (236): creating > worker wlb > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_worker.c (141): about to > create instance wlb of ajp13 > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_worker.c (154): about to > validate and init wlb > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_ajp_common.c (1806): > worker wlb contact is 'localhost:8009' > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_ajp_common.c (1895): > setting socket keepalive to 0 > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_ajp_common.c (1934): > setting socket timeout to -1 > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_ajp_common.c (1938): > setting socket buffer size to 0 > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_ajp_common.c (1942): > setting connection recycle timeout to 0 > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_ajp_common.c (1946): > setting cache timeout to 0 > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_ajp_common.c (1950): > setting connect timeout to 0 > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_ajp_common.c (1954): > setting reply timeout to 0 > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_ajp_common.c (1958): > setting prepost timeout to 0 > > [Thu Jan 05 14:49:45 2006] [4972:5232] [debug] jk_ajp_common.c (1962): > setting recovery opts to 0 > > [Thu Jan 05 14:49:45 2006] [4
RE: Tomcat IIS-redirector help
> Can you please send me the txt of the registry file? I will check it out > and > make sure there is nothing that I have not already done. > > Tom > I sent this in private, but I decided to post it back to the list just in case it is useful to someone else: Tom, I'm pasting the contents of the file here so they don't get stripped out by a mail server somewhere along the way. All you have to do is create a new .reg file somewhere and copy/paste the contents within. You'll need to change some settings, obviously. My web stuff is all rooted on a W: drive and the paths will be different from yours. Also, note that the slashes are reversed (and escaped). Finally, note the value for "extension_uri". That is the URL that the connector is answering on to make redirects work. That value "/jakarta/" is the name of the virtual folder you created for each application that uses the connector. I hope this helps. Trust me, I've done battle with that connector before, and it's not fun. By the way, you have the little green up arrow for the filter, right? -Begin mod_jk_isapi.reg- Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation] [HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector] [HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0] "extension_uri"="/jakarta/isapi_redirect_1.2.13.dll" "log_file"="W:\\Tomcat Connectors\\jk1.log" "log_level"="error" "worker_file"="W:\\Tomcat Connectors\\workers.properties" "worker_mount_file"="W:\\Tomcat Connectors\\uriworkermap.properties" --End mod_jk_isapi.reg-- Hope this helps. Brantley - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] RE: Tomcat IIS-redirector help
> -Original Message- > From: Zach Moazeni [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 11, 2006 3:37 PM > To: Tomcat Users List > Subject: Re: Tomcat IIS-redirector help > > It certainly would be nice if ASP and ASP.NET had a binary to which you > could pass the file to and receive the output. You could then map .asp > files as CGI's. > > -Zach > You know, that's a good idea, and there's probably no real reason it couldn't be done. The VBScript engine is on each and every install of windows. If a CGI wrapper could be wrapped around it that would make it possible for Apache to serve ASP pages up, thus freeing the poor ASP shops from the tyranny of IIS. Of course, with .NET there's always MONO for your web applications, so there's not really a need for the wrapper then. Until MS decides to embrace and extend their own standard, that is. ;-) B. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can you intercept the default Servlet ? stack servlets ? forward to specific class ?
It sounds like a filter might be what you're looking for. http://java.sun.com/products/servlet/Filters.html B. > -Original Message- > From: Darryl L. Miles [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 20, 2005 10:51 AM > To: Tomcat Users List > Subject: Can you intercept the default Servlet ? stack servlets ? forward > to specific class ? > > > I would like to change a sub-tree (/subdir) of my web-app so that I run > every request runs through my own default servlet (for a security check) > then if it drops out of the bottom I wish to forward to tomcat's default > servlet. > > > Does Servlet technology allow the stacking of servlets, so mine can be > innermost and get first choice on creating a response or doing nothing > and letting the next outermost servlet have a go with the request ? > > Can I forward the request I'm holding to a specific servlet class ? > > What config changed to I need to make to web.xml ? I'm thinking i just > create my new servlet and declare a servlet mapping of the containing > directory tree "/subdir/". > > Do you have any advise about the situation that I might find useful? > > > Many Thanks > > Darryl > > -- > Darryl L. Miles > > > > - > 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]
ISAPI/JK redirector question
All, Is there a way to map an application to a back-end load-balanced/clustered tomcat farm from an IIS webserver such that an application deployed on the default host (i.e. deployed to the default "webapps" folder) can be addressed as a FQDN from the browser. For example: Application deployed at: http://tomcat00:8080/foo Can be reached by the end user at: http://www.myfancyname.com (Note that there is no "foo" on the end of that and the client has explicitly requested that this not show up.) I know that I can create a virtual host on Tomcat and deploy my app as "ROOT", but then deployment and application management becomes somewhat painful. I'd like to be able to manage all my apps with a single lambda probe or Tomcat manager installation. Thanks! Brantley Hobbs - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Configure JNDI resources in a separate file from server.xml
All, We're trying to lock down our infrastructure here. We want to avoid having production database credentials in the web application's context.xml, so we're going to move them to tomcat's server.xml. (We have read the JNDI How-To and have noted the recommendation to place resources in the app's context.xml.) My question is this: Is it possible to pull in an "include" file in server.xml? I'd like to place all the database connection information in a separate file. Thanks, Brantley Hobbs - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: database application
Cue Charles Caldarale hammering someone for not providing a Tomcat version in 3...2...1... Seriously, Eleonora...You should read here: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html Note particularly: *"Please note that JNDI resource configuration has changed somewhat between Tomcat 5.0.x and Tomcat 5.5.x.* You will most likely need to modify your JNDI resource configurations to match the syntax in the example below in order to make them work in Tomcat 5.5.x." Brantley - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: database application
LOL Absolutely no problem. Someone has to do it! B. Caldarale, Charles R wrote: From: Brantley Hobbs [mailto:[EMAIL PROTECTED] Subject: Re: database application Cue Charles Caldarale hammering someone for not providing a Tomcat version in 3...2...1... (Sorry I'm late, our marvelous corporate e-mail server didn't let the original message through.) Being precise is one of the things they taught us in Engineering at the real school 70 odd miles west of you... (Can't resist getting a dig in when a bulldog speaks :-) Seriously, Eleonora...You should read here: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html If she's using 5.5, then the config given is sadly out of date and conflicts with best practice ( elements, elements in server.xml, etc.). If it's a 5.0 version, then it's not supported, so moving up would be in order. What's even worse is the installation directory looks like one used by 3rd-party repackaged Tomcat versions, so getting it to work may be impossible. Installing a real Tomcat from http://tomcat.apache.org should probably be the first order of business. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Balancing solution which allows graceful partial node migrations
Rainer Jung wrote: Nikola Milutinovic wrote: So, what are your thoughts on the subject? Ever seen something like that in the wild? Or at least in the lab? A balancer that can be reconfigured (almost) online and one that allows for requests to the node being evicted to finish, first. Both actions are possible via the status worker GUI. What's missing is making the change persistent from the GUI. If you change a workers state only via the GUI and restart Apache, the change will be overwritten by the configuration on disk. So in order to make those changes persist over the next httpd restart, you'll also need to enter it into the config file. Chaning the status in mod_jk does not need you to restart (even gracefully) Apache though. The change applied via the status GUI will immediately become active for all Apache children. At the risk of thread-jacking, I have a couple of questions: 1. Does anyone have a CSS for the status worker output page that they'd like to share? The existing HTML is pretty hard to read. 2. Common sense says that the status worker URL should be secured. The documentation says that we are urged to use the builtin features of our webserver to secure the status worker. With apache this is trivial because apache can deal with the request before handing it off to mod_jk. With IIS, JK is implemented as an ISAPI filter. Because of this, JK traps any requests bound for a URI that it knows how to handle long before IIS can get a chance to secure it. Does anyone have a suggestion as to how to secure this thing using IIS? Thanks, Brantley Hobbs - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
"return" statements do not prevent the finally block from executing: http://java.sun.com/docs/books/tutorial/essential/exceptions/finally.html B. Johnny Kewl wrote: - Original Message - From: "sinoea kaabi" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Tuesday, September 16, 2008 5:10 PM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Yes, as I said in the first post, that I have checked through all the code, and I am closing all the connections (in a finally block) after they have been used. final Connection connection = datasource.getConnection(); try { BUT you have a return branches; HERE It can never get to HERE Just put the return after the finally blah .. blah } finally { connection.close(); } Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Date: Tue, 16 Sep 2008 11:02:46 -0400 From: [EMAIL PROTECTED] To: users@tomcat.apache.org At the end of the servlet or JSP or whichever, you need to kill off connections created that you establish. -Original Message- From: sinoea kaabi [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2008 9:56 AM To: Tomcat Users List Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing How exaclt do you mean? Anywhere in my code where you have seen that? Thanks! Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Date: Tue, 16 Sep 2008 10:26:03 -0400 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Sounds like you're not explicitly killing off the connections you set in the first place. -Original Message- From: sinoea kaabi [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2008 4:24 AM To: users@tomcat.apache.org Subject: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Dear all, I seem to have problems with connection pooling. I have tried so many ways, before I use to get the exhausted scenario, where there were no connections left to use, and now I am getting a different problem. I have been digging in this issue for too long, and I am not sure if I understand the depth of the connection pooling concept. I have set the max active connections to 40. My active connections keep increasing, they never seem to return back to the pool, eventhough when no-one is visiting the site. (Well, I have had up to 3 idle connections and that is the most I have ever had) After a few days, the active connections reach to 37, and then afterwards the active connections are reset to 0. It basically starts from 0 to 37 and then again 0 to 37, and so on My understanding is that: 1. An active connection is a connection that is currently used, and not yet returned back to the pool 2. An active connection will be returned back to the pool straight after its usage and become an idle connection The active connection is returned back to the pool as soon as you call the connection.close() method (assuming that you have configured for connection pooling) 3. An idle connection can only be idle for an X amount of time and then it will be removed from the pool and get destroyed 4. An idle connection will become an active connection when it is required and then returned back to the pool as an idle connection when calling connection.close() -- -- If that is all correct then why do my active connections keep increasing? -- -- Am I closing all the connections? Well, I have checked every single line of code, and yes I am closing result sets, statements and connections in a finally block: [code] } finally { results.close(); } } finally { statement.close(); } } finally { connection.close(); } [/code] Please have a look at my code and configuration below: My environment: JDK 1.5.0_12 Tomcat 5.5.27 MySQL 5 My Web apps context.xml under the META-INF folder: [code] name="jdbc/myDB" factory="org.apache.commons.dbcp.BasicDataSourceFactory" auth="Container" type="javax.sql.DataSource" maxActive="40" maxIdle="10" maxWait="15000" removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true" username="username" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/mydb" /> [/code] My Host configuration in server.xml [code] appBase="webapps/mysite" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false"> className="org.apache.catalina.valves.FastCommonAccessLogValve" prefix="mysite_access_log." suffix=".txt" pattern="common" directory="C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/mysite/logs"/> mysite.com [/code] Here is the class that I use the get the datasource [code] import... public class Data { priv
Re: hello world
Caldarale, Charles R wrote: From: news [mailto:[EMAIL PROTECTED] On Behalf Of thufir Subject: hello world I'm running Ubuntu: [EMAIL PROTECTED]:~$ I thought mentats weren't supposed to use computers... No matter what, the spice must flow. If it takes a computer, it takes a computer. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stop Hack attack
Mark Thomas wrote: Karthik Nanjangude wrote: Hi SPEC ( Single box) O/s : Unix 11 J2sdk : 1.6 DB : Oracle10g TOMCAT 6.0.18.0 RAM 16 GB A normal WEB application [ User id / Passwd for AAA ] on the following spec is successfully running LIVE [ non clustered mode ] Question : Some hacker is trying to bring the System down by polling the sending continuous HTTP request very frequently [ We logged the client IP address], The WEB application cannot be configured to HTTPS (Client disapproval) Is there any way within tomcat design to prevent the same from malicious attack? You can limit the impact on Tomcat by blocking them with a Remote Address Filter (http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html) However, the earlier you can block them the better. If you can block that IP at a firewall before they get to your box that would be better. Failing that block the IP with iptables (or the equivalent on your platform) on the server. HTH, Mark Mark is right. In any case, SSL wouldn't even slow this kind of attack down; it's only encryptionnot authentication. SSL will actually make it slightly worse since Tomcat has to work harder to decrypt and encrypt the traffic. Filtering by IP is a good solution here, but if this is your first publicly exposed website be prepared: This happens all the time, and the client IP's will be wildly different...you can't possibly filter them all. You might consider a good IPS between you and the Internet at large. One example of a good free solution is Untangle. You can buy support as well if it makes you more comfortable. There's also dedicated "appliances" for this as well. Brantley - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Communicating between webapps
Darryl Pentz wrote: I have an issue where webapp A needs to let webapp B know about an event, and then return a response to webapp B's processing of that event to the browser. So basically I need to communicate between webapps in the same container. I have not found a no-brainer solution to this as yet. The one I have tried is making a localhost HTTP call which I find to be rather expensive, given that it requires creating a socket connection to the same container. I also just encountered the 'crosscontext' attribute in the block and was wondering whether that could serve any purpose. Does anybody know of any tried and trusted ways of communicating between webapps in Tomcat? Thanks, Darryl Pentz If you think that this thing will scale at all, steer clear of any shared resources like JVM properties or magic files. It could be that in the future the apps won't run even in the same network, much less the same JVM. This is a classic SOA problem. My $0.02: If you're not transporting binary, might I suggest JSON? It's a whole lot less painful to configure (no XML or schemas), and there are Java JSON clients (jabsorb has one) that make it a snap to integrate into your project. It just works like magic. We've been using it with our projects for months now and are quite happy with it, both in terms of performance and ease-of-use. JSON does use HTTP transport, so if you're determined not to use HTTP, then it may not be for you. Brantley - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Lambda probe
Does anyone know what's up with Lambda probe? The site's been down for a while... Thanks, Brantley - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: send access log to remote server
Martin, I have a filter that logs to a database table. It could easily be modified to make log4j entries, which can then be tied to any valid log4j appender. B. Martin Strand wrote: Hi all. :) I want to make Tomcat send it's access log to a remote server (log4j or syslog). Configuring all other logging with log4j is pretty simple but it seems I can't do the same with the AccessLogValve. Do I need to write my own Valve in order to do that? Perhaps someone else has already done this? Thanks, Martin - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get the response status code?
Yair, I too would be interested in this. I wrote a logging filter that does what you describe, but the best that I could come up with was a response wrapper that was passed along the filter chain. In the wrapper, I could set a status, thus guaranteeing that I would end up with a status at the end. The wrapper extends HttpServletResponseWrapper. You may also find a wrapper useful because response sizes are not always set either, at least in my experience. With the wrapper, you can monitor the output stream to get a byte count. B. Yair Zohar wrote: Hello, I'm trying to create a filter that will do the access logging for my web application (I would like to write the information directly to the database not to a file). I have a problem to get the status code of the response. The filter receives a ServletResponse object that do not have a getStatus() method. Any idea ? Yair Zohar. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get the response status code?
No, the byte count doesn't actually have anything to do with the status code. I simply added that statement as another reason for using the wrapper. Sorry for the confusion. I agree with your earlier statement that sometimes the response code doesn't get set (or at least it gets set at some point farther downstream than the filters themselves). What I did with my wrapper class was create a protected variable named status and initialized it with 200. Then I overrode setStatus to look like this: public void setStatus(int sc) { status = sc; super.setStatus(sc); } And overrode getStatus to look like this: public int getStatus() { return status; } That way, I *always* get back a status code. It's assumed to be a 200, which might not necessarily be correct, but at least it's a valid code. This could be why the logging mechanism that comes with Tomcat was implemented as a valve; a response code may not necessarily be guaranteed to be set until the valve layer in the code. Response size is the same way, as far as I can tell, which is why you have to do a similar trick with it. I haven't torn apart the AccessLog valve source, so I'm only operating on assumptions here. For all I know, the AccessLog valve may do the same thing. Perhaps one of the old-timers could comment on this? I have source, if you're interested. B. Yair Zohar wrote: Hi Brantley, Thanks for replying. I've tried to pass a wrapper to the filter's chain, here is the wrapper's code: import java.io.IOException; import javax.servlet.http.*; public class TestResponse extends HttpServletResponseWrapper { private int statusCode; public TestResponse(HttpServletResponse response) { super(response); } public int getStatus() { return statusCode; } public void sendError(int errorCode) throws IOException { this.statusCode = errorCode; super.sendError(errorCode); } public void sendError(int errorCode, String errorMessage) throws IOException { this.statusCode = errorCode; super.sendError(errorCode, errorMessage); } public void setStatus(int statusCode) { this.statusCode = statusCode; super.setStatus(statusCode); } } I hopped tomcat will use the wrapper's setStatus() method and then I will be able to get the status code. What actually happened is that sometimes the status code returned was 0 and sometimes 404 or 304. It seems tomcat used the wrapper's setStatus() method only in part of the cases (maybe only when there was a problem getting the page). How does the byte count gives information on the status code ? How do you get the byte count from the output stream ? Yair. Brantley Hobbs wrote: Yair, I too would be interested in this. I wrote a logging filter that does what you describe, but the best that I could come up with was a response wrapper that was passed along the filter chain. In the wrapper, I could set a status, thus guaranteeing that I would end up with a status at the end. The wrapper extends HttpServletResponseWrapper. You may also find a wrapper useful because response sizes are not always set either, at least in my experience. With the wrapper, you can monitor the output stream to get a byte count. B. Yair Zohar wrote: Hello, I'm trying to create a filter that will do the access logging for my web application (I would like to write the information directly to the database not to a file). I have a problem to get the status code of the response. The filter receives a ServletResponse object that do not have a getStatus() method. Any idea ? Yair Zohar. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get the response status code?
Ahh.please ignore my last. I see that you're doing the same thing I mentioned (setting a private variable and returning that as the status). Is this not working for you? Brantley Yair Zohar wrote: Hi Brantley, Thanks for replying. I've tried to pass a wrapper to the filter's chain, here is the wrapper's code: import java.io.IOException; import javax.servlet.http.*; public class TestResponse extends HttpServletResponseWrapper { private int statusCode; public TestResponse(HttpServletResponse response) { super(response); } public int getStatus() { return statusCode; } public void sendError(int errorCode) throws IOException { this.statusCode = errorCode; super.sendError(errorCode); } public void sendError(int errorCode, String errorMessage) throws IOException { this.statusCode = errorCode; super.sendError(errorCode, errorMessage); } public void setStatus(int statusCode) { this.statusCode = statusCode; super.setStatus(statusCode); } } I hopped tomcat will use the wrapper's setStatus() method and then I will be able to get the status code. What actually happened is that sometimes the status code returned was 0 and sometimes 404 or 304. It seems tomcat used the wrapper's setStatus() method only in part of the cases (maybe only when there was a problem getting the page). How does the byte count gives information on the status code ? How do you get the byte count from the output stream ? Yair. Brantley Hobbs wrote: Yair, I too would be interested in this. I wrote a logging filter that does what you describe, but the best that I could come up with was a response wrapper that was passed along the filter chain. In the wrapper, I could set a status, thus guaranteeing that I would end up with a status at the end. The wrapper extends HttpServletResponseWrapper. You may also find a wrapper useful because response sizes are not always set either, at least in my experience. With the wrapper, you can monitor the output stream to get a byte count. B. Yair Zohar wrote: Hello, I'm trying to create a filter that will do the access logging for my web application (I would like to write the information directly to the database not to a file). I have a problem to get the status code of the response. The filter receives a ServletResponse object that do not have a getStatus() method. Any idea ? Yair Zohar. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get the response status code?
Yeah. I think that's what I ran across (I wrote that code more than a year ago). I think that's why I ended up initializing that internal variable to 200 so I'd be guaranteed to get something. It looks as if the AccessLog valve does something like this: import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; public void invoke(Request request, Response response) throws IOException, ServletException { //snip tons of string concatenation result.append("\" "); result.append(response.getStatus()); result.append(space); //snip rest of string concatenation and write to log } So, the AccessLog valve is using some "custom" wrapper around a request/response to do the same thing we're doing. What I'm guessing is that servlets aren't *required* to set a status, so it's possible that any attempt at a getStatus() can't be guaranteed to return anything, so it's just not implemented in either the spec or the reference implementation (tomcat itself). I've seen solutions that range from the technique that I use (set a value so you know that it's not in an indeterminate state) or even to grab the output stream and parse the status header out. Again, it's not clear if the status header has even been set yet. I think that what's happening is that tomcat wraps any requests/responses in that org.apache.catalina.connection.Request/Response object so that as a point of last resort it can set a status code if it hasn't been set already. I don't know if that's what the spec says to do or not. It certainly seems that if the spec doesn't *require* setStatus() to be called on an HttpServletResponse object, then there's a hole in the spec, IMHO. My $0.02 B. Yair Zohar wrote: Well, it does, partially. I sometimes get a non zero status code, but it's not zero only when there is an error (status code s: 404, 304). Yair. Brantley Hobbs wrote: Ahh.please ignore my last. I see that you're doing the same thing I mentioned (setting a private variable and returning that as the status). Is this not working for you? Brantley Yair Zohar wrote: Hi Brantley, Thanks for replying. I've tried to pass a wrapper to the filter's chain, here is the wrapper's code: import java.io.IOException; import javax.servlet.http.*; public class TestResponse extends HttpServletResponseWrapper { private int statusCode; public TestResponse(HttpServletResponse response) { super(response); } public int getStatus() { return statusCode; } public void sendError(int errorCode) throws IOException { this.statusCode = errorCode; super.sendError(errorCode); } public void sendError(int errorCode, String errorMessage) throws IOException { this.statusCode = errorCode; super.sendError(errorCode, errorMessage); } public void setStatus(int statusCode) { this.statusCode = statusCode; super.setStatus(statusCode); } } I hopped tomcat will use the wrapper's setStatus() method and then I will be able to get the status code. What actually happened is that sometimes the status code returned was 0 and sometimes 404 or 304. It seems tomcat used the wrapper's setStatus() method only in part of the cases (maybe only when there was a problem getting the page). How does the byte count gives information on the status code ? How do you get the byte count from the output stream ? Yair. Brantley Hobbs wrote: Yair, I too would be interested in this. I wrote a logging filter that does what you describe, but the best that I could come up with was a response wrapper that was passed along the filter chain. In the wrapper, I could set a status, thus guaranteeing that I would end up with a status at the end. The wrapper extends HttpServletResponseWrapper. You may also find a wrapper useful because response sizes are not always set either, at least in my experience. With the wrapper, you can monitor the output stream to get a byte count. B. Yair Zohar wrote: Hello, I'm trying to create a filter that will do the access logging for my web application (I would like to write the information directly to the database not to a file). I have a problem to get the status code of the response. The filter receives a ServletResponse object that do not have a getStatus() method. Any idea ? Yair Zohar. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get the response status code?
Martin, I'm afraid I don't understand. Would the request length be the same as the response? I'm totally not following. Brantley Martin Gainty wrote: Brantley- as the ServletResponse.getOutputStream() returning a javax.servlet.ServletOutputStream is not RLE (RunLengthEncoded) unless of course you implement some form of Tokenizer such as http://forum.java.sun.com/thread.jspa?threadID=734167&tstart=420 Quickest would be to call HttpServletRequest.getContentLength() and xmit variable back in the response Yair? M-- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tech support
David, Unless you really want to part with some money, perhaps you could take another swing at it. First, make sure you're configuring the ISAPI redirector correctly. I have attached the following example files for you: 1. A sample workers.properties file (this maps workers to tomcat instances). 2. A sample uriworkermap.properties file (this maps a given URL to a set of workers). 3. A .reg file that will set the thing up in the registry. You'll want to make sure to edit the paths and such to whereever you dropped your files. 4. A text document describing how to install all of this. You'll probably need to tweak some of it, but perhaps it can get you started. Second, check for this: http://marc.theaimsgroup.com/?l=tomcat-user&m=106251758316868&w=2 HTH, Brantley Liles, David - Kansas City, MO wrote: I have a new server (Windows 2003 / IIS 6) and Tomcat 5.5. I have spent the past three days trying to get IIS to forward java (.jsp and Struts .do) requests to Tomcat with no success. I am looking for someone who can remote in and configure the necessary settings. The configuration will need to be able to support multiple web site entries. Each web site will be a unique Tomcat host entry. Please contact me with questions and estimates. Thank you -David - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FROM: http://marc.theaimsgroup.com/?l=tomcat-user&m=106251758316868&w=2 snip [prev in list] [next in list] [prev in thread] [next in thread] List: tomcat-user Subject:Re: Win2003 IIS6 ISAPI filter problem From: John Turner Date: 2003-09-02 15:45:36 [Download message RAW] Excellent. Thank you for posting this, many IIS users have posted to the list trying to get the redirector to work with IIS 6. John Nick Tatham wrote: > I posted this thread back in June-03 as I was having problems making the > ISAPI \ > redirector work under IIS 6 on Windows 2003. Now thanks entirely to Andrew > Duey of \ > TerraScan Inc., I now have this working. > If you are using IIS V6, which ships with Windows Server 2003, you must allow > the \ > Web Service Extension to operate. Earlier versions of IIS did not require > this \ > step. > Using the IIS Internet Services Manager, click on the Web Services Extensions > item \ > in the left hand pane. In the right hand pane add a new Web Service Extension > \ > called, say, Tomcat ISAPI and browse and set the required file for this > extension \ > to the isapi_redirect.dll and set the status to allowed. Then restart IIS. > It appears that no changes are needed to the standard Tomcat ISAPI redirector > for \ > this version of IIS. > I hope this helps someone else. > > Nick > > -- > Nick Tatham > Peramon Technology Limited > +44 118 984 0506 > www.peramon.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] [prev in list] [next in list] [prev in thread] [next in thread] Configure | About MARC | Support MARC | Got a list to add? | 10East is Hiring! snipworker.list=lbAims,lbJSP worker.lbAims.type=lb worker.lbAims.balanced_workers=aims00 worker.lbJSP.type=lb worker.lbJSP.balanced_workers=goose worker.aims00.type=ajp13 worker.aims00.host=aims00.itos.uga.edu worker.aims00.port=8009 worker.aims00.cachesize=10 worker.aims00.cache_timeout=600 worker.aims00.socket_keepalive=1 worker.aims00.socket_timeout=300 worker.aims00.lbfactor=1 worker.aims01.type=ajp13 worker.aims01.host=aims01.itos.uga.edu worker.aims01.port=8009 worker.aims01.cachesize=10 worker.aims01.cache_timeout=600 worker.aims01.socket_keepalive=1 worker.aims01.socket_timeout=300 worker.aims01.lbfactor=1 worker.maverick.type=ajp13 worker.maverick.host=maverick.itos.uga.edu worker.maverick.port=8009 worker.maverick.cachesize=10 worker.maverick.cache_timeout=600 worker.maverick.socket_keepalive=1 worker.maverick.socket_timeout=300 worker.maverick.lbfactor=1 worker.goose.type=ajp13 worker.goose.host=goose.itos.uga.edu worker.goose.port=8009 worker.goose.cachesize=10 worker.goose.cache_timeout=600 worker.goose.socket_keepalive=1 worker.goose.socket_timeout=300 worker.goose.lbfactor=11. Check your workers.properties and uriworkermap.properties files for correctness. 2. Double-click "mod_jk_isapi.reg" and merge the new information into the registry. 3. Add the ISAPI filter to the webserver: a. Right-click "Web Sites" in the IIS manager and select "properties". b. On the "ISAPI Filters" tab, click "Add" c. For "Filter Name", type "Jakarta
Re: Global Footer Accross All Webapps
You could easily do it with tiles. An alternative would be to use a filter and append your footer to the output stream. B. Simon Stone wrote: I am trying to find a way to put some html text on the bottom of all pages across all webapps. So what i would like to acheive is when any page is displayed to a visitor at the bottom of the page, MY text is added without changing the files within the webapp's themselves. Basically a global footer page. An example of the footer page, would have the following information:- Powered by Apache Tomcat http://globalsite.com/images/tomcat.jpg border= My current structure is as follows:- Tomcat WebApp1 index.jsp page2.jsp WebApp2 index.jsp someotherpage.jsp WebApp3 index.jsp anyotherpage.jsp - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Global Footer Accross All Webapps
Doh. My coffee hasn't kicked in yet: I just noticed that you want one for every webapp, not just a single one. I wonder if you can do it with a valve. That's a tomcat specific thing, IIRC, so you might not be able to port that to some other container in the future. B. Simon Stone wrote: I am trying to find a way to put some html text on the bottom of all pages across all webapps. So what i would like to acheive is when any page is displayed to a visitor at the bottom of the page, MY text is added without changing the files within the webapp's themselves. Basically a global footer page. An example of the footer page, would have the following information:- Powered by Apache Tomcat http://globalsite.com/images/tomcat.jpg border= My current structure is as follows:- Tomcat WebApp1 index.jsp page2.jsp WebApp2 index.jsp someotherpage.jsp WebApp3 index.jsp anyotherpage.jsp - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Global Footer Accross All Webapps
http://struts.apache.org/1.x/struts-tiles/ A more structured replacement for plain-old JSP include statements. B. Simon Stone wrote: Sorry to be dim, what are tiles ? Brantley Hobbs-3 wrote: You could easily do it with tiles. An alternative would be to use a filter and append your footer to the output stream. B. Simon Stone wrote: I am trying to find a way to put some html text on the bottom of all pages across all webapps. So what i would like to acheive is when any page is displayed to a visitor at the bottom of the page, MY text is added without changing the files within the webapp's themselves. Basically a global footer page. An example of the footer page, would have the following information:- Powered by Apache Tomcat http://globalsite.com/images/tomcat.jpg border= My current structure is as follows:- Tomcat WebApp1 index.jsp page2.jsp WebApp2 index.jsp someotherpage.jsp WebApp3 index.jsp anyotherpage.jsp - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Log files always locked
Ultraedit also works. If I could threadjack here, I'd like to point out my own gripe with windows tomcat logging. Can we please make it out of the box log all stdout stuff to a *single* catalina.out file that doesn't roll over? That's a pain. I like to set up an icon to my log file, but I can't because it's always moving... My $0.02. B. Venkat Venkataramanan wrote: Johnny: I use Textpad to open the log file; if the log file is updated, it will automatically update the screen. Try that. -Original Message- From: Johnny Kewl [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 02, 2007 2:34 PM To: Tomcat Users List Subject: Log files always locked Just something that bugs me. On windows if you try open a tomcat log file... which are typically associated with something like notepad, you get "In Use By Another Program". Why does Tomcat lock the file handle indefinitely? It maybe good programming practice but windows utilities generally dont give one the option of "will open as read only"... its always a mission just to read a log file. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
httpd/JK/Tomcat hung connections
All, I have a web application that appears to run just fine at low loads, but when we ramp up to high load levels, strange things start happening. The symptoms are a *ton* of apparently hung threads on the tomcat status page for my JK connector. They're in stage "S", with 0KB sent and 0KB recv and they never die. Eventually, we reach a point on httpd where we get: [error] server reached MaxClients setting, consider raising the MaxClients setting And when we reach this point, the entire httpd server stops responding. I post this to the tomcat list because this same server serves PHP under similar (or worse) loads with no problems. Here's my worker properties file: worker.lbJ2EE.balanced_workers=web1 worker.web1.type=ajp13 worker.web1.host=128.192.100.14 worker.web1.port=8009 worker.web1.lbfactor=1 worker.web1.retries=5 worker.web1.connection_pool_timeout=60 Here's my AJP connector's configuration: protocol="AJP/1.3" maxThreads="1500" backlog="300" connectionTimeout="6"/> Here's my httpd worker.c configuration StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 Tomcat 5.5.23 (Sun jvm 1.6.0-b105) Apache 2.0.52 mod_jk 1.2.6 All running on RHEL4 Any help appreciated! I don't have a great deal of Tomcat load tuning experience. Brantley Hobbs - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: httpd/JK/Tomcat hung connections
Rainer, Thanks for the reply! You're certainly right on the JK version. Can you be more specific on the "add some more timeouts" comment? Do you mean a higher number on connection_pool_timeout? Also, should the relationship between httpd's MaxClients and the connector's maxThreads be 1:1 or what? The httpd server does do additional work besides simply front-ending Tomcat, so I'd assume that we'd want MaxClients to be at least the same as MaxThreads, and probably much more depending on how much additional work the httpd server does. Is this reasonable? I'm just trying to get a handle on the relationships. Thanks, Brantley Rainer Jung wrote: Please update mod_jk. 1.2.6 is *very* outdated. We are now at 1.2.22 and a lot of things have improved. After upgrading, check your configuration against the reference guide in the docs, especially the pages for the worker properties and Apache directives. You might want to add some more timeouts. BTW: Maximum Apache parallelity of 150 does not really fit to a maximum tomcat parallelity of 1500 unless your tomcat does serious extra work . Regards, Rainer Brantley Hobbs wrote: All, I have a web application that appears to run just fine at low loads, but when we ramp up to high load levels, strange things start happening. The symptoms are a *ton* of apparently hung threads on the tomcat status page for my JK connector. They're in stage "S", with 0KB sent and 0KB recv and they never die. Eventually, we reach a point on httpd where we get: [error] server reached MaxClients setting, consider raising the MaxClients setting And when we reach this point, the entire httpd server stops responding. I post this to the tomcat list because this same server serves PHP under similar (or worse) loads with no problems. Here's my worker properties file: worker.lbJ2EE.balanced_workers=web1 worker.web1.type=ajp13 worker.web1.host=128.192.100.14 worker.web1.port=8009 worker.web1.lbfactor=1 worker.web1.retries=5 worker.web1.connection_pool_timeout=60 Here's my AJP connector's configuration: protocol="AJP/1.3" maxThreads="1500" backlog="300" connectionTimeout="6"/> Here's my httpd worker.c configuration StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 Tomcat 5.5.23 (Sun jvm 1.6.0-b105) Apache 2.0.52 mod_jk 1.2.6 All running on RHEL4 Any help appreciated! I don't have a great deal of Tomcat load tuning experience. Brantley Hobbs - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: httpd/JK/Tomcat hung connections
Rainer, Thanks for all the info. Hopefully we can get this thing whipped into shape. Brantley Rainer Jung wrote: Brantley Hobbs wrote: Rainer, Thanks for the reply! You're certainly right on the JK version. Can you be more specific on the "add some more timeouts" comment? Do you mean a higher number on connection_pool_timeout? Have a look at connect_timeout and prepost_timeout. Usually I also use reply_timeout, but this one not with a very low limit. You connection_pool_timeout looks OK, you might want to increase it for efficiency, but that's not critical. Also, should the relationship between httpd's MaxClients and the connector's maxThreads be 1:1 or what? The httpd server does do additional work besides simply front-ending Tomcat, so I'd assume that we'd want MaxClients to be at least the same as MaxThreads, and probably much more depending on how much additional work the httpd server does. Is this reasonable? I'm just trying to get a handle on the relationships. You are exactly right. Usually the extra work done by Apache is high concerning request counts (e.g. if Apache serves all the static contents), but most of the extra work is done very quickly. So in case you've got 1 Apache and 1 Tomcat, and Apache only serves additional small static content, you can keep the numbers in sync. If there is a n:1 or 1:n relationship (n>1), you might need to adjust. If Apache serves long running downloads or scripts, you might also need to give it more allowed parallelity than tomcat. MaxThreads bigger than MaxClients is mostly the case, if you have 2 Apache, 2 Tomcat and each Apache can use both Tomcats. Then you would choose MaxThreads close to 2*MaxClients, so that in case you need to shut down one of your tomcats, the other one will still be able to accept enough connections from both Apaches. Thanks, Brantley Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JK Connector "errors" under heavy load
All, I'm doing some load testing and I'm having a bit of trouble trying to interpret the numbers on the Tomcat Manager's "Server Status" page. Specifically, each defined connector (http or jk) has a block telling you the values of maxThreads, minSpareThreads, etc. In my testing, I've found that I start getting some errors under heavy load and the "Error count" number starts going way up on my JK connector. Can someone tell me what "Error count" indicates? Additional symptoms are that Tomcat appears to not have properly associated a session with an incoming user (it doesn't get the wrong session, it appears to get a new, empty session). When I first started seeing this, I found that I was bumping up against maxThreads, but now I have maxThreads sitting at approximately 125% of the number of users I'm using to test, and I'm getting this same issue. I'm unsure of where else to start looking for bottlenecks now. I'm not CPU, I/O or database bound, but there's no other log entries. For the record, it's Apache 2.0.52/mod_jk 1.2.22/Tomcat 5.5.23. Thanks, Brantley Hobbs - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Servlet or filter (or valve) that acts like mod_jk
All, I have rather an odd situation that I'm hoping someone can give me some advice on. Short version: I need to know if there's a servlet, filter or valve that can be used to provide the same functionality as mod_jk does for Apache. In other words, I want to map certain requests to a JK connector running on a different servlet container. Long version: I have a third-party web application deployed that generates some specific content (in this case maps). For licensing reasons, I can only deploy this web application in a couple of places. Now, our developers are all running tomcat locally. Our applications that consume these maps embed them in iframes. Of course, because of cross-domain security restrictions, javascript interaction between the two frames causes problems. For security and ease-of-admin reasons, we don't want to install Apache/mod_jk locally. What I would like is something that I can plug in to Tomcat to allow requests for this third party software to be passed off to a different servlet container. If I can do this, then the cross-domain issue goes away completely (there's also a good shot at getting rid of the iframe completely). I have found a couple of proxy servlets out there, but they seem somewhat limited (only process GET requests, etc). My thought was that if there was a servlet that spoke JK, then you could simply map requests to that servlet through to the JK connector on another servlet container, just like Apache/mod_jk does. Am I out of my mind or what? Thanks, Brantley - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet or filter (or valve) that acts like mod_jk
JMeter includes an AJP13 client. I would expect that to be overkill though. I also do not know of any fully featured Java based reverse proxy servlet. In your case, you might be able to write something reasonable on top of httpclient for the HTTP protocol (using http to the backend and not AJP13). It's not trivial, because e.g. you can't simply forward all HTTP headers (some of them indicate prtocol features, and if you forward them you need to configure your backend connection to be in compliance with what the headers indicate - example: connection keep alive handling). Nevertheless, if you understand the cases for which you actually need the forwarding good enough and they are limited in variation, it might be best to write the servlet from scratch using httpclient for the protocol part. Tim: Thanks for the reply. The proxy implementation you recommended didn't seem to work (it supplied redirects instead of actually proxying). The documentation was somewhat ill maintained, which kind of compounded the problem. Unfortunately the project seems to be abandoned, so I'm going to have to move on to something else. It's probably quicker to write something up as a servlet (as Rainer recommended) than dig through source to try to figure it out. I do appreciate the link though. Rainer: Thanks for the suggestion. I think that might be what I end up with*sigh*. B. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can i configure tomcat to avoid threads error in tomcat
Prashant, Unless I'm load-testing, the only time I've seen thread counts that high is when something is wrong with the app, and it's usually a database connection that hasn't been closed. Check the number of database connections in use out of the pool (this is typically something that you'd do on the database server itself; I don't know of any mechanism in Tomcat to get that measurement). If that is also an extraordinarily large number, then you might consider checking for database connections that haven't been closed. For typical sites, you really don't usually need a database connection pool any larger than a few tens of connections. What happens is that the database connection pool (or the database server itself) exhausts its supply of connections, and new requests that come in to Tomcat queue until more connections come open or the connection requests time out. Good luck. B. Prashant Thakkar wrote: Hi, Thanks, But this is the clients application which we are running. We dont have the access to the servlet code. That was the the obvious reason we had increased the thread limit to 250. Other thing i would like to know is about the thread pooling. How can i use this with tomcat 5.0.28 Below is the connector which we are using: Thanks and Regards, - Prashant Thakkar On 6/19/07, Robert Harper <[EMAIL PROTECTED]> wrote: Do as it says and increase the max threads parameter or manage your threads better. Robert S. Harper Senior Engineer Information Access Technology, Inc. 1100 East 6600 South, Suite 300 Salt Lake City Utah USA 84121-7411 (801)265-8800 Ext. 255 FAX (801)265-8880 This e-mail is intended only for the addressee and may contain confidential and/or privileged information. Any review, retransmission, or action taken upon this information by persons other than the intended recipient is prohibited by law. If you received this communication in error, please contact us immediately at 801-265-8800. Although this e-mail and any attachments are believed to be free of any virus or other defect, it is the responsibility of the recipient to ensure that anything received or opened is virus free. No responsibility is accepted by IAT for any loss or damage in the event that such a virus or defect exists. -Original Message- From: Prashant Thakkar [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 19, 2007 7:25 AM To: users@tomcat.apache.org Subject: How can i configure tomcat to avoid threads error in tomcat Hi All, I am frequently getting this error in tomcat which stops my tomcat service. Pl help me its urgent and costing my service as well: I am getting bellow error in my catalina logs: Jun 19, 2007 5:55:44 PM org.apache.tomcat.util.threads.ThreadPool logFull SEVERE: All threads (250) are currently busy, waiting. Increase maxThreads (250) or check the servlet status Thanks in advance - Prashant Thakkar - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Null
Mohammed, While it may not work in all browsers, you can try the "empty-cells" CSS property in the table's style. Render the table tag thusly: ... An alternative is what the other guy said; simply check for nulls before rendering, and render a non-breaking space if you have a null. I'd shoot for using EL rather than pure java for that though. Good luck! Brantley Mohammed Zabin wrote: Hi All Anyone knows how to deal with null values in JDBC ResultSet?? I am trying to render a table in jsp page that read its value from the database, sometimes, the database returns null values, and so, the whole table couldn't be rendered. Is there any way to deal with null values. Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping busy site responsive
Clinton, I implemented this as a filter/listener combination. The listener tracks session initialized events and increments an atomic Integer (decrementing it at session destroyed), saving it as a context attribute. The filter uses the following logic: 1. If we're less than or equal to the number of allowed sessions, allow this one through. 2. If we've exceeded the limit, check to see if this user already has an established session (using the request's getSession(false) call). If they have an established session, allow them through. 3. If they don't match either of the above, send them a redirect to a page letting them know to try back later. This approach seems to work well (at least until the box staggers to a halt simply issuing redirects). I've hit a box with numbers that are at least double what the limit is and the people that have established sessions don't notice a thing. Because it's simple filters and listeners, it should be fairly portable. I've attached the source with this mail. There might be a couple of dependancies you can get rid of (like our log manager class), but it should be pretty easy to drop in. Hope this helps. B. Parham, Clinton wrote: Tomcat Experts: How do I keep my web application responsive for users already half way through an enrollment process when traffic volume is high? Here's the scenario: I have a set of 5 web pages that users must work through to successfully enroll themselves. Assume the server can handle 250 concurrent requests (maxThreads). While traffic volume is under 250, enrollments complete normally. But once volume exceeds 250 and saturates the acceptCount/backlog queue, users half way through enrollments cannot complete their enrollment (connections are refused) because new users keep bombarding the site. What would be acceptable is for new users to see a 'site is busy message' while enrollments in progress are completed. As enrollments complete and concurrent threads drop below 250, new users are allowed through. I have already considered maxActiveSessions but I don't think this will solve the problem. If maxThreads is reached and the acceptCount/backlog queue is exhausted, then the users with active sessions and already partly through enrollment won't be able to get back in to the site to complete their enrollment - right? Adding more servers to handle the load is not preferred because most of the time they will be underutilized. Enrollments that experience high traffic don't happen that often but when they do, we need to support them. Thank you for your time. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] /* * UserLimitFilter.java * * Created on May 11, 2007, 8:27 AM */ package edu.uga.asg.apojee.web.util; import edu.uga.asg.apojee.logging.Log; import edu.uga.asg.apojee.logging.LogManager; import edu.uga.asg.apojee.logging.LogCategory; import java.util.concurrent.atomic.AtomicInteger; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import javax.servlet.http.HttpSession; /** * * A [EMAIL PROTECTED] Filter} which, in combination with the [EMAIL PROTECTED] SessionCountListener}, * limits the number of active sessions for a context. * * * * * * Filter [EMAIL PROTECTED] init-param}s * * * [EMAIL PROTECTED] param-name} * [EMAIL PROTECTED] param-value} (example) * Description * Required? * Default * * * * * [EMAIL PROTECTED] enabled} * false * determines whether or not the filter is applied * No * true * * * [EMAIL PROTECTED] redirectURL} * http://www.google.com/search?hl=en&q=too+many+users * the URL sent in a header redirect when the user limit is exceeded * Yes * N/A * * * [EMAIL PROTECTED] userLimit} * 50 * the maximum number of active sessions that may exist at one time * Yes * N/A * * * * * @author Brantley Hobbs (UGA ASG) * @since APOJEE Core 1.0.1 */ public class UserLimitFilter implements Filter { private static final Log log = LogManager.getLog(LogCategory.APPLICATION); private String className = this.getClass().getName(); private boolean enabled = true; private String redirectURL = null; private Integer userLimit = null;
Re: Keeping busy site responsive
You know, I hadn't given it a lot of thought to be honest. I think that for accuracy's sake it should probably be a 500 error (I assume that 503 is a server busy error or something; don't know it off the top of my head). An actual redirect error could confuse a browser. I'd assume that for optimal performance you'd want to redirect to another machine, but there's nothing enforcing this. If you're using Apache or IIS as a localhost front-end, you could redirect to a URI that's being served by the web server. This is likely to be a low-cost operation. Brantley Nelson, Tracy M. wrote: | From: Brantley Hobbs [mailto:[EMAIL PROTECTED] | Sent: Wednesday, 27 June, 2007 12:37 | | This approach seems to work well (at least until the box staggers to a | halt simply issuing redirects). Just out of curiosity, do you think it would help in those situations to issue a 503 instead of a 307? Or do you redirect to another machine for the busy page? - The information contained in this message is confidential proprietary property of Nelnet, Inc. and its affiliated companies (Nelnet) and is intended for the recipient only. Any reproduction, forwarding, or copying without the express permission of Nelnet is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this e-mail. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping busy site responsive
I should say "an actual redirect response code could confuse a browser". B. Brantley Hobbs wrote: You know, I hadn't given it a lot of thought to be honest. I think that for accuracy's sake it should probably be a 500 error (I assume that 503 is a server busy error or something; don't know it off the top of my head). An actual redirect error could confuse a browser. I'd assume that for optimal performance you'd want to redirect to another machine, but there's nothing enforcing this. If you're using Apache or IIS as a localhost front-end, you could redirect to a URI that's being served by the web server. This is likely to be a low-cost operation. Brantley Nelson, Tracy M. wrote: | From: Brantley Hobbs [mailto:[EMAIL PROTECTED] | Sent: Wednesday, 27 June, 2007 12:37 | | This approach seems to work well (at least until the box staggers to a | halt simply issuing redirects). Just out of curiosity, do you think it would help in those situations to issue a 503 instead of a 307? Or do you redirect to another machine for the busy page? - The information contained in this message is confidential proprietary property of Nelnet, Inc. and its affiliated companies (Nelnet) and is intended for the recipient only. Any reproduction, forwarding, or copying without the express permission of Nelnet is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this e-mail. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keeping busy site responsive
Clinton, I think it might be worth your trouble to find out what number it is that causes the box to "[stagger] to a halt issuing redirects". I started having network saturation on the little switch I was using for my test rig before the load started getting bad on the box. I don't have the exact numbers in front of me. I think Len was referring to the F5 key on your keyboard (it being the hotkey for the browser to refresh the page). One thing to keep in mind with a hardware load balancer to make this decision for you is that for it to know if you have an already established session it will need to examine the inbound request, AFAIK. If you're using SSL, you'll need a load-balancer capable of terminating the SSL connection. I really think it might be worth your while to simply try the filter first. B. Parham, Clinton wrote: Thank you everyone for your input so far. Brantley: I like the idea but the part about 'staggering to a halt issuing redirects' is a concern. If this were to happen, then even users with established sessions would have trouble getting through - right? I think the same applies to Tracey's suggestion. Maybe Christopher is on the right track where some sort of load balancer is the best solution. One that's smart enough to allow established sessions through and maybe redirect new ones while the server is at peak load. This would avoid Tomcat from having to deal with traffic it cannot handle/trying to issue redirects. Does anyone have any experience/recommendations setting something like this up? Len hinted at F5 - not sure we can afford that... Len: which F5 and how much?? -----Original Message- From: Brantley Hobbs [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 27, 2007 1:37 PM To: Tomcat Users List Subject: Re: Keeping busy site responsive Clinton, I implemented this as a filter/listener combination. The listener tracks session initialized events and increments an atomic Integer (decrementing it at session destroyed), saving it as a context attribute. The filter uses the following logic: 1. If we're less than or equal to the number of allowed sessions, allow this one through. 2. If we've exceeded the limit, check to see if this user already has an established session (using the request's getSession(false) call). If they have an established session, allow them through. 3. If they don't match either of the above, send them a redirect to a page letting them know to try back later. This approach seems to work well (at least until the box staggers to a halt simply issuing redirects). I've hit a box with numbers that are at least double what the limit is and the people that have established sessions don't notice a thing. Because it's simple filters and listeners, it should be fairly portable. I've attached the source with this mail. There might be a couple of dependancies you can get rid of (like our log manager class), but it should be pretty easy to drop in. Hope this helps. B. Parham, Clinton wrote: Tomcat Experts: How do I keep my web application responsive for users already half way through an enrollment process when traffic volume is high? Here's the scenario: I have a set of 5 web pages that users must work through to successfully enroll themselves. Assume the server can handle 250 concurrent requests (maxThreads). While traffic volume is under 250, enrollments complete normally. But once volume exceeds 250 and saturates the acceptCount/backlog queue, users half way through enrollments cannot complete their enrollment (connections are refused) because new users keep bombarding the site. What would be acceptable is for new users to see a 'site is busy message' while enrollments in progress are completed. As enrollments complete and concurrent threads drop below 250, new users are allowed through. I have already considered maxActiveSessions but I don't think this will solve the problem. If maxThreads is reached and the acceptCount/backlog queue is exhausted, then the users with active sessions and already partly through enrollment won't be able to get back in to the site to complete their enrollment - right? Adding more servers to handle the load is not preferred because most of the time they will be underutilized. Enrollments that experience high traffic don't happen that often but when they do, we need to support them. Thank you for your time. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [E
Re: Serving ActiveX from Tomcat ?
With stuff like this, I've had good success simply using telnet and a manual GET to see what the correct headers are supposed to look like. A sniffer would work just as well. Good luck! Brantley Dick Eastin wrote: Hi - Sorry to be asking a dumb question; but, maybe the answer is simple and fast and will save me even more hours. I'm serving a dll from webapps/ROOT to IE. I have added the mime type for the .dll as application/octet-stream to the server's web.xml (same as apache's mime type). The component seems to arrive at IE; but, does not render visually nor recognize function/parameter access. This has been tested on 4.0.6 and 5.5.17. (also tried a recommended mime type application/x-msdownload I think it was.) It works fine served from Apache. Any clues ? Thanks, Dick - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6 Admin Application
JMX? I'm intrigued by your idea and would like to subscribe to your newsletter. Is there a "canned" application that can use JMX to provide similar information as the old admin app? Thanks, Brantley Mark Thomas wrote: Fredy Provoste wrote: Hi there, i want to know if there's any admin application (like in Tomcat 5) for Tomcat 6 available??, i've lookin in tomcat 6 source code with no luck The short version is no. The long version is that the one in 5.5 wasn't being maintained so it wasn't keeping up with new attributes, features etc. The intention is to use jmx instead. You should be able to do most things this way. Anything you can't, patches are always appreciated ;) Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat not using multiple cores
I think that this is a garbage collection issue. Enable the garbage collection output to see if that's the case (the "-verbose:gc" flag) . I struggled with this myself just a month ago and ended up learning more about Java GC than I ever wanted to know. The gist of it is that when the JVM runs out of heap memory and does a major collection, it will pause all threads while it's collecting. It doesn't matter what the priority of the thread is or whether or not you are using a parallel GC. As you approach heap memory limits, the GC is working its tail off trying to recover memory wherever it can, pausing all JVM activity as necessary. I have a feeling that you'll see more and more GC calls as the app grinds to a halt. A couple of points: Disabling GC hints can sometimes dramatically increase performance if you're not actually running out of memory. Don't assume that just because *your* code isn't requesting a collection that a third-party library isn't. As someone pointed out elsewhere, you're going to want to switch to a 64 bit OS and JRE at some point, if you want to take full advantage of all that RAM. In case you're curious, these are the JRE flags that we ended up running with: -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+DisableExplicitGC -XX:+UseAdaptiveSizePolicy -XX:MaxPermSize=512m (Obviously the MaxPermSize flag is dependent on how your applications allocate memory.) A profiler will be helpful too. I've had some success using the one built-in to Netbeans. Good Luck! Brantley Matthew Laird wrote: We're pulling our hair out with a Tomcat issue. We have an in-house application running on Tomcat 5.5 with Sun JDK 1.6. The machine is an x86 dual-CPU, quad core (8 cores total) with 16GB of RAM. We're running OpenSuSE 10.2, 32-bit. Java memory size set to 2GB, multi-threaded GC enabled. What occurs is when a user clicks a certain kind of analysis on the website, data is retrieved from a database and then a lot of formatting is done before returning it to the user. This typically causes 100% CPU usage for this thread for a few minutes (bioinformatics application, that part isn't going to change). Unfortunately what then occurs is all other threads suddenly become unusably slow. The entire web application grinds to a halt until this thread that's running hot completes. Looking at top, it appears that these threads aren't spreading among all the cores. I see one core go to 100% usage, and the others stay at 100% idle. So we're running multi-thread, but because everything is staying on the same core, we're still getting thread contention that's bringing the entire application to its knees. The only time I began to see the other cores actually start being used is when I enabled multi-threaded GC. But that doesn't give much improvement since the threads responding the web requests are still all on the same core. I'm not sure how to convince the Tomcat/Java container to spread its threads among the cores. Thanks. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat not using multiple cores
This will be a helpful document: http://java.sun.com/docs/hotspot/gc5.0/ergo5.html Brantley Matthew Laird wrote: We're pulling our hair out with a Tomcat issue. We have an in-house application running on Tomcat 5.5 with Sun JDK 1.6. The machine is an x86 dual-CPU, quad core (8 cores total) with 16GB of RAM. We're running OpenSuSE 10.2, 32-bit. Java memory size set to 2GB, multi-threaded GC enabled. What occurs is when a user clicks a certain kind of analysis on the website, data is retrieved from a database and then a lot of formatting is done before returning it to the user. This typically causes 100% CPU usage for this thread for a few minutes (bioinformatics application, that part isn't going to change). Unfortunately what then occurs is all other threads suddenly become unusably slow. The entire web application grinds to a halt until this thread that's running hot completes. Looking at top, it appears that these threads aren't spreading among all the cores. I see one core go to 100% usage, and the others stay at 100% idle. So we're running multi-thread, but because everything is staying on the same core, we're still getting thread contention that's bringing the entire application to its knees. The only time I began to see the other cores actually start being used is when I enabled multi-threaded GC. But that doesn't give much improvement since the threads responding the web requests are still all on the same core. I'm not sure how to convince the Tomcat/Java container to spread its threads among the cores. Thanks. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat not using multiple cores
This is the exact thing that makes me think that that's the problem. I saw the exact same symptoms: No matter how many CPU's I threw at it and no matter how I threaded my app, I was only consuming one CPU in total. I know it sounds counter-intuitive, and I could easily be wrong (I'm no JVM memory expert), but this is almost verbatim the exact same problem I had, and it was solved with GC tuning. I'm no gambler, but if I were I'd be willing bet that when he enables GC verbose output that he'll see more and more time going to major collections. Brantley Caldarale, Charles R wrote: From: Brantley Hobbs [mailto:[EMAIL PROTECTED] Subject: Re: Tomcat not using multiple cores I think that this is a garbage collection issue. Extremely unlikely, since the OP has already stated: "The only time I began to see the other cores actually start being used is when I enabled multi-threaded GC. But that doesn't give much improvement since the threads responding the web requests are still all on the same core." The most likely cause is internal synchronization in the webapp or the database it references. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat not using multiple cores
Matt, Chuck is right. You want to get real information. Try the verbose GC output flag on the JVM and see what that says. If you /don't/ see a bunch of major collections in the output while that task is running, then GC is not your problem. B. Caldarale, Charles R wrote: From: Matthew Laird [mailto:[EMAIL PROTECTED] Subject: Re: Tomcat not using multiple cores But of course I'm not a Java or JVM expert and have no idea what kind of interlinks can exist between different client connections. Again - get a thread dump when at 100% on one core and 0% on the others so you will have real information rather than speculation. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to watch active sessions size
btw, how does lambdaprobe does it? I mean the size? Chuck will surely correct me on that, but the actual size of an object is extremely dependent on the VM implementation (boolean stored in integer, object header overhead, and so on...) I once tried to create a sizeof util, and it works within an error of 100 bytes per object (which is not very accurate) and based on approximation. IIRC, Lambdaprobe gives you an estimate of size. It's not guaranteed to be correct. And I've seen it be off so wildly that I don't know if I'd ever trust it. I've seen it report session objects with sizes of 3.5TB(!). B. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 11 recommendations for posters to this list
12) Be sure to top post. I LOL'd. André Warnier wrote: Dear Posters, if you want to get fast, terse, to-the-point answers on this list : 1) start with a subject like "Tomcat does not work" That always gets immediate attention. It does not really matter if the problem is really in Tomcat, or in your application, or in something else altogether. If there is a Tomcat on your machine, or if you even suspect that there might be a Tomcat somewhere in the network, go ahead and use this subject. 2) write it in CAPITALS, and add a couple of !! exclamation marks on each side !! Be creative, the point is to get immediate attention. 3) start the text with "I need help A.S.A.P. !!". In many email programs, you can also write this in *bold*, for even greater effect. Alternatively, permute (1) and (3). 4) Be rude. Something like "I doubt it, but just in case one of the highly-paid smartasses on this list would know .." will do fine. 5) mention that this is a Tomcat 3.5 pre-packaged for Ubuntu. Alternatively, a Tomcat 4 package for Windows, installed by a friend and running under xy-wrapper will do. Most effective : you installed SuperShare 7.2 for Vista, and you read on a forum somewhere that it has a Tomcat in it. 6) People on this list are like big kids, they love to guess. So apart from the above, do not add any information such as operating system, platform, host, versions or anything. Don't mention that you are using gcj. 7) Just say that it doesn't work. If asked for more details, respond "I click on my browser and it doesn't work". Don't add silly details about what doesn't work or when, error messages, logfiles snippets, anything like that, it just confuses things. If pressed, insist that on your system, Tomcat does not write logfiles. 8) mention that you changed the classpath, and that you put elements in your configuration file (don't say which one, wait to be asked). Note the lowercase c in . 9) you can mention also that you copied your application libraries (those .jar file thingies) everywhere you saw other ones, but that it still doesn't work. Popular locations are tomcat/common/lib, tomcat/shared/lib, and tomcat/bin. But keep this information for your second post. 10) Never, ever say please, or thank you. Instead, ask if someone can unsubscribe you from this list. 11) Do not sign Angelica C. Computer Student Italy as that would seriously weaken the effect of all of the above. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]