简体   繁体   English

使用Python测量HD性能的最简单,最快的方法是什么?

[英]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.

相关问题 在 python 中找到特征值/向量的最快方法是什么? - whats the fastest way to find eigenvalues/vectors in python? 导出Python程序以在另一台计算机上运行的最简单最快的方法? - Easiest & fastest way to export a Python program to run on another computer? 给定一个包含它的列表在 Python 中找到一个项目的索引的最快方法是什么? - Whats the fastest way of finding the indexes of an item given a list containing it in Python? 用python从omdb获取电影信息的最快方法是什么? - Whats the fastest way to get movie info from omdb with python? 性能:使用Python读取文件的最快方法 - Performance: fastest way of reading in files with Python 使用 Python 拆分 JSON 文件的最简单方法 - Easiest way to split JSON file using Python 解析HTML表格的最快,最简单,最好的方法? - Fastest, easiest, and best way to parse an HTML table? 最简单,最快的模板化方法,可能是PDF - Easiest and fastest way to template, possibly in a PDF 在巨大的关键字列表中检查单词的最快方法 - Python性能 - Fastest way of checking for word in huge list of keywords - Python performance 性能-比较Python中2个大型字符串列表的最快方法 - Performance - Fastest way to compare 2 large lists of strings in Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM