问题原文
原帖链接 · Zoltán · CC BY-SA 3.0
Is there a way to get read/write queue latencies from NVMe devices? If it's not split for read/write that's better than nothing but ideally I could see these separately.
I'd like to go below the usual millisecond level and haven't found anything so far.
社区高分解答
原帖链接 · Baruch Even · CC BY-SA 3.0
NVMe has log pages and the only thing close to what you want is found in log page 02h, it has the following pieces of info:
- Data Units Read
- Data Units Written
- Host Read Commands
- Host Write Commands
- Controller Busy Time
So you can take the number of host read and write commands and divide them with the controller busy time, if you do this in relatively short intervals and substract the current value from the previous value you will get the average time of a command in that time interval. Not pretty but close enough.
If you are on Linux you can use the nvme-cli command to get this data.
The above is all internal latency, if you want end-to-end latency you have to measure it yourself in your own application. You have a similar mechanism in /proc/diskstats in Linux that shows number of commands and "busy time" of them to average.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
