Zero/random file module

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Zero/random file module

Grzegorz Kulewski
Hello,

In my company we often want to monitor transfer speeds. To do that we upload 1M-10G zero/random file to a web server and then we set up some monitoring to time the download. Or we do the download by hand during troubleshooting sessions.

The downside of this is that we need to upload and keep those files on disk and sometimes disk is a very limited resource.

That's why I am wondering if somebody could develop (and include in mainline) a new nginx module that after configuration similar to this:

location = /100mb.test {
        big_file 100M zero;
}

or:

location = /1m.random {
        big_file 1M random;
}

would serve such file in chosen location. Of course the quality of random data does not need to be high - we only need something that compresses poorly - so any simple and fast userspace generator should be enough.

Thank you in advance.

--
Grzegorz Kulewski

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Zero/random file module

Maxim Dounin
Hello!

On Mon, Sep 11, 2017 at 04:47:34PM +0200, Grzegorz Kulewski wrote:

> In my company we often want to monitor transfer speeds. To do
> that we upload 1M-10G zero/random file to a web server and then
> we set up some monitoring to time the download. Or we do the
> download by hand during troubleshooting sessions.
>
> The downside of this is that we need to upload and keep those
> files on disk and sometimes disk is a very limited resource.

Just a side note: on most operating systems you can create sparse
files, which do not occupy disk space.  For example:

$ truncate -s 10g foo
$ ls -lah foo
-rw-r--r--  1 mdounin  mdounin    10G Sep 11 18:08 foo
$ du -sh foo
 96K foo

This allows to create huge zero-filled files even in very
constrained environments.

--
Maxim Dounin
http://nginx.org/
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx