本文實例講述了Python實現測試磁盤性能的方法。分享給大家供大家參考。具體如下:
該代碼做了如下工作:
create 300000 files (512B to 1536B) with data from /dev/urandom
rewrite 30000 random files and change the size
read 30000 sequential files
read 30000 random files
delete all files
sync and drop cache after every step
bench.py代碼如下:
希望本文所述對大家的Python程序設計有所幫助。
新聞熱點
疑難解答
圖片精選