简体   繁体   English

Python系统的基准测试系统性能

[英]Benchmarking System performance of Python System

I'm looking at using inotify to watch about 200,000 directories for new files. 我正在使用inotify来监视约200,000个目录中的新文件。 On creation, the script watching will process the file and then it will be removed. 创建脚本时,脚本监视将处理该文件,然后将其删除。 Because it is part of a more compex system with many processes, I want to benchmark this and get system performance statistics on cpu, memory, disk, etc while the tests are run. 因为它是具有多个进程的更复杂的Compex系统的一部分,所以我想对此进行基准测试,并在运行测试时获得有关CPU,内存,磁盘等的系统性能统计信息。

I'm planning on running the inotify script as a daemon and having a second script generating test files in several of the directories (randomly selected before the test). 我打算将inotify脚本作为守护程序运行,并让第二个脚本在多个目录中生成测试文件(在测试之前随机选择)。

I'm after suggestions for the best way to benchmark the performance of something like this, especially the impact it has on the Linux server it's running on. 我正在寻求基准测试这种性能的最佳方法的建议,尤其是它对运行的Linux服务器的影响。

I would try and remove as many other processes as possible in order to get a repeatable benchmark. 我将尝试删除尽可能多的其他过程,以获得可重复的基准。 For example, I would set up a separate, dedicated server with an NFS mount to the directories. 例如,我将设置一个单独的专用服务器,并将NFS挂载到目录中。 This server would only run inotify and the Python script. 该服务器仅运行inotify和Python脚本。 For simple server measurements, I would use top or ps to monitor CPU and memory. 对于简单的服务器测量,我将使用topps监视CPU和内存。

The real test is how quickly your script "drains" the directories, which depends entirely on your process. 真正的测试是您的脚本以多快的速度“拖拉”目录,这完全取决于您的过程。 You could profile the script and see where it's spending the time. 您可以分析脚本并查看它在哪里花费时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM