2

What would be the bottleneck for fast performance file upload aside from internet connection of course. HTML 5 have file api for slicing file into chunk. what would make better performance in uploading file from client side to server side e.g:

4GB file slice into

4000 chunks of 1MB file vs

400 chunks of 10 MB file vs

40 chunks of 100MB file vs

4 chunks of 1GB file, if that's even possible together at a time.

I'm not talking about internet connection here. Although that will be the main issue, but I'm sure, there is other thing that will affect the performance. such as, file size or http issue, or maybe upload it one slice sequentially instead of simultaneously at a time or something else...

Harts
  • 4,023
  • 9
  • 54
  • 93
  • 1
    If you use a PHP script on the server side, you should also be aware of `max_post_size` in _php.ini_. – ComFreek Mar 16 '12 at 16:30
  • @ComFreek but I can always change that right? since I will use my own server. Although I don't think 1GB chunk is a good idea. I'm just worry about performance and php timeout which I never deal with before. – Harts Mar 16 '12 at 16:34
  • 1
    If you use your own server, a PHP timeout shouldn't be a problem. But I would definitely exclude 40x100MB and 4x1GB, of course. By the way you can also open 2 connections at the same time. – ComFreek Mar 16 '12 at 16:41
  • @ComFreek what do you mean by open 2 connections at the same time? are you talking about php socket? if could you give example that would be great? My project is to create file sharing site e.g : megaupload, rapidshare style.. which allow users to upload huge file with fast performance. – Harts Mar 16 '12 at 16:48
  • You upload the file (parts) via a normal XMLHttpRequest object, dont' you? Then you can open and send multiple AJAX requests to your script on the server side at the same time. You don't have to wait until the previous request finished. – ComFreek Mar 16 '12 at 16:52
  • @ComFreek ooh that's what you mean.. yes.. I use XMLHttpRequest and send multiple ajax request which I said in the original post "maybe upload it one slice sequentially instead of simultaneously at a time", so based on your comment I assume upload it simultaneously will be faster. instead of 1 chunk finish - upload another chunk - finish .... but it looks like you can only open 6 connection at a time. – Harts Mar 16 '12 at 16:57
  • 1
    Yes that will be faster because the browser will open multiple connections. If you open more connections (I believe Firefox accepts 8 per domain), the browser will just wait for the other connections to finish - no data gets lost. Here's a question I found yesterday: http://stackoverflow.com/questions/561046/how-many-concurrent-ajax-xmlhttprequest-requests-are-allowed-in-popular-browse – ComFreek Mar 16 '12 at 17:01

0 Answers0