You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Da...@halifax.co.uk on 2005/06/01 17:33:55 UTC

ASP.Net Blocking Problem

Hi,

I'm using log4net in an asp.net application to log page hits to a
database.  It's working really well, however, whilst recently doing some
performance testing of 200+ clients I discovered that I was blocking
which was seriously hitting my performance (halving the number of
requests per second).  The block was in the lock in
AppenderSkeleton.DoAppend.  It would appear that all of my asp.net
requests are coming and hitting using the same instance of the logger
which ultimately ends up waiting for the appenders to run through.  What
is happening is that I'm creating a choke point around my database calls
which is seriously costing me.

I'm creating the logger in the standard fashion in a HTTP Module
(although not into a static instance), although if I understand the code
correctly I would always end up with the same logger objects as the
wrappermap in the logmanager is static.  

My question is; is there anyway of getting the logmanager to create me a
new instance of my loggers?  Or of not sharing the loggers with every
other thread in the appdomain?  I'm using quite an old version of
log4net (1.2.0 beta8), however, I can't see any massive difference in
the way the logmanager works in the latest version - however, if the
answer is, go and try the latest version then this is something I'll
have to think about :).

Alternatively, have I done something really daft in the way I've
instantiated this?  Is there something in the config which would solve
my problem?

Any help gratefully received.

Cheers,

Darren

-- 

------------------------------------------------------------------------------
Halifax plc, Registered in England No. 2367076.  Registered Office: Trinity Road, Halifax, West Yorkshire HX1 2RG. Authorised and regulated by the Financial Services Authority.  Represents only the Halifax Financial Services Marketing Group for the purposes of advising on and selling life assurance, pensions and collective investment scheme business.  
==============================================================================