0

Im following rackspace example on file upload to cloud storage on docs. It is works but the upload are taking too loong. Like really longer! No matter what region do I use 17,kb file take more than 3sec is this actual behaviour of rackspace cloud, they really slow?

Im using rackspace with nodejs, whith the help of pacakage named pkgcloud.

  // taken from pkgcloud docs
  var readStream = fs.createReadStream('a-file.txt');
  var writeStream = client.upload({
    container: 'a-container',
    remote: 'remote-file-name.txt'
  });

  writeStream.on('error', function(err) {
    // handle your error case
  });

  writeStream.on('success', function(file) {
    // success, file will be a File model
  });

  readStream.pipe(writeStream);

The purpose here is, I do image processing on the backend then I send back CDN URL to the user, but a user cannot wait too long 2MB took forever to upload -- timeout and held my server until crash since the stream aren't finished yet

mandaputtra
  • 922
  • 3
  • 18
  • 36
  • Do you have any code to share? What cloud storage? Disk on a cloud server? CDN (which one)? – ficuscr Aug 29 '19 at 15:56
  • @ficuscr I updated the code, I'm using Cloud Storage with CDN enabled Hongkong ~ I still don't know why till now I'm at Southeast Asia, when I choose Hongkong it is still slow. I already contacted customer service but they seem don't have any problem with my slow upload. Then I dug the package understand how upload works, I replicate the package but same still slow. When I tried with Amazon Cloud Storage / Cloudinary it is fast. – mandaputtra Aug 30 '19 at 04:01
  • Lot of factors involved. We use "Cloud Files", which is Akamai's CDN, in a similar fashion to what you describe and don't seem to have upload speed issues. Obviously the thing is built for efficient downloads. Take a look at this: https://github.com/cloudnull/turbolift, it is great with mass operations. Maybe use it for some uploads - can at least determine if it's your code's approach. – ficuscr Aug 30 '19 at 05:11
  • Thanks, I'll try to mimic that in javascript. Or maybe just using child_process to execute the command. – mandaputtra Aug 30 '19 at 06:54

0 Answers0