Git Product home page Git Product logo

disk-speed's Introduction

disk-speed

Measure disk speed from Python by writing to disk. The disk can be SSD, HDD, eMMC, flash drive, NAS, Cloud, as long as it is mounted and writable.

The measurement will take 0.5 second.

Purpose

Loosely measure the speed of a 'disk', in order to note the speed difference between a SSD and a Cloud mount.

Usage:

Without parameter:

$ ./diskspeed.py 
Absolute path of filename  /home/sander/disk-speed/outputTESTING.txt
Disk writing speed: 154.509901638 Mbytes per second

With a parameter specifying the directory to be tested:

$ ./diskspeed.py /home/sander/
Absolute path of filename  /home/sander/outputTESTING.txt
Disk writing speed: 143.504647188 Mbytes per second

With a different directory specified, in this case a mount on a remote server

$ ./diskspeed.py '/run/user/1000/gvfs/sftp:host=server.example.com,port=2222/home/sander/'
Absolute path of filename  /run/user/1000/gvfs/sftp:host=server.example.com,port=2222/home/sander/outputTESTING.txt
Disk writing speed: 0.569606459526 Mbytes per second

Speed of a NAS on my LAN mounted via SMB:

$ python diskspeed.py '/run/user/1000/gvfs/smb-share:server=192.168.1.165,share=share'
Let's go
Disk writing speed: 0.69 Mbytes per second
Done

Usage Module

import diskspeed
print diskspeed.diskspeedmeasure('/tmp')
print diskspeed.diskspeedmeasure('/tmp/')

or

from some.path.diskspeed import diskspeedmeasure
print diskspeedmeasure('/tmp')

Accuracy

Speed measured this speed is not too far away from the Real Stuff with hdparm:

$ sudo hdparm -tT /dev/sda6 | tail -1
 Timing buffered disk reads: 618 MB in  3.00 seconds = 205.86 MB/sec

Results

Disk type Result in Mbytes/s
SSD 132.7
eMMC 62.4
Flash card 18.1
Flash card (Raspi) 3.6
Lacie NAS on wired LAN 3.2
Some NAS on LAN 2.2
SFTP mount over Internet 0.57
Lacie NAS via WLAN 0.21

disk-speed's People

Contributors

sanderjo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.