Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Testfile Script for webserver ?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Testfile Script for webserver ?

TeoMTeoM Member

Hello all,
Does anyone know how liteserver.nl can offer these testfiles : https://testfiles.liteserver.nl/

They offer testfiles in petabytes that must be some script that generates a live testfile when someone wants to donwload something.

What is this traffic waste? If one could rather provide the customer then more traffic.

You offer Exabyte testfiles that waste traffic but offers the customer only 1TB ?

Thanked by 2hanoi bulbasaur

Comments

  • yoursunnyyoursunny Member, IPv6 Advocate

    Suppose you want to emit an 1TB file, you can make a 1GB file and then output that file in a loop:

    header("Content-Type: application/octet-stream");
    header("Content-Length: ".(1024*1024*1024*1024));
    
    for ($i=0; $i<1024*1024; $i) {
      readfile("1GB.bin");
    }
    

    Of course doing this in FastCGI would be very slow.

    You can write an HTTP server in Go to generate such HTTP responses more efficiently.

  • While I understand what the purpose of these is (alright, I am not so sure about the exibyte ones :) ), I myself was wondering how comfortable those who host them are with the potential volume of traffic.

    Is it simply the scale/size of the operation/company which allows this to be a no factor? Or are there possibly agreements in place to keep the costs sensible? Same thoughts actually popped up in my head when looking at the list of endpoints against which YABS tests run...

  • rcxbrcxb Member

    I'm sure one fresh Linux ISO consumes more traffic than a few massive test files that only rarely does anyone access.

    Peering agreements are odd... You're supposed to keep traffic in.out balanced. If you've got customers doing much more downloading than uploading, upload bandwidth is not just free, but may be a dangerous imbalance. That's how ISPs were able to make the case that Netflix should pay them millions. If Netflix had utterly wasted a ton of their downstream on trash, they'd have been in the clear.

    In the core, there is obscene throughput available at nearly zero cost. It's only on the edge that transit gets costly for the rest of us.

    Thanked by 2bulbasaur rhinoduck
  • @TeoM said: They offer testfiles in petabytes that must be some script that generates a live testfile when someone wants to donwload something.

    Not necessarily. You can generate a huge sparse file that consumes no disk space:

    # truncate --size 1E testfile
    
    # ls -l testfile
    -rw-r--r-- 1 root root 1152921504606846976 Apr 24 07:50 testfile
    
    # du testfile
    0       testfile
    

    And that file can be served with any web servers, just like regular files:

    # curl http://127.0.0.1/testfile -o /dev/null
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0 1024P    0 5648M    0     0   797M      0   15964d  0:00:07   15964d  941M^C
    
Sign In or Register to comment.