Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Mathemathical download time equation?

Status
Not open for further replies.
Joined
Aug 24, 2012
Messages
604
Reaction score
304
Hiya!
I've been doing some random poop lately and I wanted to figure out how I could make an equation that would take both server #1 and server #2's internet speed into consideration while simulating a download
(Not a real download, pls just simulating)
So for example
Server #1 hosts the file and has 500 mbit/s
Server #2 wants to download Server #1's file and it's only got 100mbit/s
The filesize is 2810000kbit (2,8 GB). My brain just totally died when trying to do his...

Thanks in advance,
Dominic
 
Experienced Elementalist
Joined
May 10, 2015
Messages
278
Reaction score
146
Your final download will be 100 mbit/s (12,5 mb/s if we want to follow google convertion) and your download time will be [2810000*(10^-3)]/12,5 mb/s (but im really sure that something is wrong, even though the calcs should be corrects)
 
Watching from above
Legend
Joined
Apr 9, 2004
Messages
3,828
Reaction score
752
time = size / speed = filesize / min(server1speed, server2speed)

Just make sure all values use the same unit (kbit/mbit/kb/mb, whatever you choose). In practice maximum speed won't be reached so add some percentage to the result.
 
Joined
Aug 24, 2012
Messages
604
Reaction score
304
time = size / speed = filesize / min(server1speed, server2speed)

Just make sure all values use the same unit (kbit/mbit/kb/mb, whatever you choose). In practice maximum speed won't be reached so add some percentage to the result.

It's simulating a download/upload speed. It's like Slavehack or Hackerexperience :):
I ended up doing it like this:
Code:
<?php
function calc($size, $a, $b) {
    $speed = 0;
    if ($a < $b) {
        $speed = $a;
    } else {
        $speed = $b;
    }
    return $size / ($speed / 8);
}
echo gmdate("H:i:s", calc(2800, 100, 500));
?>
 
Last edited:
Status
Not open for further replies.
Back
Top