2014-08-28 13 views
0

上傳5沒有看到任何速度的提高上傳大視頻到S3,我們正在使用PHP。通過使用並行塊上傳

根據fineuploader的文檔,如果我們啓用併發塊上載,上傳速度應該會增加,但我們沒有看到任何改進,下面是我們正在使用的配置,請建議如果我們缺少一些東西。

我們的統計: 152 MB的文件上傳到S3無併發組塊啓用:7:40秒 152 MB的文件上傳到S3併發組塊啓用:7:29秒

下面是代碼,我們使用使併發組塊上傳:

$(document).ready(function() { 
var idUpload = "fineuploader-s3"; 
    $('#'+idUpload).fineUploaderS3({ 
    debug: true, 
    request: { 
      // REQUIRED: We are using a custom domain 
      // for our S3 bucket, in this case. You can 
      // use any valid URL that points to your bucket. 
      //endpoint: "http://testvibloo.s3.amazonaws.com", 
      endpoint: "testvibloo.s3.amazonaws.com", 

      // REQUIRED: The AWS public key for the client-side user 
      // we provisioned. 
      accessKey: "AWS Access Key", 

      forceMultipart: false, 

     }, 
    objectProperties: { 
     key: function(fileId) { 
      var keyRetrieval = new qq.Promise(), 
     filename = $("#"+idUpload).fineUploader("getName", fileId); 
     keyRetrieval.success('testing/'+new Date().getTime()+'_'+filename); 
     return keyRetrieval; 
      } 
     }, 

     template: "simple-previews-template", 

     // REQUIRED: Path to our local server where requests 
     // can be signed. 
     signature: { 
      endpoint: "http://hostname/testing/html/templates/s3demo.php" 
     }, 

     // USUALLY REQUIRED: Blank file on the same domain 
     // as this page, for IE9 and older support. 
     iframeSupport: { 
      localBlankPagePath: "success.html" 
     }, 

     // optional feature 
     chunking: { 
      enabled: true, 

      concurrent: { 

       enabled: true, 

      }, 

     }, 

    //maxConnections: 5, 
    // optional feature 
     resume: { 
      enabled: true 
     }, 

     // optional feature 
     validation: { 
      sizeLimit: 1024 * 1024 * 1024 
     }, 

    }) 
     // Enable the "view" link in the UI that allows the file to be downloaded/viewed 
     .on('complete', function(event, id, name, response) { 

      var $fileEl = $(this).fineUploaderS3("getItemByFileId", id), 
       $viewBtn = $fileEl.find(".view-btn"); 

      if (response.success) { 
       $viewBtn.show(); 
       $viewBtn.attr("href", response.tempLink); 
      } 
     }); 
}); 

回答

0

按照文件從fineuploader上傳速度應該增加,如果我們實現並行塊上傳,

該文檔沒有完全說明這一點。以下是它的說法:

當一次發送多個塊時,上傳速度有明顯的優勢。併發塊功能主要用於最大化單個大文件上傳的帶寬使用。

請注意,最後一句:「單個大文件上傳」。如果您一次上傳多個文件,那麼您已經可能最大限度地連接到S3。併發分塊功能旨在確保所有可用連接用於單個文件上傳。沒有這個功能,一次只能使用一個連接。