Quantcast
Channel: Recent Questions - Raspberry Pi Stack Exchange
Viewing all articles
Browse latest Browse all 50742

Node app become slow when running wget

$
0
0

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 wget2890 volumio 20 0 52600 13308 8228 S 2.0 1.3 0:02.36 wget2890 volumio 20 0 52600 13308 8228 S 2.3 1.3 0:02.43 wget4680 volumio 20 0 52600 13196 8116 R 9.9 1.3 0:00.30 wget4680 volumio 20 0 52600 13196 8116 R 28.4 1.3 0:01.16 wget4680 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);    });}

Viewing all articles
Browse latest Browse all 50742

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>