1

I'm running a node app on a raspberry pi 3,

it's a simple player that receive a list of urls (aws s3), download the url with wget and play them with mpd,

but when the list is downloaded with wget, the app UI (http) become very slow and unresponsive,

I checked with netstat, it downloads each file at a time (like it should), and nothing else is downloading.

I checked with top and couldn't see any load on the system.

Here is the top | grep wget output

2890 volumio 20 0 52600 13308 8228 S 2.3 1.3 0:02.30 wget
2890 volumio 20 0 52600 13308 8228 S 2.0 1.3 0:02.36 wget
2890 volumio 20 0 52600 13308 8228 S 2.3 1.3 0:02.43 wget
4680 volumio 20 0 52600 13196 8116 R 9.9 1.3 0:00.30 wget
4680 volumio 20 0 52600 13196 8116 R 28.4 1.3 0:01.16 wget
4680 volumio 20 0 52600 13196 8116 S 6.3 1.3 0:01.35 wget

I would like to understand why the rpi become so slow, and if there in a way to download files is a way that doesn't clogs the system,

Thanks in advanced for any help

EDIT:

here is the node code

track.filePath = fixFilePath("slmusic/" + track.fileName);

track.fullFilePath = "/mnt/INTERNAL/" + track.filePath;

var downloadCommand = "/usr/bin/wget --no-check-certificate -O \"" + track.fullFilePath + "\" \"" + fixUrlForWget(url) + "\"";

// self.pushMessage('installPluginStatus',{'progress': 10, 'message': 'Downloading plugin','title' : modaltitle, 'advancedLog': advancedlog});


if (!fs.existsSync(track.fullFilePath)) {
    console.log("downloadList: url", url);
    exec(downloadCommand, function (error, stdout, stderr) {
        if (error) console.log("downloadList: error",error);
        self.commandRouter.executeOnPlugin('music_service', 'mpd', 'updateDb', '');
        setTimeout(function () {
            self.doDownloadList();

        }.bind(self), 1000);

    });
}
2
  • Could you edit to include the Node app code? I would hazard a guess that you're using the synchronous API to call wget so your thread is blocked waiting (and hence no UI rendering) – Aurora0001 Apr 10 '18 at 8:10
  • the UI communicate with the app from a different http call, so I don't think it should be influence, but ASAIK exec is async – Elia Weiss Apr 10 '18 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.