1

When I'm uploading more than 5 photos at same time (5 multipart/form-data request), during its process, any GET request has ~500ms delay, any Socket.io event has ~1500ms delay.

Is this normal? I tried with Multer and Multiparty as upload middleware, both give the same lag.

The photos are each about 5MB large. The CPU usage for of node process during the upload raises about 5% than average, and memory usage stays normal.

Server: Hosted on DigitalOcean. Ubuntu with 1G RAM, 1 Core Processor, 30G SSD

Does anyone experience the same thing? Here's a snippet for Multer. I would really appreciate for any help, I've been trying to solve this for 5 days now without any success :(

function photoUpload(req, res, next){
    dest: 'public/photos',
    limits: { fileSize: 10*1000000 }, // 10MB file limit
    onFileSizeLimit: function (file) { fs.unlink(file.path) },
    onParseEnd: function (req, next) { 
        var file = req.files.photo;
        file.url = '/photos/' + file.name; // save photo url
        next(); 
    }
}

app.post('/api/upload', photoUpload, function(req, res){
    Database.createPhoto(req.file.url); // save photo url in database
});
Maria
  • 3,455
  • 7
  • 34
  • 47
  • How fast is the upload from where you are uploading the photos? It sounds like you may be saturating your entire upload bandwidth. – robertklep Jun 28 '15 at 09:01

0 Answers0