I'm not completely sure, but it's probably because when downloading, the file has to be read from the hard drive but while uploading, the data is only stored in RAM.
Believe you're right about this and indicated the weakness of this script with uploads .
However the download figures are in the right ball park.
To normalize the upload and download speeds, you can replace the download file with a simple script which outputs something without reading from a hard drive. Use the following PHP script instead of bigfile.bin (change references to bigfile.bin in the HTML file).
PHP script (untested and perhaps inefficient) -
PHP:
<?php
// Echo 32 MiB of crap
for ($i = 0; $i < 32 * 1024 * 1024; $i++) {
echo 'a';
}
Since the purpose is to test streaming ability and files are necessarily on a HDD somewhere i don't think this will work. The download part simulates a download, the upload however should also have something to send but i think that will require local permissions and the user to select a file to send back to the server which will be more complicated.
Anyway, the download part is the most important bit here as that is what most people will be interested in.
I'm really not a node.js guy, but post the code here and I'll try.
Are you aware of any php scripts that do the same, i'm not too tied to mongoose, any language or server will do so long as its simple to setup for novices to do some testing.
This Node JS script does 3 downloads of increasing size and then calculates an average, same with upload compared to the previous JS. Multiple transfers are more reliable than just one transfer. Here is the script.
Speedtest
The demo for the script referenced by the blogger provided
here works perfectly. The problem is i can't get the scripts he put up on github to work. Either there is a configuration problem or the script is buggy
There are four branches there, tried with master, nothing, then experimental, also nothing. By nothing i mean the browser does not even get a response from nodeJS. Split seemed to work in the sense i could get the webpage to display but the formatting was all over the place. Reason i picked nodejs was simplicity and cross platform support, tried on XP with the windows 32 bit binary from
here.
What can be simpler that unzipping the script, drop the nodejs exe in the same folder and run it.
Appreciate you taking the time to look at this
