bertrandmartel / speed-test-lib

:cloud: JSpeedTest : speed test client library for Java/Android
MIT License
381 stars 119 forks source link

Results Not Matching with www.speedtest.net #8

Closed msajid83 closed 7 years ago

msajid83 commented 8 years ago

Why results not matching with the results measured by speedtest.net

bertrandmartel commented 8 years ago

Maybe you didn't choose an adequate speed test server. In my samples, I use testdebit.info which is located in France. Furthermore, this library doesn't calculate latency/jitter, it doesn't adjust the chunk size depending on the connection speed either and doesn't provide pre-estimation of the connection speed based on small chunk sent to/from server. It doesn't detect anomaly either, for instance here, it is taking away X% slowest chunk and X% fastest chunk downloaded (this anomally detection will be implemented and configurable by user in the next release). speedtest.net process is described here This library provides a round calculation of transfer rate for all individual chunks read/written on the period you set. I will provide a documentation for the library process soon

msajid83 commented 8 years ago

I appreciate your urgent response. I'll check it.

bertrandmartel commented 8 years ago

I've added some notes about that in the Readme here

msajid83 commented 8 years ago

Well i implemented your sample code with server mentioned in your code and then tested it. It shows very less download speed in bit/sec and comparatively high upload speed in bit/sec.

msajid83 commented 8 years ago

The other issue that i'm facing is that i have a textview on my activity. I want to update it with current speed reported from onDownloadProgress method. It stops download process when i try to update my textview label from within onDownloadProgress listener method. Why it won't let me update textview.

msajid83 commented 8 years ago

Well i implemented your sample code with server mentioned in your code and then tested it. It shows very less download speed in bit/sec and comparatively high upload speed in bit/sec. The speedtest.net results are far different.

bertrandmartel commented 8 years ago

Do you update your UI in your UI thread ? cf #7

bertrandmartel commented 8 years ago

i implemented your sample code with server mentioned in your code

You can test directly the example code as is, to check :

git clone git://github.com/akinaru/speed-test-lib.git
cd speed-test-lib
./gradlew downloadFile
./gradlew uploadFile
msajid83 commented 8 years ago

Hi,

i have checked it....the download speed results are not matching with speedtest.net, not even near to speedtest.net. Upload is making sense. I'm doing FTP Download.

If speedtest.net DL Speed is 22.73Mbps, your DL speed only shows 0.88Mbps. Its too low.

im converting bit/sec to Mb/sec using formula i.e. Mbps = bps/1000000

Can you please help me in this matter.

bertrandmartel commented 8 years ago

For FTP, check with : ./gradlew downloadFTP test (see previous comment). It uses speedtest.tele2.net located in Europe. The example is located here. Then test it with an adequate server by checking the latency (see first comment)

msajid83 commented 7 years ago

Using v1.23: Giving sendto failed: ECONNRESET (Connection reset by peer) error while running uploading ftp test.

Any guess.

msajid83 commented 7 years ago

Also its giving more samples in ftp download but giving very low samples in ftp upload.

bertrandmartel commented 7 years ago

Maybe, the server your are using is down ? which one is it ? Is it working with lower version ?

msajid83 commented 7 years ago

I'm running my app with v1.23 on Note 4 G910T (Android Version 4.4.4). I'm connected with ftp server using FILEZILLA.....its uploading and downloading file using FILEZILLA...no issue on this....but in app it gives above mentioned error only while running ftp upload. ftp download is working fine.

msajid83 commented 7 years ago

i have configured FTP Server on Windows Server 2012

bertrandmartel commented 7 years ago

Also its giving more samples in ftp download but giving very low samples in ftp upload.

If what you call low samples is the number of call to onDownloadProgress or onUploadProgress. This is normal behavior, upload chunk size is fixed, default size is 65535 octet but you can set it with void setUploadChunkSize(int chunkSize). For download, onDownloadProgress is dispatched each time some data is read from the socket. So, you will have technically more onDownload event than onUpload events.

msajid83 commented 7 years ago

there is one more thing....on ftp upload....the initial few samples shows very high speed e.g 100Mb/s and then suddenly drops to normal e.g: 3Mb/s

bertrandmartel commented 7 years ago

Can you check the log file of your ftp server to see any kind of specific error ?

bertrandmartel commented 7 years ago

there is one more thing....on ftp upload....the initial few samples shows very high speed e.g 100Mb/s and then suddenly drops to normal e.g: 3Mb/s

An existing issue #11 has exactly the same problem on http upload. I couldn't reproduced this issue at the time. I will try to identify the problem

msajid83 commented 7 years ago

Can you guide me why ftp upload sometimes run and sometimes not....but ftp download always run....

msajid83 commented 7 years ago

it sometimes hangs here....

if (mSocketInterface.getUploadStorageType() == UploadStorageType.RAM_STORAGE) { /* generate a file with size of fileSizeOctet octet */ fileContent = randomGen.generateRandomArray(fileSizeOctet); } else { uploadFile = randomGen.generateRandomFile(fileSizeOctet); uploadFile.seek(0); }

                mFtpOutputstream = ftpClient.storeFileStream(uri);
msajid83 commented 7 years ago

and then gives error...

msajid83 commented 7 years ago

now giving EPIPE(broken pipe) on ftp upload

bertrandmartel commented 7 years ago

Have you access to your ftp server ? Can you check ftp server logs to see whats happening on server side ?

bertrandmartel commented 7 years ago

I have quickly setup a FTP server on Ubuntu and tested FTP upload with

I've not run to any problem like yours. Just check that your upload path does exist but that seems not related to your issue. Also, check for file size limit on your ftp server, try to uploading file with the same size to the same destination using Filezilla to try to reproduce the issue

bertrandmartel commented 7 years ago

I'm closing this issue, feel free to reopen if you have any news about your FTP server/client issue. Note that issue #11 (you have encountered) lead to a workaround to set a time from which the speed test rate is calculated for download or upload

msajid83 commented 7 years ago

Getting sendto failed: EPIPE (Broken pipe) error on uploading.

bertrandmartel commented 7 years ago

Which authentication is enabled on your FTP server, basic or anonymous ? Can you access it without problem with some FTP client like Filezilla ? Is upload successfull using Filezilla ? Is SSL enabled on your FTP server ? If possible, can you provide FTP server log when the problem occur ?