Struts 2
  1. Struts 2
  2. WW-3786

StrutsPrepareAndExecuteFilter.doFilter() - Takes up to 60 seconds for certain cases

    Details

    • Flags:
      Important

      Description

      Hi Struts Team...

      We use New Relic - a software which kinds of breaks down every web transaction. While monitoring the transactions taking longest time, we came across multiple actions with a single issue where 99% of the time is attributed to this filter call.

      Here is how we have configured the web.xml

      	<filter>
      		<filter-name>struts</filter-name>
      		<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
      		 <init-param>
              	<param-name>disableActionScanning</param-name>
              	<param-value>true</param-value>        	
              </init-param>
              <init-param>
              	<param-name>actionPackages</param-name>
              	<param-value>com.xxx.application.webapp.*</param-value>
              </init-param>
      	</filter>
      	<filter-mapping>
      		<filter-name>struts</filter-name>
      		<url-pattern>/*</url-pattern>
      	</filter-mapping>
      

      Let me know if you all need any more information to help me out on this.

      Thanks,
      BP.

        Activity

        Hide
        Lukasz Lenart added a comment -

        Don't understand where the issue is :/

        Show
        Lukasz Lenart added a comment - Don't understand where the issue is :/
        Hide
        Black Pearl added a comment -

        The issue is that when we drill down into the web transaction - executing an action - 99% of 60 seconds is spent at this method.

        Attaching a screenshot.

        Thanks,
        BP.

        Show
        Black Pearl added a comment - The issue is that when we drill down into the web transaction - executing an action - 99% of 60 seconds is spent at this method. Attaching a screenshot. Thanks, BP.
        Hide
        Lukasz Lenart added a comment -

        Could you attach the source code of the project? It's really hard to predict where is the problem.

        Show
        Lukasz Lenart added a comment - Could you attach the source code of the project? It's really hard to predict where is the problem.
        Hide
        Philip Luppens added a comment -

        I doubt this is still relevant, but I'll comment regardless since we've seen similar issues. Obviously, the New Relic transaction overview is not drilling deep enough, since the filter() method encompasses the entire request processing.

        If you were to look deeper, you'd probably find that a) you're either doing something wrong in your code (eg. inefficient SQL, non-parallel calls to resources, ...) or, b) you're encountering a lot of blocked threads that are timing out (hence the value so close to 60 seconds - that looks like a timeout) on some OGNL methods or resource bundle handling. I suggest adding a profiler and having a look at the blocking of threads.

        If you're on 2.1.8, you might want to a) upgrade to a later version, or b) apply the patch that was provided to resolve the several blocking threads in the OGNL runtime. We've had similar issues, and applying the OGNL patches and backporting the locking of the resource bundles improvements made a massive difference in the processing time of our calls.

        Show
        Philip Luppens added a comment - I doubt this is still relevant, but I'll comment regardless since we've seen similar issues. Obviously, the New Relic transaction overview is not drilling deep enough, since the filter() method encompasses the entire request processing. If you were to look deeper, you'd probably find that a) you're either doing something wrong in your code (eg. inefficient SQL, non-parallel calls to resources, ...) or, b) you're encountering a lot of blocked threads that are timing out (hence the value so close to 60 seconds - that looks like a timeout) on some OGNL methods or resource bundle handling. I suggest adding a profiler and having a look at the blocking of threads. If you're on 2.1.8, you might want to a) upgrade to a later version, or b) apply the patch that was provided to resolve the several blocking threads in the OGNL runtime. We've had similar issues, and applying the OGNL patches and backporting the locking of the resource bundles improvements made a massive difference in the processing time of our calls.
        Hide
        Lukasz Lenart added a comment -

        Cannot reproduce issue with more detail configuration or with sample project.

        Show
        Lukasz Lenart added a comment - Cannot reproduce issue with more detail configuration or with sample project.

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            Black Pearl
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development