Jason Brittain wrote:
> Remy Maucherat wrote:
>
> >> Yep! That's a full 10 seconds slower than the new version, making
> >> the new version about 44% faster.
> >
> >
> > Great !
> > I'll commit the patch later today.
> >
> >> This test is single-threaded, but I think it still shows noticeable
> >> performance improvement.
> >>
> >> Something else that I could do with this that I haven't yet is
> >> make the valve able to buffer log file output. From my tests,
> >> it looks to me like this make the test run about 4 seconds faster,
> >> a maximum of 1.6% gain (not real big, but it's something).
> >
> >
> > If it's really 4s out of 13s, isn't it more than 1.6% ? If the gain is
> > another 4s, then it's significant, and I think we should go for it.
> >
> > Remy
> >
> Okay, that's one way to look at it. I was thinking 4s out of 24s, but
> now that
> you mention it, it's now 4s out of 13s. So, I'll work on that too.
>
> About buffering, I was thinking that not everyone would want the output
> buffered.. If you're debugging and you're trying individual requests and
> looking at the log information for each request, and the log lines don't
> show
> up in the log file after you make the request, that can be annoying/puzzling
> to the person trying to debug. I thought it might be a good idea if you
> could
> configure the valve to buffer or not buffer. Buffering should probably be
> turned on as the default. But, as long as the config says something like
> 'buffering="true"' then at least people will take note that buffering is
> turned on for that log file (it can serve as a sort of a warning).
>
> So, by default, it'll be fast, and the buffering could be turned off. That
> would be nice -- as long as this switchable feature does not really degrade
> performance.
>
+1 for switchable buffering support.
+1 for buffering being on by default.
+1 for including "buffering='true'" (or perhaps maybe specifying a buffer size?)
in the default server.xml <Logger> entries, even if it is the default --
primarily as a form of self documentation that the option to change this exists.
>
> Ideas?
>
Logging messages in some other environments -- and even Tomcat 3.x IIRC -- are
actually written out by a background thread, rather than the main
request-processing thread (as it currently is with Catalina, or at least it was
last time I looked :-). Have you thought about implementing such a thing?
If we go that way, some thought might be spent on perhaps consolidating
background writing for all Loggers into some number of threads less than the
total number of loggers -- to improve scalability in large installations.
>
> --
> Jason Brittain
> Software Engineer, Olliance Inc. http://www.Olliance.com
> Current Maintainer, Locomotive Project http://www.Locomotive.org
Craig