12 Replies Latest reply on Aug 28, 2007 4:27 AM by shane.bryzak

    File upload - performance has taken a dive

    jazir1979

      Hi all,

      I *think* this has happened since upgrading to Seam2, but I can't be sure of that. Anyway, this is what's happening:

      Whenever I upload a file with the file upload component, it is taking an extremely long time. It's also resulting in a huge number of the following logging statements (> 600,000 for a 587kb file)

      2007-08-03 11:02:25,265 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dataFile
      
      2007-08-03 11:02:25,265 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dataFile
      
      


      The time and number of logging statements is definitely proportional to the size of the file, and this is all happening before my Seam action is being called. I'm using the component as follows:
      <s:fileUpload id="dataFile"
       data="#{dataFile.data}"
       contentType="#{dataFile.contentType}"
       fileName="#{dataFile.filename}"
       accept=""/>
      

      It seems the file upload process is looking up the Seam dataFile component again and again as it processes the incoming data.

      Has anybody experienced this?
      thanks,
      Daniel


        • 1. Re: File upload - performance has taken a dive
          shane.bryzak

          File uploads are handled by MultipartRequest, which doesn't interact with any Seam components (in fact, while it is doing its work there aren't even any active Seam contexts). Is it possible for you to use a debugger to pinpoint where all those log messages are coming from?

          • 2. Re: File upload - performance has taken a dive
            jazir1979

            Hi Shane, thanks for looking at this. I took a debugger to it and it seems it is the JSF processUpdates in the UIFileUpload component:

            Contexts.lookupInStatefulContexts(String) line: 192
            Component.getInstance(String, boolean) line: 1722
            Component.getInstance(String) line: 1717
            SeamELResolver.getValue(ELContext, Object, Object) line: 60
            FacesCompositeELResolver(CompositeELResolver).getValue(ELContext, Object, Object) line: 53
            FacesCompositeELResolver.getValue(ELContext, Object, Object) line: 64
            AstIdentifier.getValue(EvaluationContext) line: 44
            AstValue.getTarget(EvaluationContext) line: 34
            AstValue.setValue(EvaluationContext, Object) line: 83
            ValueExpressionImpl.setValue(ELContext, Object) line: 249
            TagValueExpression.setValue(ELContext, Object) line: 93
            HtmlFileUpload(UIFileUpload).processUpdates(FacesContext) line: 49
            HtmlPanelGrid(UIComponentBase).processUpdates(FacesContext) line: 1053
            HtmlForm(UIForm).processUpdates(FacesContext) line: 255
            AjaxViewRoot(UIComponentBase).processUpdates(FacesContext) line: 1053
            AjaxViewRoot(UIViewRoot).processUpdates(FacesContext) line: 706
            AjaxViewRoot.access$101(AjaxViewRoot, FacesContext) line: 53
            AjaxViewRoot$2.invokeRoot(FacesContext) line: 287
            JsfOneOneInvoker.invokeOnRegionOrRoot(AjaxViewRoot, FacesContext, InvokerCallback) line: 53
            AjaxContext.invokeOnRegionOrRoot(AjaxViewRoot, FacesContext, InvokerCallback) line: 191
            AjaxViewRoot.processUpdates(FacesContext) line: 301
            UpdateModelValuesPhase.execute(FacesContext) line: 101
            LifecycleImpl.phase(PhaseId, Phase, FacesContext) line: 251
            LifecycleImpl.execute(FacesContext) line: 117
            FacesServlet.service(ServletRequest, ServletResponse) line: 244
            ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 290
            ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
            SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 83
            HotDeployFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 63
            SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69
            CharacterEncodingFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 44
            SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69
            SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 73
            MultipartFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 82
            SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69
            ExceptionFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 63
            SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69
            RedirectFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 46
            SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69
            TidyXMLFilter(BaseXMLFilter).doXmlFilter(FilterChain, HttpServletRequest, HttpServletResponse) line: 127
            Filter(BaseFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 277
            Ajax4jsfFilter(Ajax4jsfFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 40
            SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69
            SeamFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 140
            ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
            ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
            ReplyHeaderFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 96
            ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
            ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
            StandardWrapperValve.invoke(Request, Response) line: 230
            StandardContextValve.invoke(Request, Response) line: 175
            SecurityAssociationValve.invoke(Request, Response) line: 179
            FormAuthenticator(AuthenticatorBase).invoke(Request, Response) line: 525
            JaccContextValve.invoke(Request, Response) line: 84
            StandardHostValve.invoke(Request, Response) line: 128
            ErrorReportValve.invoke(Request, Response) line: 104
            CachedConnectionValve.invoke(Request, Response) line: 156
            AccessLogValve.invoke(Request, Response) line: 543
            StandardEngineValve.invoke(Request, Response) line: 109
            CoyoteAdapter.service(Request, Response) line: 241
            Http11Processor.process(Socket) line: 844
            Http11Protocol$Http11ConnectionHandler.process(Socket) line: 580
            JIoEndpoint$Worker.run() line: 447
            Thread.run() line: 595 [local variables unavailable]
            


            This is happening over and over and over again. It is in UIFileUpload.processUpdates() where it calls dataBinding.setValue(...).


            • 3. Re: File upload - performance has taken a dive
              pmuir

              I can't reproduce in an example. So you'll need to provide a testcase I think.

              • 4. Re: File upload - performance has taken a dive
                jazir1979

                I reproduced it using the seam-ui example, with a large file for "Pete Muir's Picture". I had loads of the following:

                2007-08-06 11:45:20,921 DEBUG [org.jboss.seam.contexts.Contexts] found in event context: person
                2007-08-06 11:45:20,921 DEBUG [org.jboss.seam.contexts.Contexts] found in event context: person
                2007-08-06 11:45:20,921 DEBUG [org.jboss.seam.contexts.Contexts] found in event context: person
                2007-08-06 11:45:20,921 DEBUG [org.jboss.seam.contexts.Contexts] found in event context: person
                2007-08-06 11:45:20,921 DEBUG [org.jboss.seam.contexts.Contexts] found in event context: person
                2007-08-06 11:45:20,921 DEBUG [org.jboss.seam.contexts.Contexts] found in event context: person
                2007-08-06 11:45:20,921 DEBUG [org.jboss.seam.contexts.Contexts]
                ....
                


                I'm running Seam 2 Beta with a few individual patches applied. I can't work from CVS because our network here prevents me from doing a checkout. Is it possible it's something that was fixed in CVS? Anything that rings a bell? This is a showstopper for our customer demo next week :(

                "pete.muir@jboss.org" wrote:
                I can't reproduce in an example. So you'll need to provide a testcase I think.


                • 5. Re: File upload - performance has taken a dive
                  jazir1979
                  • 6. Re: File upload - performance has taken a dive
                    jazir1979


                    It worked.

                    Like all my other recent troubles, I had to apply the fix manually after inspecting Fisheye. It would have been much easier if there was like a Seam 2 Beta 2 release or something.

                    • 7. Re: File upload - performance has taken a dive
                      shane.bryzak

                      Seam 2.0CR1 is due to be released very soon now.

                      • 8. Re: File upload - performance has taken a dive
                        mhaubrich

                        Hi,

                        we are experiencing this problem as well.

                        Could you please tell me when the 2.0 CR1 release is due?

                        Or alternatively how to re-build the jboss-seam-ui.jar after fetching the latest version from FishEye.
                        I haven't managed to get the supplied ant script to work... :(

                        Thanks,
                        Maarten

                        • 9. Re: File upload - performance has taken a dive
                          shane.bryzak

                          You can get the latest version from CVS.

                          http://wiki.jboss.org/wiki/Wiki.jsp?page=CVSRepository

                          • 10. Re: File upload - performance has taken a dive
                            tony.herstell1

                            > Seam 2.0CR1 is due to be released very soon now.


                            When?

                            :)

                            • 11. Re: File upload - performance has taken a dive

                              ... or download the nightly builds from http://hudson.jboss.org/hudson/job/JBossSeam/.

                              • 12. Re: File upload - performance has taken a dive
                                shane.bryzak

                                 

                                "tony.herstell@gmail.com" wrote:
                                > Seam 2.0CR1 is due to be released very soon now.


                                When?

                                :)


                                When it's done :). But seriously, there's not that many issues remaining, the problem is that a bunch of last minute issues keep popping up in the release which is holding us up a little bit.

                                http://jira.jboss.org/jira/secure/IssueNavigator.jspa?reset=true&mode=hide&sorter/order=DESC&sorter/field=priority&resolution=-1&pid=10071&fixfor=12311435