Results 1 to 4 of 4

Thread: Major performance issue with file upload / Spring Web Flow

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    2

    Default Major performance issue with file upload / Spring Web Flow

    We are developing a web-application in Spring Web Flow 2.3.1 with several states, where one of the states allows the user to upload one or more files to the server. The files themselves are used at a later state, so in the meantime we store the content of the files in byte arrays in flow scope.

    The problem is that when uploading larger files (about 2mb) it gets really slow. Each request (any request to the server) takes 30s+.

    Is this a known problem? Should we not store the file contents in flow scope?
    Is there a better way to do this? e.g store the files in session instead?

    Appreciate any advice on this, Thanks
    Joakim
    Last edited by JockeF; Feb 18th, 2013 at 07:36 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    flowscope is stored in session, session is serialized/deserialized on each request. Putting large amounts of data in your session is never a good idea, so I would suggest finding another way to pass around the files.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Feb 2013
    Posts
    2

    Default

    Quote Originally Posted by Marten Deinum View Post
    flowscope is stored in session, session is serialized/deserialized on each request. Putting large amounts of data in your session is never a good idea, so I would suggest finding another way to pass around the files.
    Thanks a lot for the quick response!

    We'll look into other ways to store the files.

    One thing i didn't mention in the original post:
    The performance does not seem to be a problem when the application is running on localhost. But when we run it in a test environment, the request/response-time seems to increase 30-fold.
    Of course some latency due to network would be normal, but i find this strange if it only was because the session is being serialized and de-serialized as this happens when the application is running locally as well (same application server) .

    Any insight on this?

    Thanks,
    Joakim

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    Find the differences in your environment... Could be file system, could be the fact that local you don't have cluster but have a cluster in yur test environment, configuration. There are lots of things that can influence that.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •