[英]Whats the easiest and fastest way to measure HD performance using Python?
I need to measure the performance of a hard disk using python. 我需要使用python来衡量硬盘的性能。 What is the best/fastest/shortest/easiest approach to do it?
最好/最快/最短/最简单的方法是什么? It doesn't have to be overly accurate, just a ballpark value.
它并不一定要过于准确,而只是一个标准值。
My actual goal is to write a small utility which will adjust the postgres settings to the best configuration for the given hardware. 我的实际目标是编写一个小的实用程序,它将针对给定的硬件将postgres设置调整为最佳配置。
My naive approach would be to write some files and measure the time how long it would take. 我幼稚的方法是编写一些文件并测量所需时间。 I would try it for several block sizes, and then I would try to access some random positions within a large file.
我会尝试几种块大小,然后尝试访问大文件中的一些随机位置。 Any other ideas?
还有其他想法吗?
I would think your best bet would be using an external tool, Bonnie++ for example, and parse the program output. 我认为最好的选择是使用外部工具,例如Bonnie ++,并解析程序输出。 Even if you're not that concerned with precision there's no reason to reinvent the wheel.
即使您不太关心精度,也没有理由重新发明轮子。 Why rewrite what's already there?
为什么要重写已经存在的内容?
Start here: http://www.acnc.com/benchmarks.html 从这里开始: http : //www.acnc.com/benchmarks.html
Get the source for one you like write something like it in Python. 获取您喜欢的代码的源代码,用Python编写类似的代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.