Are you using a web server with Tomcat? If so, have you tried serving
the images from the web server.
E.g. in Apache
Alias /images /somepath/images
and then use /images/imageFile.gif in for your <img/> tags.
...Peter
Lai, Harry writes:
> Hi all,
>
> I still haven't solved this, but I have a little bit more data now.
>
> * I've been able to reproduce this on a Linux box (Redhat 7.0.1, kernel
> 2.4.10), so it's not Win2k-specific.
>
> * If I comment out the entire contents of the CocoonServlet's init() method,
> the images render noticeably faster, but still slower than without Cocoon
> (this is with Cocoon still loading on server start, but without directly
> requesting anything from the Cocoon Servlet). Considering the init() method
> does nothing now, I'm really confused why there's any global impact at all
> now.
>
> * Overall resource consumption (memory and threads) is low, so my resource
> contention theory seems unlikely.
>
> * Our existing web application (the one I'm trying to integrate Cocoon into)
> uses log4j for logging, and we have our own configurations for it. I'm not
> very familiar with log4j, but is it possible that there's some conflict
> between our log4j settings and Cocoon's?
>
> Anyway, this is rapidly becoming a showstopper issue for us. If anyone has
> ideas on what might be the cause of this slowdown, I'd really appreciate it.
> Thanks in advance!
>
> Harry
>
>
> -----Original Message-----
> From: Lai, Harry [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 10:21 AM
> To: 'CocoonUsers'
> Subject: 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
> [EMAIL PROTECTED]
> 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: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>
> ---------------------------------------------------------------------
> 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: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>