You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Lai, Harry" <HL...@coremetrics.com> on 2002/02/15 17:21:13 UTC

Images slow, even if not processed by Cocoon

Hi all,
 
I'm running into an odd Cocoon problem, and I was hoping someone could give
me some insight.  Here's the problem:
 
QUICK SUMMARY
I'm using Cocoon 2.0.1 as one servlet in a web app that uses multiple
servlets.  For some reason, once the Cocoon servlet loads, all image
requests are incredibly slow, even though Cocoon is not processing the image
requests.
 
ENVIRONMENT
I'm running this on Win2k, with JBoss2.4.1b (with Tomcat 3.2.3 embedded).
I'm using the official release of Cocoon 2.0.1.
 
DEPLOYMENT DETAILS
I'm deploying an ear into JBoss.  Within that ear, I have a war (foo.war).
In foo.war, I have Cocoon (using the standard cocoon.xconf) and another
servlet (MyServlet).  My servlet mappings in web.xml look like this (just
FYI, Cocoon's servlet is declared in my web.xml exactly as it is in the
web.xml that ships with 2.0.1):
 
    <servlet-mapping>
        <servlet-name>MyServlet</servlet-name>
        <url-pattern>/MyServlet</url-pattern>
    </servlet-mapping>
 
    <servlet-mapping>
        <servlet-name>MyServlet</servlet-name>
        <url-pattern>/MyServlet/*</url-pattern>
    </servlet-mapping>
 
    <servlet-mapping>
        <servlet-name>Cocoon2</servlet-name>
        <url-pattern>/cocoon</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
        <servlet-name>Cocoon2</servlet-name>
        <url-pattern>/cocoon/*</url-pattern>
    </servlet-mapping>
 
Within that war's WEB-INF directory, I have an images directory.  I've tried
referencing those images via both:
    * src="images/image_name.gif"
    * src="/images/image_name.gif"
 
Neither of these image requests should go through Cocoon, based on the
servlet mappings in my web.xml file.  Here's what I'm seeing, though.
 
When I use a browser to send requests to either Cocoon or MyServlet, any
images in the resulting HTML page render extremely slowly.  In addition, I
have a static HTML page that has 10 small gifs on it.  When I request that
(not served by either of my servlets), the images load extremely slowly -
looking at the task manager, just processing that 10-image page causes my
java process to go up to 90%+ CPU utilization.
 
HOWEVER, if I change the web.xml and remove the load-on-startup element (set
to 1 in the default web.xml), I see something interesting.  In this
configuration, Cocoon doesn't load until I request something that maps to
the Cocoon servlet.  So, I start JBoss, and request both the static image
page and a page that is served by MyServlet.  Interestingly, images load
fine, no problem at all; response time is fast, and CPU utilization is
minimal.  However, as soon as I request a page that is served by Cocoon
(which causes the Cocoon servlet to load), I get the same slow images
problem on that page.  Plus, I now get the slow images problem on the static
image page and the page served by MyServlet.
 
I've done a bunch of looking at this, but to be quite honest, I'm at a loss
as to why Cocoon's loading is having such a global impact on image requests
(as a sidenote, it doesn't seem to be slowing down the actual processing by
MyServlet - just the image requests).  One possibility I've considered is
that maybe Cocoon is grabbing a ton of threads (or other resources) and not
releasing them?  Anyways, any help you could provide would be much
appreciated.  Thanks in advance!
 
Harry

-------------- 
Harry Lai 
hlai@coremetrics.com 
512.342.2623 x2170 

 

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>