How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

February 26, 2012

Create a 1g 100MB 10Mb file for testing transfer speed

Filed under: Linux — Tags: , , , — admin @ 11:39 am

Well yesterday I face another problem.
I have to try transfer speed from one client, because of complaining that his site is loading slow. After a short look on his server the load was below 1 on a quad core, the server didn’t swap, and didn’t have any slow mysql query.
Well last thing I wanted to see how is the bandwidth from that server . So how to create a large file fast ?
Well dd is the command from linux that i use.
So to create 1G file go with
dd if=/dev/zero of=testfile bs=1024 count=1024000
to create 100Mb try
dd if=/dev/zero of=testfile bs=1024 count=102400
and for 10Mb use
dd if=/dev/zero of=testfile bs=1024 count=10240

You can find on other forum that they use /dev/urandom or /dev/random however this are load intensive for your server and take longer to make the file.
So use /dev/zero for this purpose.

2 Comments »

  1. i have tried this.. but i didn’t get this speed..:( please tell another way..

    Comment by 1oomb hosting — April 19, 2012 @ 10:51 pm

  2. Hello
    If you run that command you will have a file with that size, not the speed of transfer. After you create that file you copy/move it on your site and after this run a wget to that file .
    Example: wget exampleservertotest/1gfile
    And when this wget run you will see the speed.

    Comment by admin — May 18, 2012 @ 10:47 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress