2010-09-03 14 views
28

में काउंटर को समझना मैं नामित प्रक्रियाओं के आंकड़ों की निगरानी के लिए Munin के लिए एक प्लगइन बना रहा हूं। जानकारी के स्रोतों में से एक /proc/[pid]/io होगा। लेकिन मुझे यह पता लगाना मुश्किल है कि rchar/wchar और read_bytes/written_bytes के बीच क्या अंतर है।/proc/[pid]/io

वे समान नहीं हैं, क्योंकि वे अलग-अलग मान प्रदान करते हैं। वे क्या प्रतिनिधित्व करते हैं?

+0

आशा आप परिवर्तनों को कोई आपत्ति नहीं है, कुछ (मुझे विशेष रूप से) अल्पसंख्यक परियोजनाओं से परिचित है, कम इतना प्राचीन भाषाओं में उन लोगों के नहीं हैं;) –

+1

मैं उस के साथ रह सकते हैं, लेकिन यह वास्तव में छोटा नहीं है। मैं इसे अच्छी तरह से तैनात मानता हूं। – Kvisle

उत्तर

56

जबकि proc manpage बुरी तरह पीछे (और इसलिए सबसे manpages/प्रलेखन कुछ भी पर कुकी कटर उपयोगकर्ता के अंतरिक्ष विकास से संबंधित नहीं हैं) है, इस सामग्री सौभाग्य से पूरी तरह से Linux kernel source में Documentation/filesystems/proc.txt के तहत दर्ज है। यहाँ प्रासंगिक बिट कर रहे हैं:

rchar 
----- 

I/O counter: chars read 
The number of bytes which this task has caused to be read from storage. This 
is simply the sum of bytes which this process passed to read() and pread(). 
It includes things like tty IO and it is unaffected by whether or not actual 
physical disk IO was required (the read might have been satisfied from 
pagecache) 


wchar 
----- 

I/O counter: chars written 
The number of bytes which this task has caused, or shall cause to be written 
to disk. Similar caveats apply here as with rchar. 


read_bytes 
---------- 

I/O counter: bytes read 
Attempt to count the number of bytes which this process really did cause to 
be fetched from the storage layer. Done at the submit_bio() level, so it is 
accurate for block-backed filesystems. <please add status regarding NFS and 
CIFS at a later time> 


write_bytes 
----------- 

I/O counter: bytes written 
Attempt to count the number of bytes which this process caused to be sent to 
the storage layer. This is done at page-dirtying time. 
+2

+1 इस संकेत ने मेरे जीवन को बचाया – lupz

+0

उत्कृष्ट .. वास्तव में सहायक। – Vineeth