Remy Maucherat wrote:
[EMAIL PROTECTED] wrote:
Author: markt
Date: Tue Nov 8 11:32:28 2005
New Revision: 331870
URL: http://svn.apache.org/viewcvs?rev=331870&view=rev
Log:
Simple part of fix for bug 37150 based on profiler output. Doesn't fix
the major culprit. Needs more work.
This bug report is nonsense ...
No it isn't. If it was, I would have closed it as invalid along with
an explanation as to why it is invalid.
I have a trivial JMeter test that re-creates the problem and a
profiler output that shows where the problems are. The larger the
number of files in the directory, the easier it is to reproduce. I
have been using 1000.
Analysing the output of the profiler, 96% of the time is spent in
renderHtml(). Digging deeper 49% of the time is spent in
ProxyDirContext.lookupCache() and 26% in rewriteURL(). My patch
reduced the rewriteURL() figure from 33%. Not a big help but a simple,
obvious fix.
I haven't looked further at rewriteURL() yet to see what, if anything,
can be done to speed this up.
I have been looking at ProxyDirContext.lookupCache(). Every single
call to ProxyDirContext.lookupCache() results in a call to
ProxyDirContext.revalidate() which in turn calls
FileDirContext.file(String). This is an expensive method call, mainly
due to File object creation and the call to File.getCanonicalPath().
The cache should take most of the load here but what happens is if the
cache isn't valid (eg the first time a directory listing is requested)
the calls to ProxyDirContext.revalidate() take so long that by the
time the next directory listing is created, the cache is invalid
again. On my reasonably powerful dev box, two requests in parallel are
enough to slow things down to a crawl for a few minutes.
Increasing the TTL on the cache would reduce the frequency of the
lock-up, but things are still going to slow down once the cache expires.
I have some ideas to optimise the process of looking up the directory
contents but nothing concrete and I want to make sure any patch
doesn't open up any security holes.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]