http://bugzilla.slf4j.org/show_bug.cgi?id=298

           Summary: locks around logger maps inhibit concurrency
           Product: SLF4J
           Version: 1.7.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: Implementations
        AssignedTo: [email protected]
        ReportedBy: [email protected]


I'm analyzing degraded performance in a new release of out web application.
The application has relatively high throughput (>4k requests/s). We're seeing 
increased contention on the lock-guarded "loggerMap" in SLF4JLogFactory.

The change that introduced this contention is that some of the libraries we're
using (Spring, in this particular case) apparently have started creating Logger
instances in request-scoped objects in new versions, increasing the volume of
calls to SLF4JLogFactory.getInstance().

The top of the call stack of threads waiting for the lock in question looks
like shown below.

Given that SLF4J targets Java 5+, it seems that some of the util.concurrent
constructs could be used to make logger retrieval lock-free for the common
cases.

-----------
http-/0.0.0.0:8080-187 [BLOCKED] CPU time: 3s
org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(String)
org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(Class)
org.apache.commons.logging.LogFactory.getLog(Class)
org.springframework.util.ConcurrencyThrottleSupport.<init>()
org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottleAdapter.<init>()
org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottleAdapter.<init>(SimpleAsyncTaskExecutor$1)
org.springframework.core.task.SimpleAsyncTaskExecutor.<init>(String)
org.springframework.web.context.request.async.WebAsyncManager.<init>()
org.springframework.web.context.request.async.WebAsyncUtils.getAsyncManager(ServletRequest)
org.springframework.web.servlet.FrameworkServlet.processRequest(HttpServletRequest,
HttpServletResponse)
org.springframework.web.servlet.FrameworkServlet.doPost(HttpServletRequest,
HttpServletResponse)
javax.servlet.http.HttpServlet.service(HttpServletRequest, HttpServletResponse)
org.springframework.web.servlet.FrameworkServlet.service(HttpServletRequest,
HttpServletResponse)
javax.servlet.http.HttpServlet.service(ServletRequest, ServletResponse)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ServletRequest,
ServletResponse)
-----------

-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
slf4j-dev mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/slf4j-dev

Reply via email to