Upload large file - my results and questions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Upload large file - my results and questions

kuszi
Hello!

I need to work out a big file uploader. Files could be around ~300Mb.

Toolchain:
  • OS: Linux kuszidell 4.3.3-2-ARCH #1 SMP PREEMPT Wed Dec 23 20:09:18 CET 2015 x86_64 GNU/Linux running Pharo
  • Pharo4.0, Latest update: #40626
  • Loaded config: KomHttpServer (HernanMoralesDurand.25)
  • Loaded config: Seaside3 (topa:278)
  • Seaside Adaptor: WAComancheAdaptor on 8080

Results:

  • When working locally, even 153 MB file is uploaded in seconds.
  • Pharo grows in memory with each upload (haven't seen any degradation yet). This is also a situation when uloading locally (localhost:8080)
  • Received file (ByteArray) is held in memory when receiving (checked with halt/inspect).
However, when running on the final configuration:
  • IIS7.5 on Windows Server 2008R2 as reverse proxy with ARR and Rewrite IIS "plugins"
  • VPN connection from IIS box to the Linux box with Pharo, see above

The following effects realized:

  • Upload process goes well, no error. However, sometimes the resulting file wouldn't appear in the target directory (??). No error in Pharo as well. Disappears (hmm?).
Questions:
  • are there any timeout settings in Seaside and/or in Comanche? Especially on transfers, etc. Session timeout could be short, if any... The main difference between the local and final config/setup is the network/transfer speed (VPN is very slow).
  • Is there an option for streaming directly the uploaded file into a target file?


Uploading "software" is as easy as this:

renderContentOn: html
html form multipart;
           with: [
     html fileUpload callback: [ :value | self receiveFile: value ].
     html submitButton: 'Upload' ].

receiveFile: aFile
    | stream |
stream := (FileDirectory default directoryNamed: '/home/kuszi/tmp') assureExistence;
          forceNewFileNamed: aFile fileName.
[ stream binary; nextPutAll: aFile rawContents ] ensure: [ stream close ]




Thanks and best regards
Robert














_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Upload large file - my results and questions

Stephan Eggermont-3
On 14-01-16 15:34, Robert Kuszinger wrote:
>   * Is there an *option for streaming directly the uploaded file* into a
>     target file?

Zinc supports streaming downloads. For larger downloads you do not want
to use the default seaside fileupload, as other request will not be
handled while the upload is progressing. It would be better to let the
IIS handle this. I've only done that with nginx. There used to be some
blog posts by nick ager about that. You might want to mail him about that.

Stephan

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside