2012-05-17 9 views
5

मैंने एसक्यूएल-प्रश्नों की आईओ-गतिविधि को मापने के लिए proc/<pid>/io पढ़ा, जहां <pid> डेटाबेस सर्वर का पीआईडी ​​है। मैंने अंतर की गणना करने के लिए प्रत्येक प्रश्न से पहले और बाद में मूल्यों को पढ़ा और बाइट्स की संख्या को पढ़ने और/या लिखे जाने वाले अनुरोधों को प्राप्त किया।क्या आरसीएचएआर में READ_BYTES (proc/<pid>/io) शामिल हैं?

मैं क्षेत्र पता READ_BYTES मायने रखता है वास्तविक डिस्क-आईओ जहां तक ​​है, जबकि RCHAR, अधिक शामिल हैं पढ़ता है जैसे कि linux पेज कैश से संतुष्ट किया जा सकता है (स्पष्टीकरण के लिए Understanding the counters in /proc/[pid]/io देखें)। यह धारणा की ओर जाता है, कि RCHARREAD_BYTES से अधिक या अधिक मान के साथ आना चाहिए, लेकिन मेरे परिणाम इस धारणा का खंडन करते हैं।

मैं परिणामों के लिए कुछ मामूली ब्लॉक या पेज भूमि के ऊपर मैं Infobright बर्फ के लिए मिलता है कल्पना कर सकता (मूल्यों एमबी हैं):

 Query  RCHAR READ_BYTES 
tpch_q01.sql| 34.44180| 34.89453| 
tpch_q02.sql|  2.89191|  3.64453| 
tpch_q03.sql| 32.58994| 33.19531| 
tpch_q04.sql| 17.78325| 18.27344| 

लेकिन मैं पूरी तरह से (मूल्यों एमबी कर रहे हैं) MonetDB के लिए आईओ-काउंटर को समझने में विफल :

 Query  RCHAR READ_BYTES 
tpch_q01.sql|  0.07501| 220.58203| 
tpch_q02.sql|  1.37840| 18.16016| 
tpch_q03.sql|  0.08272| 162.38281| 
tpch_q04.sql|  0.06604| 83.25391| 

Am मैं इस धारणा है कि RCHARREAD_BYTES शामिल के साथ गलत? क्या कर्नेल काउंटरों को बाहर निकालने का कोई तरीका है, जो मोनेट डीबी उपयोग कर सकता है? यहाँ क्या हो रहा है?

मैं जोड़ सकता हूं, कि मैं पृष्ठ कैश साफ़ करता हूं और प्रत्येक क्वेरी से पहले डेटाबेस-सर्वर को पुनरारंभ करता हूं। मैं उबंटू 11.10 पर हूं, कर्नेल 3.0.0-15-जेनेरिक चल रहा हूं।

उत्तर

3

मैं केवल दो चीजें हैं के बारे में सोच सकते हैं:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/proc.txt;hb=HEAD#l1305

1:

1446 read_bytes 
1447 ---------- 
1448 
1449 I/O counter: bytes read 
1450 Attempt to count the number of bytes which this process really did cause to 
1451 be fetched from the storage layer. 

मैंने पढ़ा है, जो कुछ भी Readahead शामिल करने के लिए "भंडारण परत से लाना वजह"।

2:

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

ध्यान दें कि इस बारे में "के माध्यम से स्मृति मैप की गई फ़ाइलों डिस्क का उपयोग" कुछ नहीं कहते हैं। मुझे लगता है कि यह अधिक संभावित कारण है, और यह कि आपका मॉनेट डीबी शायद अपनी डेटाबेस फाइलों को मिटा देता है और फिर उन पर सबकुछ करता है।

मुझे सच में यकीन नहीं है कि आप अपनी प्रकृति के कारण एमएमएपी पर इस्तेमाल की गई बैंडविड्थ की जांच कैसे कर सकते हैं।

+0

धन्यवाद। दरअसल, [मोनेट डीबी आर्किटेक्चर डॉक्स] (http://www.monetdb.org/Documentation/Manuals/MonetDB/Architecture) कहते हैं, कि वे मेमोरी मैप की गई फ़ाइलों का उपयोग करते हैं। – lupz

0

तुम भी लिनक्स कर्नेल स्रोत कोड फ़ाइल पढ़ सकते हैं: /include/linux/task_io_accounting.h

struct task_io_accounting { 
#ifdef CONFIG_TASK_XACCT 
    /* bytes read */ 
    u64 rchar; 
    /* bytes written */ 
    u64 wchar; 
    /* # of read syscalls */ 
    u64 syscr; 
    /* # of write syscalls */ 
    u64 syscw; 
#endif /* CONFIG_TASK_XACCT */ 

#ifdef CONFIG_TASK_IO_ACCOUNTING 
    /* 
    * The number of bytes which this task has caused to be read from 
    * storage. 
    */ 
    u64 read_bytes; 

    /* 
    * The number of bytes which this task has caused, or shall cause to be 
    * written to disk. 
    */ 
    u64 write_bytes; 

    /* 
    * A task can cause "negative" IO too. If this task truncates some 
    * dirty pagecache, some IO which another task has been accounted for 
    * (in its write_bytes) will not be happening. We _could_ just 
    * subtract that from the truncating task's write_bytes, but there is 
    * information loss in doing that. 
    */ 
    u64 cancelled_write_bytes; 
#endif /* CONFIG_TASK_IO_ACCOUNTING */ 
}; 
संबंधित मुद्दे